Chapter 16. Footnotes

Table of Contents

Footnote numbers and symbols
Formatting footnotes in HTML
Formatting footnotes in print
End notes

Footnotes in DocBook are another form of linking. A footnote reference in HTML output is an active link to the footnote text, which is located elsewhere. Likewise, the label on the footnote is also a link back to the reference symbol in the body text. In print output, the linkage is just visual since the footnote is on the same page.

In DocBook you write a footnote element at the point in a paragraph where you want the footnote reference (number or symbol) to appear. For example:

<para>During the installation of
the product<footnote><para>In versions 2.3 and 2.4.</para>
</footnote> you may see messages such as these.
</para>

When processed, the footnote reference symbol will appear where the footnote start tag appears. If you do not want a space before the symbol, then do not put a space or line break before the start tag. The body of the footnote is moved to another location, with links connecting the reference symbol and the footnote.

In HTML output, footnotes are collected and output at the appropriate opportunity. In non-chunked output, the collected footnotes are output at the end of each chapter, appendix, or other component. In chunked output, footnotes are output at the end of each chunk. The exception is footnotes in tables, which have a separate numbering sequence and appear at the bottom of their respective tables.

In printed output, footnotes are output at the bottom of each page. In addition, if the ulink.footnotes parameter is not zero, then the URL associated with a ulink element will also be treated as a footnote. Table footnotes appear at the bottom of their respective tables. There is no stylesheet parameter to generate end notes instead of footnotes, but there is a customization you can use, as described in the section “End notes”.

If you need to reference the same footnote more than once, you can use the footnoteref element. This empty element is used like an xref, where its linkend attribute matches the id value that you put on the footnote element that it is referencing. When processed, the footnoteref element will have the same symbol or number as the footnote it references. This lets more than one location in your document point to the same footnote, so you do not have to repeat it.

Footnote numbers and symbols

By default, footnotes are numbered sequentially. In HTML output, the number sequence is continuous throughout the document, regardless of whether it is chunked or not. In FO output, the numbering sequence restarts at 1 at the beginning of each chapter, appendix, and other component. If the ulink.footnotes parameter is not zero, then the footnotes generated for ulink elements in FO output will be mixed in the same numbering sequence.

There is no option that lets you restart numbering on each page of FO output. Such automatic numbering is not a feature of the XSL-FO 1.0 standard. The numbers are added by the DocBook XSL stylesheet, but stylesheet does not know where the page breaks are, because the XSL-FO processor determines them.

You can alter the number format for numbered footnotes. If you set the parameter footnote.number.format to A, for example, then footnotes will be numbered A, B, C, etc. You can use any of the formats supported by XSLT, including A, a, I, i, and 1 (the default). There is a separate parameter table.footnote.number.format for table footnotes. That can be useful to distinguish table footnotes from regular footnotes.

If you want to use symbols instead of numbers to mark footnotes, then use the footnote.number.symbols parameter. This parameter should be set to a string of single characters without any separation. Each character will be used in turn as a footnote mark. A character can be represented by a numerical character reference as well. For example:

<xsl:param name="footnote.number.symbols">*&#x2020;&#x2021;</xsl:param>

The first character is * and will be used for the first footnote. The second character is &#x2020; (dagger) and will be used for the second footnote. The third character is &#x2021; (double dagger) and will be used for the third footnote. Any footnote numbers that exceed the length of the string will revert back to numbers, staring with 4 in this case.

For footnotes in tables, a separate table.footnote.number.symbols parameter works in the same way.

Whatever symbols you use in either parameter, be sure they can be rendered by your XSL-FO processor in the font you are using. Likewise for HTML output, as not all Unicode characters are available in all browser fonts.

Any time you need to override the mark for a given footnote, you can add a label attribute on the footnote. Whatever you put in the attribute will be used for the footnote mark. It need not be a single character.

If you need to completely replace the footnote numbering scheme with another scheme, then you will have to customize the template that starts with the following line, in the footnote.xsl stylesheet module:

<xsl:template match="footnote" mode="footnote.number">