2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
4
<!--############################################################################
5
XSLT Stylesheet DocBook -> LaTeX
6
############################################################################ -->
12
<xsl:template match="glossary">
13
<xsl:variable name="divs" select="glossdiv"/>
14
<xsl:variable name="entries" select="glossentry"/>
15
<xsl:variable name="preamble" select="*[not(self::title
18
or self::glossentry)]"/>
19
<xsl:text>% -------- </xsl:text>
20
<xsl:text>% GLOSSARY </xsl:text>
21
<xsl:text>% -------- </xsl:text>
23
<!-- defined or default glossary title? -->
24
<xsl:variable name="title">
26
<xsl:when test="title">
27
<xsl:call-template name="normalize-scape">
28
<xsl:with-param name="string" select="title"/>
32
<xsl:call-template name="gentext.element.name"/>
37
<!-- find the appropriate section level -->
38
<xsl:call-template name="map.sect.level">
39
<xsl:with-param name="level">
40
<xsl:call-template name="get.sect.level"/>
43
<xsl:text>{</xsl:text>
44
<xsl:copy-of select="$title"/>
45
<xsl:text>} </xsl:text>
46
<xsl:call-template name="label.id"/>
47
<xsl:if test="$preamble">
48
<xsl:apply-templates select="$preamble"/>
50
<xsl:if test="$entries">
51
<xsl:text> \noindent </xsl:text>
52
<xsl:text>\begin{description} </xsl:text>
53
<xsl:apply-templates select="$entries"/>
54
<xsl:text> \end{description} </xsl:text>
57
<xsl:apply-templates select="$divs"/>
61
<xsl:template match="glossary/glossaryinfo"/>
62
<xsl:template match="glossary/title"/>
63
<xsl:template match="glossary/subtitle"/>
64
<xsl:template match="glossary/titleabbrev"/>
71
<xsl:template match="glossdiv">
72
<!-- find the appropriate section level -->
73
<xsl:variable name="l">
74
<xsl:call-template name="get.sect.level">
75
<xsl:with-param name="n" select="parent::glossary"/>
78
<xsl:call-template name="map.sect.level">
79
<xsl:with-param name="level" select="$l+1"/>
81
<xsl:text>{</xsl:text>
82
<xsl:copy-of select="title"/>
83
<xsl:text>} </xsl:text>
84
<xsl:call-template name="label.id"/>
86
<!-- display the stuff before the entries -->
87
<xsl:apply-templates select="*[not(self::glossentry)]"/>
89
<!-- now, display the description list -->
90
<xsl:text> \noindent </xsl:text>
91
<xsl:text>\begin{description} </xsl:text>
92
<xsl:apply-templates select="glossentry"/>
93
<xsl:text> \end{description} </xsl:text>
101
<xsl:template match="glossdiv/title" />
103
<xsl:template match="glosslist">
104
<xsl:text> \noindent </xsl:text>
105
<xsl:text>\begin{description} </xsl:text>
106
<xsl:apply-templates/>
107
<xsl:text> \end{description} </xsl:text>
110
<xsl:template match="glosslist/title" />
111
<xsl:template match="glosslist/blockinfo" />
118
<xsl:template match="glossentry">
119
<xsl:apply-templates/>
120
<xsl:text> </xsl:text>
123
<xsl:template match="glossentry/glossterm">
124
<xsl:text>\item[</xsl:text>
125
<xsl:if test="../@id">
126
<xsl:text>\hypertarget{</xsl:text>
127
<xsl:value-of select="../@id"/>
128
<xsl:text>}</xsl:text>
130
<xsl:text>{</xsl:text>
131
<xsl:variable name="term">
132
<xsl:apply-templates/>
134
<xsl:value-of select="normalize-space($term)"/>
135
<xsl:text>}] </xsl:text>
138
<xsl:template match="glossentry/acronym">
139
<xsl:text> (\texttt{</xsl:text><xsl:apply-templates/><xsl:text>}) </xsl:text>
142
<xsl:template match="glossentry/abbrev">
143
<xsl:text> [ </xsl:text><xsl:apply-templates/><xsl:text> ] </xsl:text>
147
<xsl:template match="glossentry/revhistory"/>
149
<xsl:template match="glossentry/glossdef">
150
<xsl:text> </xsl:text>
151
<xsl:apply-templates/>
154
<xsl:template match="glossseealso|glosssee">
155
<xsl:variable name="otherterm" select="@otherterm"/>
156
<xsl:variable name="targets" select="//node()[@id=$otherterm]"/>
157
<xsl:variable name="target" select="$targets[1]"/>
158
<xsl:variable name="text">
159
<xsl:apply-templates/>
161
<xsl:text> </xsl:text>
162
<xsl:call-template name="gentext.element.name"/>
163
<xsl:call-template name="gentext.space"/>
164
<xsl:text>"</xsl:text>
166
<xsl:when test="@otherterm">
167
<xsl:text>\hyperlink{</xsl:text>
168
<xsl:value-of select="@otherterm"/>
169
<xsl:text>}{</xsl:text>
171
<xsl:when test="$text!=''">
172
<xsl:value-of select="$text"/>
175
<xsl:apply-templates select="$target" mode="xref"/>
178
<xsl:text>}</xsl:text>
181
<xsl:value-of select="$text"/>
184
<xsl:text>". </xsl:text>
187
<xsl:template match="glossentry" mode="xref">
188
<xsl:apply-templates select="./glossterm" mode="xref"/>
191
<xsl:template match="glossterm" mode="xref">
192
<xsl:apply-templates/>