Debian Codegraph @

docs/xhtml/manual/sec-footnote.html

raw
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!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.79.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"><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 class="toc"><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"><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
3 special cases like footnotes in headings or in tables. Therefore the default
4 latex behaviour is applied for footnote numbering.</p><p>By default the footnote numbers are reset for each new chapter. If you
5 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">
6 &lt;xsl:param name="latex.begindocument"&gt;
7 &lt;xsl:text&gt;
8 % Want document wide footnotes
9 \usepackage{chngcntr}
10 \counterwithout{footnote}{chapter}
11 \begin{document}
12 &lt;/xsl:text&gt;
13 &lt;/xsl:param&gt;
14 </pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="sec-footnote-endnote"></a>End Notes</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="sec-footnote.html#idp1953">Writing a document with endnotes</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp1972">Setup Properties</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp2003">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
15 endnotes. In this case the notes are expected to be displayed in a dedicated
16 section. The following sections tell how to do this.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp1953"></a>Writing a document with endnotes</h4></div></div></div><p>To have footnotes behaving as endnotes, you just need to set the
17 <em class="parameter"><code>footnote.as.endnote</code></em> to 1, and to put in your document an
18 empty <code class="sgmltag-element">index</code> element with the attribute
19 <code class="sgmltag-element">type</code> set to 'endnotes'. This index is supposed to be included
20 in a section dedicated to contain the notes, and therefore it does not display
21 any heading by itself. The section containing the endnotes index can also
22 contain any other materials.</p><div class="example"><a id="idp1959"></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
23 the End Notes:
24 </p><pre class="programlisting">
25 &lt;book&gt;
26 &lt;chapter&gt;&lt;title&gt;A Chapter&lt;/title&gt;
27 &lt;para&gt;Bla bla<span class="bold"><strong>&lt;footnote id="fn1"&gt;First note&lt;/footnote&gt;</strong></span> bla
28 bla<span class="bold"><strong>&lt;footnote id="fn2"&gt;Second note&lt;/footnote&gt;</strong></span> ...&lt;/para&gt;
29 &lt;/chapter&gt;
30
31 &lt;chapter&gt;&lt;title&gt;Another Chapter&lt;/title&gt;
32 &lt;para&gt;Bla bla<span class="bold"><strong>&lt;footnote id="fn3"&gt;Third note&lt;/footnote&gt;</strong></span> bla
33 bla<span class="bold"><strong>&lt;footnote id="fn4"&gt;Fourth note&lt;/footnote&gt;</strong></span> ...&lt;/para&gt;
34 &lt;/chapter&gt;
35
36 &lt;chapter&gt;&lt;title&gt;End Notes&lt;/title&gt;
37 &lt;para&gt;This chapter contains all the notes of the book.&lt;/para&gt;
38
39 <span class="bold"><strong>&lt;index type="endnotes"/&gt;</strong></span>
40 &lt;/chapter&gt;
41 &lt;/book&gt;
42 </pre><p>
43 </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"><div class="titlepage"><div><div><h4 class="title"><a id="idp1972"></a>Setup Properties</h4></div></div></div><p>Currently the endnotes are handled by the latex package
44 <span class="package">endnotes</span>. You can customize its use with
45 the <em class="parameter"><code>endnotes.properties</code></em> attribute set. This attribute set
46 is filled by default with the values given by the internal attribute set
47 <em class="parameter"><code>endnotes.properties.default</code></em>, and you can override the
48 following attributes:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="sgmltag-element">package</code></span></dt><dd>Recall the latex package in charge to handle the
49 endnotes. Attribute provided for provision since currently there is
50 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
51 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.
52 The package default is <code class="literal">\footnotesize</code>. The dblatex default
53 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
54 package default is the same formatting that footnotes. The dblatex
55 default is to print out endnotes like a numbered list.</dd></dl></div><p>The default setup:</p><pre class="programlisting">
56 &lt;xsl:attribute-set name="endnotes.properties.default"&gt;
57 &lt;xsl:attribute name="package"&gt;endnotes&lt;/xsl:attribute&gt;
58
59 &lt;!-- No header: endnotes are embedded in another section --&gt;
60 &lt;xsl:attribute name="heading"&gt;\mbox{}\par&lt;/xsl:attribute&gt;
61
62 &lt;!-- Show end notes as a numbered list --&gt;
63 &lt;xsl:attribute name="font-size"&gt;\normalsize&lt;/xsl:attribute&gt;
64 &lt;xsl:attribute name="note-format"&gt;%
65 \leftskip=1.8em\noindent
66 \makebox[0pt][r]{\theenmark.~~\rule{0pt}{\baselineskip}}\ignorespaces
67 &lt;/xsl:attribute&gt;
68 &lt;/xsl:attribute-set&gt;
69
70 &lt;xsl:attribute-set name="endnotes.properties"
71 use-attribute-sets="endnotes.properties.default"/&gt;
72 </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="idp2003"></a>Endnotes Setup from scratch</h4></div></div></div><p>If you want to fully control the endnotes setup, add some other macros,
73 you can directly override the
74 template <code class="literal">endnotes.setup</code>, as shown by the example below.
75 If the endnote setup is already defined in your latex style you can override
76 the template to make it empty in order to avoid some conflict between the latex style
77 definition and the default one done by dblatex.</p><pre class="programlisting">
78 &lt;!-- Use the default endnotes package setup and change the heading --&gt;
79 &lt;xsl:template name="endnotes.setup"&gt;
80 &lt;xsl:text&gt;\usepackage{endnotes}&amp;#10;&lt;/xsl:text&gt;
81 &lt;xsl:text&gt;\def\enoteheading{\paragraph*{List Of Notes}%
82 \mbox{}\par\vskip-\baselineskip}&amp;#10;&lt;/xsl:text&gt;
83 &lt;/xsl:template&gt;
84 </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="sec-endnotes-group"></a>Grouping Endnotes</h4></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="sec-footnote.html#idp2014">Adding new Groups</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp2023">Formatting the Headings text</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp2029">LaTeX Command to make the Headings</a></span></dt><dt><span class="section"><a href="sec-footnote.html#idp2040">Endnotes Counter Scope</a></span></dt></dl></div><p>By default the endnotes are displayed for the whole document as a global
85 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,
86 you just need to
87 set the <em class="parameter"><code>endnotes.heading.groups</code></em> with the expected section
88 types separated by a space. For example, the following setup displays
89 notes per part and per chapter:</p><pre class="programlisting">
90 &lt;xsl:param name="footnote.as.endnote" select="1"/&gt;
91 &lt;xsl:param name="endnotes.heading.groups" select="'part chapter'"/&gt;
92 </pre><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp2014"></a>Adding new Groups</h5></div></div></div><p>By default dblatex can group the notes per chapter and/or per part,
93 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">
94 &lt;xsl:param name="endnotes.heading.groups" select="'part chapter preface'"/&gt;
95
96 &lt;xsl:template match="preface" mode="endnotes"&gt;
97 &lt;xsl:call-template name="endnotes.add.header"&gt;
98 &lt;xsl:with-param name="reset-counter" select="1"/&gt;
99 &lt;/xsl:call-template&gt;
100 &lt;/xsl:template&gt;
101 </pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp2023"></a>Formatting the Headings text</h5></div></div></div><p>You can use the parameter
102 <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
103 the notes are displayed.</p><pre class="programlisting">
104 &lt;xsl:param name="endnotes.heading.style"&gt;
105 &lt;xsl:text&gt;template:Notes of the chapter "%t", page %p&lt;/xsl:text&gt;
106 &lt;/xsl:param&gt;
107 </pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp2029"></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
108 with a section command whose level is just below the level of the endnotes
109 section. For example, if the endnotes section is a chapter, the headings are
110 created by using a <code class="literal">\section*</code> latex command. If the endnotes
111 section is a section, the headings are done by using
112 <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
113 the specified command. The example below uses the command
114 <code class="literal">\enoteheader*</code> to create the headings. It assumes that this
115 macro is defined somewhere else (e.g. in a user latex style).</p><pre class="programlisting">
116 &lt;xsl:param name="endnotes.heading.command" select="'\enoteheader*'"/&gt;
117 </pre></div><div class="section"><div class="titlepage"><div><div><h5 class="title"><a id="idp2040"></a>Endnotes Counter Scope</h5></div></div></div><p>By default the endnotes counter restarts from one in each chapter or
118 part when they are grouped. You can change this behaviour by overriding
119 the <em class="parameter"><code>endnotes.counter.resetby</code></em> parameter that lists
120 the section types where the counter is reset. If you want a global
121 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>