Blob Blame History Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Footnotes</title><link rel="stylesheet" type="text/css" href="manual.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="DocBook to LaTeX Publishing" /><link rel="up" href="ch03.html" title="Chapter 3. Using dblatex" /><link rel="prev" href="sec-xref.html" title="Using XRefsyle and Olinks" /><link rel="next" href="sec-custom.html" title="Chapter 4. Customization" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Footnotes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-xref.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using dblatex</th><td width="20%" align="right"> <a accesskey="n" href="sec-custom.html">Next</a></td></tr></table><hr /></div><div class="section" title="Footnotes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-footnote"></a>Footnotes</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="sec-footnote.html#sec-footnote-basic">Footnote Numbering Scope</a></span></dt><dt><span class="section"><a href="sec-footnote.html#sec-footnote-endnote">End Notes</a></span></dt></dl></div><div class="section" title="Footnote Numbering Scope"><div class="titlepage"><div><div><h3 class="title"><a id="sec-footnote-basic"></a>Footnote Numbering Scope</h3></div></div></div><p>The foonotes are well handled by latex. Dblatex just takes care about
special cases like footnotes in headings or in tables. Therefore the default
latex behaviour is applied for footnote numbering.</p><p>By default the footnote numbers are reset for each new chapter. If you
want to change the numbering scope, you can use the latex package <span class="package">chngcntr</span> either in a customized latex style (see <a class="xref" href="sec-custom.html" title="Chapter 4. Customization">Chapter 4, <em>Customization</em></a>) or in the parameter <em class="parameter"><code>latex.begindocument</code></em>. The following example makes the footnote numbers document wide.</p><pre class="programlisting">
  &lt;xsl:param name="latex.begindocument"&gt;
    &lt;xsl:text&gt;
% Want document wide footnotes
\usepackage{chngcntr}
\counterwithout{footnote}{chapter}
\begin{document}
    &lt;/xsl:text&gt;
  &lt;/xsl:param&gt;
</pre></div><div class="section" title="End Notes"><div class="titlepage"><div><div><h3 class="title"><a id="sec-footnote-endnote"></a>End Notes</h3></div></div></div><div class="toc"><dl><dt><span class="section"><a href="sec-footnote.html#idm3697880">Writing a document with endnotes</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idm968688">Setup Properties</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp1510560">Endnotes Setup from scratch</a></span></dt><dt><span class="section"><a href="sec-footnote.html#sec-endnotes-group">Grouping Endnotes</a></span></dt></dl></div><p>You can configure <span class="command"><strong>dblatex</strong></span> to manage the footnotes as
endnotes. In this case the notes are expected to be displayed in a dedicated
section.  The following sections tell how to do this.</p><div class="section" title="Writing a document with endnotes"><div class="titlepage"><div><div><h4 class="title"><a id="idm3697880"></a>Writing a document with endnotes</h4></div></div></div><p>To have footnotes behaving as endnotes, you just need to set the
<em class="parameter"><code>footnote.as.endnote</code></em> to 1, and to put in your document an
empty <code class="sgmltag-element">index</code> element with the attribute
<code class="sgmltag-element">type</code> set to 'endnotes'. This index is supposed to be included
in a section dedicated to contain the notes, and therefore it does not display
any heading by itself. The section containing the endnotes index can also 
contain any other materials.</p><div class="example"><a id="idp3717792"></a><p class="title"><strong>Example 3.17. Writing a document with endnotes</strong></p><div class="example-contents"><p>The following document contains some footnotes and a section for
the End Notes:
</p><pre class="programlisting">
&lt;book&gt;
  &lt;chapter&gt;&lt;title&gt;A Chapter&lt;/title&gt;
  &lt;para&gt;Bla bla<span class="bold"><strong>&lt;footnote id="fn1"&gt;First note&lt;/footnote&gt;</strong></span> bla 
  bla<span class="bold"><strong>&lt;footnote id="fn2"&gt;Second note&lt;/footnote&gt;</strong></span> ...&lt;/para&gt;
  &lt;/chapter&gt;

  &lt;chapter&gt;&lt;title&gt;Another Chapter&lt;/title&gt;
  &lt;para&gt;Bla bla<span class="bold"><strong>&lt;footnote id="fn3"&gt;Third note&lt;/footnote&gt;</strong></span> bla 
  bla<span class="bold"><strong>&lt;footnote id="fn4"&gt;Fourth note&lt;/footnote&gt;</strong></span> ...&lt;/para&gt;
  &lt;/chapter&gt;

  &lt;chapter&gt;&lt;title&gt;End Notes&lt;/title&gt;
  &lt;para&gt;This chapter contains all the notes of the book.&lt;/para&gt;

  <span class="bold"><strong>&lt;index type="endnotes"/&gt;</strong></span>
  &lt;/chapter&gt;
