Moving the TOC behind Frontmatter

I wanted the TOC to appear after my copyright pages, but before chapter 1. By default, ePublisher creates a TOC and puts it before any front matter.

ePublisher Default

Cover

TOC

Frontmatter (Copyright pages)

Chapter 1

What I would like

Cover

Frontmatter (Copyright pages)

TOC

Chapter 1

To achieve this you must edit these files:

Use a diff tool to compare changes of the first four files (which are based on 2012.4) with yours.

Add the <othermeta content="Default" name="PageStyle"/> to your non-frontmatter DITA files and <othermeta content="Frontmatter" name="PageStyle"/> to your frontmatter DITA files. In the .zip file, I added comments to my DITA files to highlight important areas. Rescan your ditamap so that ePublisher gets the new Page Style and Paragraph Style (e.g., ignore).

Set the 'ignore' Paragraph Style's Options > Table of contents level to 'None,' then Generate.

I don't know why, but a second Cover page (without any text overlays) is created, which is why you'll see the second page is blank. It's not blank if you have a background image for your cover page, but any $Title text is left off. Someone smarter than me will need to determine where that's coming from and hide it. Hopefully, they'll update this project. I suspect it's something something to do with the <frontmatter-sequences>, but I'm not sure.

Sample files (based on 2012.4, see below for 2014.1): frontmatter_toc.zip

Update 4. June 2013

Thanks to Judi Taugher, I know the reason why the second cover page was being added. In the previously attached frontmatter_toc.zip file in the flow-preprocesses.xsl file is a line that sets the initial page number:

   <!-- Main page sequence -->
   <!--                    -->
   <fo:page-sequence master-reference="{$VarFlow/@name}-pages">
    <xsl:if test="position() = 1">
     <xsl:attribute name="initial-page-number">1</xsl:attribute>  <-- THIS LINE HERE.
     <xsl:attribute name="format">i</xsl:attribute>
    </xsl:if>

As it turns out, that line is responsible. In one of my PDF targets (the one I use for my print vendor), I do need the line present because I do not have a cover inserted in that target. For most of my other PDF targets, I removed that line. By removing the line only a single cover file is inserted. So the take away is...if you are inserting a cover, remove that line from flows-preprocess.xsl. If you are not inserting a cover, then the line is safe.

Update 8. Dec 2014

Due to changes in Page.asp, content.xsl and flows-preprocess.xsl, I am uploading a project that works with 2014.1. Some of the changes were actually made earlier (in 2013.something).

Sample project: frontmatter_toc2014.1.zip

HelpCenter/Tips/PDF XSL-FO: Moving TOC behind Frontmatter (last edited 2014-12-08 22:55:28 by LiefErickson)