2
<!DOCTYPE xsl:stylesheet [ <!ENTITY % xsldoc.ent SYSTEM "./xsldoc.ent"> %xsldoc.ent; ]>
3
<!--#############################################################################
4
| $Id: footnote.mod.xsl,v 1.10 2004/01/02 06:45:25 j-devenish Exp $
5
|- #############################################################################
6
| $Author: j-devenish $
7
+ ############################################################################## -->
9
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
11
exclude-result-prefixes="doc" version='1.0'>
13
<doc:reference id="footnote" xmlns="">
15
<releaseinfo role="meta">
16
$Id: footnote.mod.xsl,v 1.10 2004/01/02 06:45:25 j-devenish Exp $
23
<year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
24
<holder>Ramon Casellas</holder>
27
<doc:revision rcasver="1.10">&rev_2003_05;</doc:revision>
30
<title>Footnotes <filename>footnote.mod.xsl</filename></title>
40
<doc:template xmlns="">
41
<refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
54
Applies templates within a &LaTeX; <function
55
condition="latex">footnote</function> command. Note that this
56
may not work within some tables. Also, <doc:db
57
basename="indexterm">indexterms</doc:db> may fail.
62
<simplelist type='inline'>
69
<xsl:template match="footnote">
70
<xsl:call-template name="label.id"/>
71
<xsl:text>\begingroup\catcode`\#=12\footnote{</xsl:text>
72
<xsl:apply-templates/>
73
<xsl:text>}\endgroup\docbooktolatexmakefootnoteref{</xsl:text>
74
<xsl:call-template name="generate.label.id"/>
75
<xsl:text>}</xsl:text>
78
<doc:template xmlns="">
79
<refpurpose> Essential preamble for <filename>footnote.mod.xsl</filename> support </refpurpose>
84
condition="latex">docbooktolatexusefootnoteref</function> and
86
condition="latex">docbooktolatexmakefootnoteref</function>.
87
These functions help to integrate
88
<doc:db>footnote</doc:db>/@<sgmltag
89
class="attribute">id</sgmltag> cross-references with &LaTeX;.
95
<listitem><simpara>&preamble;</simpara></listitem>
99
<xsl:template name="latex.preamble.essential.footnote">
102
% --------------------------------------------
103
% A way to honour <footnoteref>s
104
% Blame j-devenish (at) users.sourceforge.net
105
% In any other LaTeX context, this would probably go into a style file.
106
\newcommand{\docbooktolatexusefootnoteref}[1]{\@ifundefined{@fn@label@#1}%
107
{\hbox{\@textsuperscript{\normalfont ?}}%
108
\@latex@warning{Footnote label `#1' was not defined}}%
109
{\@nameuse{@fn@label@#1}}}
110
\newcommand{\docbooktolatexmakefootnoteref}[1]{%
111
\protected@write\@auxout{}%
112
{\global\string\@namedef{@fn@label@#1}{\@makefnmark}}%
113
\@namedef{@fn@label@#1}{\hbox{\@textsuperscript{\normalfont ?}}}%
119
<doc:template xmlns="">
120
<refpurpose>Process <doc:db>ulink</doc:db> elements within <doc:db>footnote</doc:db>s</refpurpose>
123
Format a <doc:db>ulink</doc:db>.
131
Footnotes are <quote>tricky</quote> and require special handling for
132
a number of link-type commands.
134
<para>This template exists in this file so that all
135
the footnote-generating templates are close to each other. However,
136
it is actually a part of the <literal>ulink</literal> template in <filename>xref.mod.xsl</filename></para>
139
<xsl:template name="generate.ulink.in.footnote">
140
<xsl:param name="hyphenation"/>
141
<xsl:param name="url"/>
142
<xsl:call-template name="label.id"/>
143
<xsl:text>\begingroup\catcode`\#=12\footnote{</xsl:text>
144
<xsl:call-template name="generate.typeset.url">
145
<xsl:with-param name="hyphenation" select="$hyphenation"/>
146
<xsl:with-param name="url" select="$url"/>
148
<xsl:text>}\endgroup\docbooktolatexmakefootnoteref{</xsl:text>
149
<xsl:call-template name="generate.label.id"/>
150
<xsl:text>}</xsl:text>
153
<doc:template xmlns="">
154
<refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
157
Make a link to a <doc:db>footnote</doc:db>.
167
<xsl:template match="footnoteref">
168
<xsl:variable name="footnote" select="key('id',@linkend)"/>
169
<xsl:text>\docbooktolatexusefootnoteref{</xsl:text>
170
<xsl:value-of select="@linkend"/>
171
<xsl:text>}</xsl:text>