&lt;/book&gt;
</pre><p>
</p><p><span class="command"><strong>dblatex</strong></span> is called with:</p><pre class="screen">$ dblatex -P <span class="bold"><strong>footnote.as.endnote=1</strong></span> file.xml</pre></div></div><br class="example-break" /></div><div class="section" title="Setup Properties"><div class="titlepage"><div><div><h4 class="title"><a id="idm968688"></a>Setup Properties</h4></div></div></div><p>Currently the endnotes are handled by the latex package 
<span class="package">endnotes</span>. You can customize its use with
the <em class="parameter"><code>endnotes.properties</code></em> attribute set. This attribute set
is filled by default with the values given by the internal attribute set 
<em class="parameter"><code>endnotes.properties.default</code></em>, and you can override the
following attributes:</p><div class="variablelist"><dl><dt><span class="term"><code class="sgmltag-element">package</code></span></dt><dd>Recall the latex package in charge to handle the 
    endnotes. Attribute provided for provision since currently there is
    no real alternative with well established packages.</dd><dt><span class="term"><code class="sgmltag-element">heading</code></span></dt><dd>Macros to render the heading of the endnotes
    to display.</dd><dt><span class="term"><code class="sgmltag-element">font-size</code></span></dt><dd>Macro specifying the font size to apply for each endnote.
    The package default is <code class="literal">\footnotesize</code>. The dblatex default
    is <code class="literal">\normalsize</code>.</dd><dt><span class="term"><code class="sgmltag-element">note-format</code></span></dt><dd>Macros specifying how the render a end note. The 
    package default is the same formatting that footnotes. The dblatex
    default is to print out endnotes like a numbered list.</dd></dl></div><p>The default setup:</p><pre class="programlisting">
&lt;xsl:attribute-set name="endnotes.properties.default"&gt;
  &lt;xsl:attribute name="package"&gt;endnotes&lt;/xsl:attribute&gt;

  &lt;!-- No header: endnotes are embedded in another section --&gt;
  &lt;xsl:attribute name="heading"&gt;\mbox{}\par&lt;/xsl:attribute&gt;

  &lt;!-- Show end notes as a numbered list --&gt;
  &lt;xsl:attribute name="font-size"&gt;\normalsize&lt;/xsl:attribute&gt;
  &lt;xsl:attribute name="note-format"&gt;%
  \leftskip=1.8em\noindent
  \makebox[0pt][r]{\theenmark.~~\rule{0pt}{\baselineskip}}\ignorespaces
  &lt;/xsl:attribute&gt;
&lt;/xsl:attribute-set&gt;

&lt;xsl:attribute-set name="endnotes.properties"
                   use-attribute-sets="endnotes.properties.default"/&gt;
</pre></div><div class="section" title="Endnotes Setup from scratch"><div class="titlepage"><div><div><h4 class="title"><a id="idp1510560"></a>Endnotes Setup from scratch</h4></div></div></div><p>If you want to fully control the endnotes setup, add some other macros,
you can directly override the
template <code class="literal">endnotes.setup</code>, as shown by the example below.
If the endnote setup is already defined in your latex style you can override
the template to make it empty in order to avoid some conflict between the latex style
definition and the default one done by dblatex.</p><pre class="programlisting">
&lt;!-- Use the default endnotes package setup and change the heading --&gt;
&lt;xsl:template name="endnotes.setup"&gt;
  &lt;xsl:text&gt;\usepackage{endnotes}&amp;#10;&lt;/xsl:text&gt;
  &lt;xsl:text&gt;\def\enoteheading{\paragraph*{List Of Notes}%
  \mbox{}\par\vskip-\baselineskip}&amp;#10;&lt;/xsl:text&gt;
