blob: ed3d927ec8bca07d60fd25d119e259c10978e10f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY % xsldoc.ent SYSTEM "./xsldoc.ent"> %xsldoc.ent; ]>
<!--#############################################################################
| $Id: footnote.mod.xsl,v 1.10 2004/01/02 06:45:25 j-devenish Exp $
|- #############################################################################
| $Author: j-devenish $
+ ############################################################################## -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
exclude-result-prefixes="doc" version='1.0'>
<doc:reference id="footnote" xmlns="">
<referenceinfo>
<releaseinfo role="meta">
$Id: footnote.mod.xsl,v 1.10 2004/01/02 06:45:25 j-devenish Exp $
</releaseinfo>
<authorgroup>
&ramon;
&james;
</authorgroup>
<copyright>
<year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
<holder>Ramon Casellas</holder>
</copyright>
<revhistory>
<doc:revision rcasver="1.10">&rev_2003_05;</doc:revision>
</revhistory>
</referenceinfo>
<title>Footnotes <filename>footnote.mod.xsl</filename></title>
<partintro>
<para>
</para>
</partintro>
</doc:reference>
<doc:template xmlns="">
<refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
<doc:description>
<para>
Format a footnote.
</para>
</doc:description>
<doc:variables>
&no_var;
</doc:variables>
<doc:notes>
<para>
Applies templates within a &LaTeX; <function
condition="latex">footnote</function> command. Note that this
may not work within some tables. Also, <doc:db
basename="indexterm">indexterms</doc:db> may fail.
</para>
&essential_preamble;
</doc:notes>
<doc:samples>
<simplelist type='inline'>
&test_book;
&test_links;
&test_tables;
</simplelist>
</doc:samples>
</doc:template>
<xsl:template match="footnote">
<xsl:call-template name="label.id"/>
<xsl:text>\begingroup\catcode`\#=12\footnote{</xsl:text>
<xsl:apply-templates/>
<xsl:text>}\endgroup\docbooktolatexmakefootnoteref{</xsl:text>
<xsl:call-template name="generate.label.id"/>
<xsl:text>}</xsl:text>
</xsl:template>
<doc:template xmlns="">
<refpurpose> Essential preamble for <filename>footnote.mod.xsl</filename> support </refpurpose>
<doc:description>
<para>
Defines <function
condition="latex">docbooktolatexusefootnoteref</function> and
<function
condition="latex">docbooktolatexmakefootnoteref</function>.
These functions help to integrate
<doc:db>footnote</doc:db>/@<sgmltag
class="attribute">id</sgmltag> cross-references with &LaTeX;.
</para>
</doc:description>
<doc:seealso>
<itemizedlist>
<listitem><simpara>&preamble;</simpara></listitem>
</itemizedlist>
</doc:seealso>
</doc:template>
<xsl:template name="latex.preamble.essential.footnote">
<xsl:text>
<![CDATA[
% --------------------------------------------
% A way to honour <footnoteref>s
% Blame j-devenish (at) users.sourceforge.net
% In any other LaTeX context, this would probably go into a style file.
\newcommand{\docbooktolatexusefootnoteref}[1]{\@ifundefined{@fn@label@#1}%
{\hbox{\@textsuperscript{\normalfont ?}}%
\@latex@warning{Footnote label `#1' was not defined}}%
{\@nameuse{@fn@label@#1}}}
\newcommand{\docbooktolatexmakefootnoteref}[1]{%
\protected@write\@auxout{}%
{\global\string\@namedef{@fn@label@#1}{\@makefnmark}}%
\@namedef{@fn@label@#1}{\hbox{\@textsuperscript{\normalfont ?}}}%
}
]]>
</xsl:text>
</xsl:template>
<doc:template xmlns="">
<refpurpose>Process <doc:db>ulink</doc:db> elements within <doc:db>footnote</doc:db>s</refpurpose>
<doc:description>
<para>
Format a <doc:db>ulink</doc:db>.
</para>
</doc:description>
<doc:variables>
&no_var;
</doc:variables>
<doc:notes>
<para>
Footnotes are <quote>tricky</quote> and require special handling for
a number of link-type commands.
</para>
<para>This template exists in this file so that all
the footnote-generating templates are close to each other. However,
it is actually a part of the <literal>ulink</literal> template in <filename>xref.mod.xsl</filename></para>
</doc:notes>
</doc:template>
<xsl:template name="generate.ulink.in.footnote">
<xsl:param name="hyphenation"/>
<xsl:param name="url"/>
<xsl:call-template name="label.id"/>
<xsl:text>\begingroup\catcode`\#=12\footnote{</xsl:text>
<xsl:call-template name="generate.typeset.url">
<xsl:with-param name="hyphenation" select="$hyphenation"/>
<xsl:with-param name="url" select="$url"/>
</xsl:call-template>
<xsl:text>}\endgroup\docbooktolatexmakefootnoteref{</xsl:text>
<xsl:call-template name="generate.label.id"/>
<xsl:text>}</xsl:text>
</xsl:template>
<doc:template xmlns="">
<refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
<doc:description>
<para>
Make a link to a <doc:db>footnote</doc:db>.
</para>
</doc:description>
<doc:variables>
&no_var;
</doc:variables>
<doc:notes>
&essential_preamble;
</doc:notes>
</doc:template>
<xsl:template match="footnoteref">
<xsl:variable name="footnote" select="key('id',@linkend)"/>
<xsl:text>\docbooktolatexusefootnoteref{</xsl:text>
<xsl:value-of select="@linkend"/>
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>
|