| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 4 |
<section id="sec-footnote"> |
| 5 |
<title>Footnotes</title> |
| 6 |
|
| 7 |
<section id="sec-footnote-basic"> |
| 8 |
<title>Footnote Numbering Scope</title> |
| 9 |
|
| 10 |
<para>The foonotes are well handled by latex. Dblatex just takes care about |
| 11 |
special cases like footnotes in headings or in tables. Therefore the default |
| 12 |
latex behaviour is applied for footnote numbering.</para> |
| 13 |
|
| 14 |
<para>By default the footnote numbers are reset for each new chapter. If you |
| 15 |
want to change the numbering scope, you can use the latex package <package>chngcntr</package> either in a customized latex style (see <xref linkend="sec-custom"/>) or in the parameter <parameter>latex.begindocument</parameter>. The following example makes the footnote numbers document wide.</para> |
| 16 |
|
| 17 |
<programlisting language="XML"><![CDATA[ |
| 18 |
<xsl:param name="latex.begindocument"> |
| 19 |
<xsl:text> |
| 20 |
% Want document wide footnotes |
| 21 |
\usepackage{chngcntr} |
| 22 |
\counterwithout{footnote}{chapter} |
| 23 |
\begin{document} |
| 24 |
</xsl:text> |
| 25 |
</xsl:param>]]> |
| 26 |
</programlisting> |
| 27 |
</section> |
| 28 |
<section id="sec-footnote-endnote"> |
| 29 |
<title>End Notes</title> |
| 30 |
|
| 31 |
<para>You can configure <command>dblatex</command> to manage the footnotes as |
| 32 |
endnotes. In this case the notes are expected to be displayed in a dedicated |
| 33 |
section. The following sections tell how to do this.</para> |
| 34 |
|
| 35 |
<section> |
| 36 |
<title>Writing a document with endnotes</title> |
| 37 |
|
| 38 |
<para>To have footnotes behaving as endnotes, you just need to set the |
| 39 |
<parameter>footnote.as.endnote</parameter> to 1, and to put in your document an |
| 40 |
empty <sgmltag>index</sgmltag> element with the attribute |
| 41 |
<sgmltag>type</sgmltag> set to 'endnotes'. This index is supposed to be included |
| 42 |
in a section dedicated to contain the notes, and therefore it does not display |
| 43 |
any heading by itself. The section containing the endnotes index can also |
| 44 |
contain any other materials.</para> |
| 45 |
|
| 46 |
<example><title>Writing a document with endnotes</title> |
| 47 |
<para>The following document contains some footnotes and a section for |
| 48 |
the End Notes: |
| 49 |
<programlisting language="XML"><![CDATA[ |
| 50 |
<book> |
| 51 |
<chapter><title>A Chapter</title> |
| 52 |
<para>Bla bla]]><emphasis role="bold"><![CDATA[<footnote id="fn1">First note</footnote>]]></emphasis><![CDATA[ bla |
| 53 |
bla]]><emphasis role="bold"><![CDATA[<footnote id="fn2">Second note</footnote>]]></emphasis><![CDATA[ ...</para> |
| 54 |
</chapter> |
| 55 |
|
| 56 |
<chapter><title>Another Chapter</title> |
| 57 |
<para>Bla bla]]><emphasis role="bold"><![CDATA[<footnote id="fn3">Third note</footnote>]]></emphasis><![CDATA[ bla |
| 58 |
bla]]><emphasis role="bold"><![CDATA[<footnote id="fn4">Fourth note</footnote>]]></emphasis><![CDATA[ ...</para> |
| 59 |
</chapter> |
| 60 |
|
| 61 |
<chapter><title>End Notes</title> |
| 62 |
<para>This chapter contains all the notes of the book.</para> |
| 63 |
|
| 64 |
]]><emphasis role="bold"><![CDATA[<index type="endnotes"/>]]></emphasis><![CDATA[ |
| 65 |
</chapter> |
| 66 |
</book>]]> |
| 67 |
</programlisting> |
| 68 |
</para> |
| 69 |
<para><command>dblatex</command> is called with:</para> |
| 70 |
<screen>$ dblatex -P <emphasis role="bold">footnote.as.endnote=1</emphasis> file.xml</screen> |
| 71 |
|
| 72 |
</example> |
| 73 |
|
| 74 |
</section> |
| 75 |
<section> |
| 76 |
<title>Setup Properties</title> |
| 77 |
|
| 78 |
<para>Currently the endnotes are handled by the latex package |
| 79 |
<package>endnotes</package>. You can customize its use with |
| 80 |
the <parameter>endnotes.properties</parameter> attribute set. This attribute set |
| 81 |
is filled by default with the values given by the internal attribute set |
| 82 |
<parameter>endnotes.properties.default</parameter>, and you can override the |
| 83 |
following attributes:</para> |
| 84 |
|
| 85 |
<variablelist> |
| 86 |
<varlistentry> |
| 87 |
<term><sgmltag>package</sgmltag></term> |
| 88 |
<listitem><simpara>Recall the latex package in charge to handle the |
| 89 |
endnotes. Attribute provided for provision since currently there is |
| 90 |
no real alternative with well established packages.</simpara></listitem> |
| 91 |
</varlistentry> |
| 92 |
<varlistentry> |
| 93 |
<term><sgmltag>heading</sgmltag></term> |
| 94 |
<listitem><simpara>Macros to render the heading of the endnotes |
| 95 |
to display.</simpara></listitem> |
| 96 |
</varlistentry> |
| 97 |
<varlistentry> |
| 98 |
<term><sgmltag>font-size</sgmltag></term> |
| 99 |
<listitem><simpara>Macro specifying the font size to apply for each endnote. |
| 100 |
The package default is <literal>\footnotesize</literal>. The dblatex default |
| 101 |
is <literal>\normalsize</literal>.</simpara></listitem> |
| 102 |
</varlistentry> |
| 103 |
<varlistentry> |
| 104 |
<term><sgmltag>note-format</sgmltag></term> |
| 105 |
<listitem><simpara>Macros specifying how the render a end note. The |
| 106 |
package default is the same formatting that footnotes. The dblatex |
| 107 |
default is to print out endnotes like a numbered list.</simpara></listitem> |
| 108 |
</varlistentry> |
| 109 |
</variablelist> |
| 110 |
|
| 111 |
<para>The default setup:</para> |
| 112 |
<programlisting language="XML"> |
| 113 |
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="params/syn/endnotes.properties.xml"/></programlisting> |
| 114 |
|
| 115 |
</section> |
| 116 |
<section> |
| 117 |
<title>Endnotes Setup from scratch</title> |
| 118 |
|
| 119 |
<para>If you want to fully control the endnotes setup, add some other macros, |
| 120 |
you can directly override the |
| 121 |
template <literal>endnotes.setup</literal>, as shown by the example below. |
| 122 |
If the endnote setup is already defined in your latex style you can override |
| 123 |
the template to make it empty in order to avoid some conflict between the latex style |
| 124 |
definition and the default one done by dblatex.</para> |
| 125 |
|
| 126 |
<programlisting language="XML"><![CDATA[ |
| 127 |
<!-- Use the default endnotes package setup and change the heading --> |
| 128 |
<xsl:template name="endnotes.setup"> |
| 129 |
<xsl:text>\usepackage{endnotes} </xsl:text> |
| 130 |
<xsl:text>\def\enoteheading{\paragraph*{List Of Notes}% |
| 131 |
\mbox{}\par\vskip-\baselineskip} </xsl:text> |
| 132 |
</xsl:template> |
| 133 |
]]></programlisting> |
| 134 |
|
| 135 |
</section> |
| 136 |
<section id="sec-endnotes-group"> |
| 137 |
<title>Grouping Endnotes</title> |
| 138 |
|
| 139 |
<para>By default the endnotes are displayed for the whole document as a global |
| 140 |
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.</para> |
| 141 |
|
| 142 |
<para>To group the endnotes according to the granularity you wish, |
| 143 |
you just need to |
| 144 |
set the <parameter>endnotes.heading.groups</parameter> with the expected section |
| 145 |
types separated by a space. For example, the following setup displays |
| 146 |
notes per part and per chapter:</para> |
| 147 |
|
| 148 |
<programlisting language="XML"><![CDATA[ |
| 149 |
<xsl:param name="footnote.as.endnote" select="1"/> |
| 150 |
<xsl:param name="endnotes.heading.groups" select="'part chapter'"/> |
| 151 |
]]></programlisting> |
| 152 |
|
| 153 |
<section> |
| 154 |
<title>Adding new Groups</title> |
| 155 |
|
| 156 |
<para>By default dblatex can group the notes per chapter and/or per part, |
| 157 |
provided that the section type is declared in <parameter>endnotes.heading.groups</parameter> as explained previously. If you want to add another section type you need to override the template called in mode <literal>endnotes</literal>, and to add this type to the declared groups. Usually the <literal>endnotes</literal> mode template only calls the <function>endnotes.add.header</function> template. The example below makes a new group for <sgmltag>preface</sgmltag>.</para> |
| 158 |
|
| 159 |
<programlisting language="XML"><![CDATA[ |
| 160 |
<xsl:param name="endnotes.heading.groups" select="'part chapter preface'"/> |
| 161 |
|
| 162 |
<xsl:template match="preface" mode="endnotes"> |
| 163 |
<xsl:call-template name="endnotes.add.header"> |
| 164 |
<xsl:with-param name="reset-counter" select="1"/> |
| 165 |
</xsl:call-template> |
| 166 |
</xsl:template> |
| 167 |
]]></programlisting> |
| 168 |
|
| 169 |
</section> |
| 170 |
<section> |
| 171 |
<title>Formatting the Headings text</title> |
| 172 |
|
| 173 |
<para>You can use the parameter |
| 174 |
<parameter>endnotes.heading.style</parameter> to format the headings of the groups with the same syntax than <sgmltag>xrefstyle</sgmltag> does. The example below gives a template where the title and the page of the chapter containing |
| 175 |
the notes are displayed.</para> |
| 176 |
|
| 177 |
<programlisting language="XML"><![CDATA[ |
| 178 |
<xsl:param name="endnotes.heading.style"> |
| 179 |
<xsl:text>template:Notes of the chapter "%t", page %p</xsl:text> |
| 180 |
</xsl:param> |
| 181 |
]]></programlisting> |
| 182 |
|
| 183 |
</section> |
| 184 |
<section> |
| 185 |
<title>LaTeX Command to make the Headings</title> |
| 186 |
|
| 187 |
<para>By default <command>dblatex</command> creates the headings of the groups |
| 188 |
with a section command whose level is just below the level of the endnotes |
| 189 |
section. For example, if the endnotes section is a chapter, the headings are |
| 190 |
created by using a <literal>\section*</literal> latex command. If the endnotes |
| 191 |
section is a section, the headings are done by using |
| 192 |
<literal>\subsection*</literal>, and so on.</para> |
| 193 |
|
| 194 |
<para>If this behaviour does not fit your needs you can specify the command to use with the parameter <parameter>endnotes.heading.command</parameter>. It can be usefull if you want to format these heading in a specific way. The heading markup produced following the <parameter>endnotes.heading.style</parameter> template is passed as an argument of |
| 195 |
the specified command. The example below uses the command |
| 196 |
<literal>\enoteheader*</literal> to create the headings. It assumes that this |
| 197 |
macro is defined somewhere else (e.g. in a user latex style).</para> |
| 198 |
|
| 199 |
<programlisting language="XML"><![CDATA[ |
| 200 |
<xsl:param name="endnotes.heading.command" select="'\enoteheader*'"/> |
| 201 |
]]></programlisting> |
| 202 |
|
| 203 |
</section> |
| 204 |
<section> |
| 205 |
<title>Endnotes Counter Scope</title> |
| 206 |
|
| 207 |
<para>By default the endnotes counter restarts from one in each chapter or |
| 208 |
part when they are grouped. You can change this behaviour by overriding |
| 209 |
the <parameter>endnotes.counter.resetby</parameter> parameter that lists |
| 210 |
the section types where the counter is reset. If you want a global |
| 211 |
counter running for the whole document, just set the parameter empty.</para> |
| 212 |
</section> |
| 213 |
|
| 214 |
</section> |
| 215 |
</section> |
| 216 |
</section> |