Table of Contents
More Resources
Modifying the Header

Customize the header for the Table of Contents.
You want to edit the custom-attrs.xsl file (located in cfg/fo/attrs/) to modify the default header for the Table of Contents.
    Changing the Header Text
  1. Open the en.xml file located in cfg/common/vars.

    Step Information

    The default header for the Table of Contents is “Contents”

    It uses the following code:
    < !-- The heading string to put at the top of the Table of Contents --> 
    < variable id="Table of Contents"> Contents< /variable> 
    Note:If you have the default ex.xml copied from pdf2, the “Table of Contents” variable is located on line 124.
  2. To change the header text, modify the elements within the Table of Contents variable:

    Expected Result
    < !-- The heading string to put at the top of the Table of Contents --> 
    < variable id="Table of Contents"> The TOC< /variable> 

  3. Modifying the Header Styling
  4. Open the custom-attrs.xsl.

    Step Information
    The default attribute set used for the Table of Contents header is the following:

  5. To can change the styling of the header, copy and paste the default attribute set for the Table of Conents header into the custom-attrs.xsl file.

    Step Information
    < xsl:attribute-set name="__toc__header" use-attribute-sets="common.title"> 
      < xsl:attribute name="space-before"> 0pt< /xsl:attribute> 
      < xsl:attribute name="space-after"> 16.8pt< /xsl:attribute> 
      < xsl:attribute name="font-size"> 20pt< /xsl:attribute> 
      < xsl:attribute name="font-weight"> bold< /xsl:attribute> 
      < xsl:attribute name="padding-top"> 16.8pt< /xsl:attribute> 
    < /xsl:attribute-set> 

  6. Modify any of the attributes to customize the header styling.

    Example
    The create the following header styling,
    Use the following code:
    < xsl:attribute-set name="__toc__header" use-attribute-sets="common.title"> 
      < xsl:attribute name="space-before"> 0pt< /xsl:attribute> 
      < xsl:attribute name="space-after"> 16.8pt< /xsl:attribute> 
      < xsl:attribute name="font-size"> 20pt< /xsl:attribute> 
      < xsl:attribute name="font-weight"> normal< /xsl:attribute> 
      < xsl:attribute name="padding-top"> 16.8pt< /xsl:attribute> 
      < xsl:attribute name="text-align"> center< /xsl:attribute> 
      < xsl:attribute name="color"> red< /xsl:attribute> 
    < /xsl:attribute-set> 

The Table of Contents header is modified.