&lt;/xsl:template&gt;
</pre></div><div class="section" title="Grouping Endnotes"><div class="titlepage"><div><div><h4 class="title"><a id="sec-endnotes-group"></a>Grouping Endnotes</h4></div></div></div><div class="toc"><dl><dt><span class="section"><a href="sec-footnote.html#idm115960">Adding new Groups</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp3901648">Formatting the Headings text</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp4352576">LaTeX Command to make the Headings</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp1519128">Endnotes Counter Scope</a></span></dt></dl></div><p>By default the endnotes are displayed for the whole document as a global
list. You can configure dblatex to show the endnotes grouped per part or per chapter. A heading is put before each group of notes to recall the component (part, chapter, or another section) that contains these notes. The purpose is to make the research of the notes at the end of the document easier for the reader.</p><p>To group the endnotes according to the granularity you wish,
you just need to
set the <em class="parameter"><code>endnotes.heading.groups</code></em> with the expected section
types separated by a space. For example, the following setup displays
notes per part and per chapter:</p><pre class="programlisting">
  &lt;xsl:param name="footnote.as.endnote" select="1"/&gt;
  &lt;xsl:param name="endnotes.heading.groups" select="'part chapter'"/&gt;
</pre><div class="section" title="Adding new Groups"><div class="titlepage"><div><div><h5 class="title"><a id="idm115960"></a>Adding new Groups</h5></div></div></div><p>By default dblatex can group the notes per chapter and/or per part,
provided that the section type is declared in <em class="parameter"><code>endnotes.heading.groups</code></em> as explained previously. If you want to add another section type you need to override the template called in mode <code class="literal">endnotes</code>, and to add this type to the declared groups. Usually the <code class="literal">endnotes</code> mode template only calls the <code class="function">endnotes.add.header</code> template. The example below makes a new group for <code class="sgmltag-element">preface</code>.</p><pre class="programlisting">
  &lt;xsl:param name="endnotes.heading.groups" select="'part chapter preface'"/&gt;

  &lt;xsl:template match="preface" mode="endnotes"&gt;
    &lt;xsl:call-template name="endnotes.add.header"&gt;
      &lt;xsl:with-param name="reset-counter" select="1"/&gt;
    &lt;/xsl:call-template&gt;
  &lt;/xsl:template&gt;
</pre></div><div class="section" title="Formatting the Headings text"><div class="titlepage"><div><div><h5 class="title"><a id="idp3901648"></a>Formatting the Headings text</h5></div></div></div><p>You can use the parameter
<em class="parameter"><code>endnotes.heading.style</code></em> to format the headings of the groups with the same syntax than <code class="sgmltag-element">xrefstyle</code> does. The example below gives a template where the title and the page of the chapter containing
the notes are displayed.</p><pre class="programlisting">
  &lt;xsl:param name="endnotes.heading.style"&gt;
    &lt;xsl:text&gt;template:Notes of the chapter "%t", page %p&lt;/xsl:text&gt;
  &lt;/xsl:param&gt;
</pre></div><div class="section" title="LaTeX Command to make the Headings"><div class="titlepage"><div><div><h5 class="title"><a id="idp4352576"></a>LaTeX Command to make the Headings</h5></div></div></div><p>By default <span class="command"><strong>dblatex</strong></span> creates the headings of the groups
with a section command whose level is just below the level of the endnotes 
section. For example, if the endnotes section is a chapter, the headings are
created by using a <code class="literal">\section*</code> latex command. If the endnotes
section is a section, the headings are done by using
<code class="literal">\subsection*</code>, and so on.</p><p>If this behaviour does not fit your needs you can specify the command to use with the parameter <em class="parameter"><code>endnotes.heading.command</code></em>. It can be usefull if you want to format these heading in a specific way. The heading markup produced following the <em class="parameter"><code>endnotes.heading.style</code></em> template is passed as an argument of
the specified command. The example below uses the command
<code class="literal">\enoteheader*</code> to create the headings. It assumes that this
macro is defined somewhere else (e.g. in a user latex style).</p><pre class="programlisting">
  &lt;xsl:param name="endnotes.heading.command" select="'\enoteheader*'"/&gt;
</pre></div><div class="section" title="Endnotes Counter Scope"><div class="titlepage"><div><div><h5 class="title"><a id="idp1519128"></a>Endnotes Counter Scope</h5></div></div></div><p>By default the endnotes counter restarts from one in each chapter or
part when they are grouped. You can change this behaviour by overriding
the <em class="parameter"><code>endnotes.counter.resetby</code></em> parameter that lists
the section types where the counter is reset. If you want a global
counter running for the whole document, just set the parameter empty.</p></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-xref.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sec-custom.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Using XRefsyle and Olinks </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. Customization</td></tr></table></div></body></html>