| 1 | <?xml version='1.0'?>
|
|---|
| 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 | + ############################################################################## -->
|
|---|
| 8 | <xsl:stylesheet
|
|---|
| 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'>
|
|---|
| 12 |
|
|---|
| 13 | <doc:reference id="footnote" xmlns="">
|
|---|
| 14 | <referenceinfo>
|
|---|
| 15 | <releaseinfo role="meta">
|
|---|
| 16 | $Id: footnote.mod.xsl,v 1.10 2004/01/02 06:45:25 j-devenish Exp $
|
|---|
| 17 | </releaseinfo>
|
|---|
| 18 | <authorgroup>
|
|---|
| 19 | &ramon;
|
|---|
| 20 | &james;
|
|---|
| 21 | </authorgroup>
|
|---|
| 22 | <copyright>
|
|---|
| 23 | <year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
|
|---|
| 24 | <holder>Ramon Casellas</holder>
|
|---|
| 25 | </copyright>
|
|---|
| 26 | <revhistory>
|
|---|
| 27 | <doc:revision rcasver="1.10">&rev_2003_05;</doc:revision>
|
|---|
| 28 | </revhistory>
|
|---|
| 29 | </referenceinfo>
|
|---|
| 30 | <title>Footnotes <filename>footnote.mod.xsl</filename></title>
|
|---|
| 31 | <partintro>
|
|---|
| 32 | <para>
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | </para>
|
|---|
| 37 | </partintro>
|
|---|
| 38 | </doc:reference>
|
|---|
| 39 |
|
|---|
| 40 | <doc:template xmlns="">
|
|---|
| 41 | <refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
|
|---|
| 42 | <doc:description>
|
|---|
| 43 | <para>
|
|---|
| 44 |
|
|---|
| 45 | Format a footnote.
|
|---|
| 46 |
|
|---|
| 47 | </para>
|
|---|
| 48 | </doc:description>
|
|---|
| 49 | <doc:variables>
|
|---|
| 50 | &no_var;
|
|---|
| 51 | </doc:variables>
|
|---|
| 52 | <doc:notes>
|
|---|
| 53 | <para>
|
|---|
| 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.
|
|---|
| 58 | </para>
|
|---|
| 59 | &essential_preamble;
|
|---|
| 60 | </doc:notes>
|
|---|
| 61 | <doc:samples>
|
|---|
| 62 | <simplelist type='inline'>
|
|---|
| 63 | &test_book;
|
|---|
| 64 | &test_links;
|
|---|
| 65 | &test_tables;
|
|---|
| 66 | </simplelist>
|
|---|
| 67 | </doc:samples>
|
|---|
| 68 | </doc:template>
|
|---|
| 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>
|
|---|
| 76 | </xsl:template>
|
|---|
| 77 |
|
|---|
| 78 | <doc:template xmlns="">
|
|---|
| 79 | <refpurpose> Essential preamble for <filename>footnote.mod.xsl</filename> support </refpurpose>
|
|---|
| 80 | <doc:description>
|
|---|
| 81 | <para>
|
|---|
| 82 |
|
|---|
| 83 | Defines <function
|
|---|
| 84 | condition="latex">docbooktolatexusefootnoteref</function> and
|
|---|
| 85 | <function
|
|---|
| 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;.
|
|---|
| 90 |
|
|---|
| 91 | </para>
|
|---|
| 92 | </doc:description>
|
|---|
| 93 | <doc:seealso>
|
|---|
| 94 | <itemizedlist>
|
|---|
| 95 | <listitem><simpara>&preamble;</simpara></listitem>
|
|---|
| 96 | </itemizedlist>
|
|---|
| 97 | </doc:seealso>
|
|---|
| 98 | </doc:template>
|
|---|
| 99 | <xsl:template name="latex.preamble.essential.footnote">
|
|---|
| 100 | <xsl:text>
|
|---|
| 101 | <![CDATA[
|
|---|
| 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 ?}}}%
|
|---|
| 114 | }
|
|---|
| 115 | ]]>
|
|---|
| 116 | </xsl:text>
|
|---|
| 117 | </xsl:template>
|
|---|
| 118 |
|
|---|
| 119 | <doc:template xmlns="">
|
|---|
| 120 | <refpurpose>Process <doc:db>ulink</doc:db> elements within <doc:db>footnote</doc:db>s</refpurpose>
|
|---|
| 121 | <doc:description>
|
|---|
| 122 | <para>
|
|---|
| 123 | Format a <doc:db>ulink</doc:db>.
|
|---|
| 124 | </para>
|
|---|
| 125 | </doc:description>
|
|---|
| 126 | <doc:variables>
|
|---|
| 127 | &no_var;
|
|---|
| 128 | </doc:variables>
|
|---|
| 129 | <doc:notes>
|
|---|
| 130 | <para>
|
|---|
| 131 | Footnotes are <quote>tricky</quote> and require special handling for
|
|---|
| 132 | a number of link-type commands.
|
|---|
| 133 | </para>
|
|---|
| 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>
|
|---|
| 137 | </doc:notes>
|
|---|
| 138 | </doc:template>
|
|---|
| 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"/>
|
|---|
| 147 | </xsl:call-template>
|
|---|
| 148 | <xsl:text>}\endgroup\docbooktolatexmakefootnoteref{</xsl:text>
|
|---|
| 149 | <xsl:call-template name="generate.label.id"/>
|
|---|
| 150 | <xsl:text>}</xsl:text>
|
|---|
| 151 | </xsl:template>
|
|---|
| 152 |
|
|---|
| 153 | <doc:template xmlns="">
|
|---|
| 154 | <refpurpose>Process <doc:db>footnote</doc:db> elements</refpurpose>
|
|---|
| 155 | <doc:description>
|
|---|
| 156 | <para>
|
|---|
| 157 | Make a link to a <doc:db>footnote</doc:db>.
|
|---|
| 158 | </para>
|
|---|
| 159 | </doc:description>
|
|---|
| 160 | <doc:variables>
|
|---|
| 161 | &no_var;
|
|---|
| 162 | </doc:variables>
|
|---|
| 163 | <doc:notes>
|
|---|
| 164 | &essential_preamble;
|
|---|
| 165 | </doc:notes>
|
|---|
| 166 | </doc:template>
|
|---|
| 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>
|
|---|
| 172 | </xsl:template>
|
|---|
| 173 |
|
|---|
| 174 | </xsl:stylesheet>
|
|---|