You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Leo <le...@tstt.net.tt> on 2004/04/24 14:29:38 UTC

PDF Formatting of document

Hi folks

What I want to achieve:
Generate a PDF document with
1)	Table of Contents
2)	Table of Tables
3)	Table of Figures
4)	Document content
Now the document2fo.xsl by default will handle (1) and (4), so I am
modifying
to include (2) and (3)

Problem:
Table of Contents still works fine, but the Table of Tables (and also Table
of Figures)
appears as follows

Table of Tables
Table 3.2. ** 1 Comparison of
Solutions.....................................................
Table 4.3. ** 2 Market Trends
2000..........................................................
Table 4.4. ** 3 Market Trends
2004..........................................................
Table 5.2.2. ** 4 Store
Document............................................................

a)	The page numbers are not displaying
b)	Ideally I would like to number tables within chapters ie( Table 3.1,
4.1,4.2, 5.1)
	but have not quite figured how to do this.
	The section number is represented on the left of the '**'
	The number relative to the entire document is right of the '**'

What I have done: Modify document2fo.xsl
After the following code snippet
       <fo:block font-family="serif" font-size="14pt" font-weight="bold"
      space-after="5pt" space-before="5pt" text-align="justify"
width="7.5in">
        <!-- insert i18n stuff here -->
        <xsl:text>Table of contents</xsl:text>
      </fo:block>
      <fo:block font-family="sans" font-size="12pt" space-after="5pt"
      space-before="0pt" text-align="justify" width="7.5in">
          <xsl:apply-templates select="section" mode="toc" />
      </fo:block>

Added following code block
     <fo:block font-family="serif" font-size="14pt" font-weight="bold"
break-before="page"
      space-after="5pt" space-before="5pt" text-align="justify"
width="7.5in">
        <!-- insert i18n stuff here -->
        <xsl:text>Table of Tables</xsl:text>
      </fo:block>
     <fo:block font-family="sans" font-size="12pt" space-after="5pt"
      space-before="0pt" text-align="justify" width="7.5in">
	<xsl:apply-templates select="//table" mode="toc" />
      </fo:block>

Also added
     <xsl:template match="//table" mode="toc">
    <fo:block space-before="5pt" text-align-last="justify">
      <fo:inline>
        <fo:basic-link internal-destination="{generate-id(.)}">
	  <xsl:text>Table </xsl:text>
          <xsl:number count="section" format="1." level="multiple" />
	   ** <xsl:number level="any" count="//table" format="1"/>
 	  <xsl:text>  </xsl:text>
          <xsl:value-of select="caption" />
          <fo:leader leader-pattern="dots" />
          <fo:page-number-citation ref-id="{generate-id(.)}" />
	</fo:basic-link>
      </fo:inline>
    </fo:block>
  </xsl:template>


I need to get the page numbering working.


Regards
Leo