Footnotes

In this example footnotes are generated and displayed at the bottom of the page.

The example shall demonstrate how the generation and placing of footnotes works. The footnotes are separated from the content region by a line. Footnotes are not part of the footer of a page but of the content region because the content and the footnotes have to share the space determined for the content. The list concept is used in order to arrange the footnote characters and the footnote content.

Excerpt from the DTD:

<!ELEMENT P (#PCDATA | ... | Fn)*>          ❶            
<!ELEMENT Fn (FnC, FnP+)>                   ❷ 
<!ELEMENT FnC (#PCDATA)>                    
<!ELEMENT FnP (#PCDATA | ...)*> 

❶ Footnotes are valid in the normal paragraph text.

❷ Footnotes consist of the footnote character and of one or several footnote paragraphs. The automated counting of the footnotes is not displayed in this example.

Excerpt from the XML instance:

<P> ... <Fn><FnC>34</FnC><FnP>This is the footnote content.</FnP></Fn> ...</P>  ❶

❶ The footnote is completely inserted into the paragraph text where it shall be anchored. When typesetting only the footnote character shall appear in the paragraph text and the complete footnote at the bottom print space margin.

Stylesheet:

 

<fo:page-sequence master-reference="PageMaster.Content">
...
   <fo:static-content flow-name="xsl-footnote-separator">                       ❶
      <fo:block text-align-last="justify" space-before="5mm" space-after="3mm"> ❷
         <fo:leader leader-length="30%" rule-thickness="1pt" leader-pattern="rule"/>
      </fo:block>
   </fo:static-content>
...
</fo:page-sequence>
... 
<xsl:template match="Fn">
   <fo:footnote> 
      <fo:inline baseline-shift="super" font-size="70%">                        ❸
         <xsl:value-of select="FnC"/>
      </fo:inline>
      <fo:footnote-body>                                                        ❹
         <fo:list-block provisional-distance-between-starts="5mm">
            <fo:list-item> 
               <fo:list-item-label end-indent="label-end()"> 
                  <fo:block>
                     <xsl:value-of select="FnC"/>
                  </fo:block>
               </fo:list-item-label>
               <fo:list-item-body start-indent="body-start()"> 
                  <fo:block>
                     <xsl:apply-templates select="FnP"/>
                  </fo:block>
               </fo:list-item-body>
            </fo:list-item>
         </fo:list-block>
      </fo:footnote-body>
   </fo:footnote>
</xsl:template>

 

❶ Within the determinations for the given page sequence the static region has to be defined for the region between the content and the footnotes. This static region has the fixed flow name xsl-footnote-separator.

❷ For this region a block is specified having a footnote line as content and by which the space to the top to the content and to the bottom to the beginning of the first footnote is defined.

❸ The <fo:footnote> footnote has two sub-elements: the first sub-element <fo:inline> includes the content displayed in the running paragraph text. Usually, the footnote characters are superscripted and their font size is smaller than the one of the surrounding text. Please note: This inline element may only appear once.

❹ The second sub-element of <fo:footnote>, which means the content appearing in the footnote region, is generated in form of a list. The footnote characters are cropped at the left margin. The footnote content is indented by the value of provisional-distance-between-starts. The <fo:list-item-label> contains the footnote character, the <fo:list-item-body> contains the footnote paragraphs.

 

<< back next >>

Copyright © dpunkt.verlag GmbH 2004
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSL-FO in der Praxis" ("XSL-FO in practice") is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

dpunkt.verlag GmbH, Ringstraße 19B, 69115 Heidelberg, fon 06221-14830, fax 06221-148399, hallo@dpunkt.de