2 <!DOCTYPE xsl:stylesheet [
<!ENTITY % xsldoc.ent SYSTEM
"./xsldoc.ent"> %xsldoc.ent; ]
>
3 <!--#############################################################################
4 | $Id: preamble.mod.xsl,v 1.82 2004/01/31 12:26:12 j-devenish Exp $
5 |- #############################################################################
6 | $Author: j-devenish $
8 | PURPOSE: Variables and templates to manage LaTeX preamble.
9 + ############################################################################## -->
11 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
12 xmlns:
doc=
"http://nwalsh.com/xsl/documentation/1.0"
13 exclude-result-prefixes=
"doc" version='
1.0'
>
15 <doc:reference id=
"preamble" xmlns=
"">
17 <releaseinfo role=
"meta">
18 $Id: preamble.mod.xsl,v
1.82 2004/
01/
31 12:
26:
12 j-devenish Exp $
25 <year>2000</year><year>2001</year><year>2002</year><year>2003</year><year>2004</year>
26 <holder>Ramon Casellas
</holder>
29 <doc:revision rcasver=
"1.77">&rev_2003_05;</doc:revision>
32 <title>Variables and Templates used in
&LaTeX; Preamble Generation
</title>
36 This section described the variables and templates that are used in
37 the generation of the output
&LaTeX; preamble. Basically, the
38 &LaTeX; preamble depends on the
<acronym>XML
</acronym> document, that is, on whether
39 it is an
<doc:db>article
</doc:db> or a
<doc:db>book
</doc:db>.
45 <doc:template name=
"generate.latex.article.preamble" xmlns=
"">
48 Top level template, called by article template, responsible of
49 generating the
&LaTeX; preamble according to user
50 <acronym>XSL
</acronym> variables and templates.
56 If
<xref linkend=
"param.latex.override"/> is empty, the template
57 outputs
<xref linkend=
"param.latex.article.preamblestart"/> and
58 <xref linkend=
"param.latex.article.preamble.pre"/>, then calls
59 <xref linkend=
"template.generate.latex.common.preamble"/> and
<xref
60 linkend=
"template.generate.latex.essential.preamble"/> followed by
61 the value of
<xref linkend=
"param.latex.article.preamble.post"/>.
62 Otherwise, it outputs the value of
<xref linkend=
"param.latex.override"/>
64 linkend=
"template.generate.latex.essential.preamble"/>.
69 <xsl:template name=
"generate.latex.article.preamble">
71 <xsl:when test=
"$latex.override = ''">
72 <xsl:value-of select=
"$latex.article.preamblestart"/>
73 <xsl:value-of select=
"$latex.article.preamble.pre"/>
74 <xsl:call-template name=
"label.id"/>
75 <xsl:call-template name=
"generate.latex.common.preamble"/>
76 <xsl:call-template name=
"generate.latex.essential.preamble"/>
77 <xsl:value-of select=
"$latex.article.preamble.post"/>
80 <xsl:value-of select=
"$latex.override"/>
81 <xsl:call-template name=
"generate.latex.essential.preamble"/>
86 <doc:template name=
"generate.latex.book.preamble" xmlns=
"">
89 Top level template, called by book template, responsible of
90 generating the
&LaTeX; preamble according to user
91 <acronym>XSL
</acronym> variables and templates.
97 If
<xref linkend=
"param.latex.override"/> is empty, the template
98 outputs
<xref linkend=
"param.latex.book.preamblestart"/> and
99 <xref linkend=
"param.latex.book.preamble.pre"/>, then calls
100 <xref linkend=
"template.generate.latex.common.preamble"/> and
<xref
101 linkend=
"template.generate.latex.essential.preamble"/> followed by
102 the value of
<xref linkend=
"param.latex.book.preamble.post"/>.
103 Otherwise, it outputs the value of
<xref linkend=
"param.latex.override"/>
105 linkend=
"template.generate.latex.essential.preamble"/>.
110 <xsl:template name=
"generate.latex.book.preamble">
112 <xsl:when test=
"$latex.override = ''">
113 <xsl:value-of select=
"$latex.book.preamblestart"/>
114 <xsl:value-of select=
"$latex.book.preamble.pre"/>
115 <xsl:call-template name=
"label.id"/>
116 <xsl:call-template name=
"generate.latex.common.preamble"/>
117 <xsl:call-template name=
"generate.latex.essential.preamble"/>
118 <xsl:value-of select=
"$latex.book.preamble.post"/>
121 <xsl:value-of select=
"$latex.override"/>
122 <xsl:call-template name=
"generate.latex.essential.preamble"/>
127 <doc:param name=
"latex.article.preamblestart" xmlns=
"">
128 <refpurpose> Generate
<function condition=
"latex">documentclass
</function> for
<doc:db basename=
"article">articles
</doc:db> </refpurpose>
131 <listitem><simpara><xref linkend=
"param.latex.documentclass.common"/></simpara></listitem>
132 <listitem><simpara><xref linkend=
"param.latex.documentclass.article"/></simpara></listitem>
133 <listitem><simpara><xref linkend=
"param.latex.documentclass.pdftex"/></simpara></listitem>
134 <listitem><simpara><xref linkend=
"param.latex.documentclass.dvips"/></simpara></listitem>
135 <listitem><simpara><xref linkend=
"param.latex.documentclass"/></simpara></listitem>
141 <xsl:param name=
"latex.article.preamblestart">
142 <xsl:text>% --------------------------------------------
</xsl:text>
143 <xsl:text>% Autogenerated LaTeX file for articles
</xsl:text>
144 <xsl:text>% --------------------------------------------
</xsl:text>
145 <xsl:text>\ifx\pdfoutput\undefined
</xsl:text>
146 <xsl:text>\documentclass[
</xsl:text>
147 <xsl:value-of select='$latex.documentclass.common'
/>
148 <xsl:text>,
</xsl:text>
149 <xsl:value-of select='$latex.documentclass.article'
/>
150 <xsl:text>,
</xsl:text>
151 <xsl:value-of select='$latex.documentclass.pdftex'
/>
152 <xsl:text>]{
</xsl:text>
154 <xsl:when test=
"$latex.documentclass!=''"><xsl:value-of select=
"$latex.documentclass" /></xsl:when>
155 <xsl:otherwise><xsl:text>article
</xsl:text></xsl:otherwise>
157 <xsl:text>}
</xsl:text>
158 <xsl:text>\else
</xsl:text>
159 <xsl:text>\documentclass[pdftex,
</xsl:text>
160 <xsl:value-of select='$latex.documentclass.common'
/>
161 <xsl:text>,
</xsl:text>
162 <xsl:value-of select='$latex.documentclass.article'
/>
163 <xsl:text>,
</xsl:text>
164 <xsl:value-of select='$latex.documentclass.dvips'
/>
165 <xsl:text>]{
</xsl:text>
167 <xsl:when test=
"$latex.documentclass!=''"><xsl:value-of select=
"$latex.documentclass" /></xsl:when>
168 <xsl:otherwise><xsl:text>article
</xsl:text></xsl:otherwise>
170 <xsl:text>}
</xsl:text>
171 <xsl:text>\fi
</xsl:text>
174 <doc:param name=
"latex.book.preamblestart" xmlns=
"">
175 <refpurpose> Generate
<function condition=
"latex">documentclass
</function> for
<doc:db basename=
"book">books
</doc:db> </refpurpose>
178 <listitem><simpara><xref linkend=
"param.latex.documentclass.common"/></simpara></listitem>
179 <listitem><simpara><xref linkend=
"param.latex.documentclass.book"/></simpara></listitem>
180 <listitem><simpara><xref linkend=
"param.latex.documentclass.pdftex"/></simpara></listitem>
181 <listitem><simpara><xref linkend=
"param.latex.documentclass.dvips"/></simpara></listitem>
182 <listitem><simpara><xref linkend=
"param.latex.documentclass"/></simpara></listitem>
188 <xsl:param name=
"latex.book.preamblestart">
189 <xsl:text>% ------------------------------------------------------------
</xsl:text>
190 <xsl:text>% Autogenerated LaTeX file for books
</xsl:text>
191 <xsl:text>% ------------------------------------------------------------
</xsl:text>
192 <xsl:text>\ifx\pdfoutput\undefined
</xsl:text>
193 <xsl:text>\documentclass[
</xsl:text>
194 <xsl:value-of select='$latex.documentclass.common'
/>
195 <xsl:text>,
</xsl:text>
196 <xsl:value-of select='$latex.documentclass.book'
/>
197 <xsl:text>,
</xsl:text>
198 <xsl:value-of select='$latex.documentclass.pdftex'
/>
199 <xsl:text>]{
</xsl:text>
201 <xsl:when test=
"$latex.documentclass!=''"><xsl:value-of select=
"$latex.documentclass" /></xsl:when>
202 <xsl:otherwise><xsl:text>report
</xsl:text></xsl:otherwise>
204 <xsl:text>}
</xsl:text>
205 <xsl:text>\else
</xsl:text>
206 <xsl:text>\documentclass[pdftex,
</xsl:text>
207 <xsl:value-of select='$latex.documentclass.common'
/>
208 <xsl:text>,
</xsl:text>
209 <xsl:value-of select='$latex.documentclass.book'
/>
210 <xsl:text>,
</xsl:text>
211 <xsl:value-of select='$latex.documentclass.dvips'
/>
212 <xsl:text>]{
</xsl:text>
214 <xsl:when test=
"$latex.documentclass!=''"><xsl:value-of select=
"$latex.documentclass" /></xsl:when>
215 <xsl:otherwise><xsl:text>report
</xsl:text></xsl:otherwise>
217 <xsl:text>}
</xsl:text>
218 <xsl:text>\fi
</xsl:text>
222 <refpurpose> Select localisation language
</refpurpose>
225 Chooses the
<quote>gentext
</quote> language for the document.
234 Selects the root
<doc:db>set
</doc:db>,
<doc:db>book
</doc:db> or
235 <doc:db>article
</doc:db> element and reads its
<sgmltag
236 class=
"attribute">lang
</sgmltag> or
<sgmltag
237 class=
"attribute">xml:lang
</sgmltag> attribute.
242 <xsl:param name=
"document.xml.language">
243 <xsl:call-template name=
"l10n.language">
244 <xsl:with-param name=
"target" select=
"(/set|/book|/article)[1]"/>
245 <!-- now, induce the use of $target rather than the current node: -->
246 <xsl:with-param name=
"xref-context" select=
"true()"/>
251 <refpurpose> Select
<productname>babel
</productname> option
</refpurpose>
254 If
<xref linkend=
"param.latex.babel.language"/> is not set, this
255 template will select a
<productname>babel
</productname> option
256 based on the
<xref linkend=
"param.document.xml.language"/>.
261 <listitem><simpara><xref linkend=
"param.latex.babel.language"/></simpara></listitem>
262 <listitem><simpara><xref linkend=
"param.document.xml.language"/></simpara></listitem>
266 <para>A special value of
<quote><literal>none
</literal></quote>
267 can be used to disable
<productname>babel
</productname>.
</para>
270 <xsl:param name=
"latex.language.option">
272 <xsl:when test=
"$latex.babel.language!=''">
273 <xsl:value-of select=
"$latex.babel.language"/>
275 <xsl:when test=
"starts-with($document.xml.language,'af')">afrikaans
</xsl:when>
276 <xsl:when test=
"starts-with($document.xml.language,'br')">breton
</xsl:when>
277 <xsl:when test=
"starts-with($document.xml.language,'ca')">catalan
</xsl:when>
278 <xsl:when test=
"starts-with($document.xml.language,'cs')">czech
</xsl:when>
279 <xsl:when test=
"starts-with($document.xml.language,'cy')">welsh
</xsl:when>
280 <xsl:when test=
"starts-with($document.xml.language,'da')">danish
</xsl:when>
281 <xsl:when test=
"starts-with($document.xml.language,'de')">ngerman
</xsl:when><!-- ngerman, german or germanb? -->
282 <xsl:when test=
"starts-with($document.xml.language,'el')">greek
</xsl:when>
283 <xsl:when test=
"starts-with($document.xml.language,'en')">
285 <xsl:when test=
"starts-with($document.xml.language,'en-CA')">canadian
</xsl:when>
286 <xsl:when test=
"starts-with($document.xml.language,'en-GB')">british
</xsl:when>
287 <xsl:when test=
"starts-with($document.xml.language,'en-US')">USenglish
</xsl:when>
288 <xsl:otherwise>none
</xsl:otherwise>
291 <xsl:when test=
"starts-with($document.xml.language,'eo')">esperanto
</xsl:when>
292 <xsl:when test=
"starts-with($document.xml.language,'es')">spanish
</xsl:when>
293 <xsl:when test=
"starts-with($document.xml.language,'et')">estonian
</xsl:when>
294 <xsl:when test=
"starts-with($document.xml.language,'fi')">finnish
</xsl:when>
295 <xsl:when test=
"starts-with($document.xml.language,'fr')">french
</xsl:when><!-- francais, french, or frenchb? -->
296 <xsl:when test=
"starts-with($document.xml.language,'ga')">irish
</xsl:when>
297 <xsl:when test=
"starts-with($document.xml.language,'gd')">scottish
</xsl:when>
298 <xsl:when test=
"starts-with($document.xml.language,'gl')">galician
</xsl:when>
299 <xsl:when test=
"starts-with($document.xml.language,'he')">hebrew
</xsl:when>
300 <xsl:when test=
"starts-with($document.xml.language,'hr')">croatian
</xsl:when>
301 <xsl:when test=
"starts-with($document.xml.language,'hu')">hungarian
</xsl:when>
302 <xsl:when test=
"starts-with($document.xml.language,'id')">bahasa
</xsl:when>
303 <xsl:when test=
"starts-with($document.xml.language,'it')">italian
</xsl:when>
304 <xsl:when test=
"starts-with($document.xml.language,'nl')">dutch
</xsl:when>
305 <xsl:when test=
"starts-with($document.xml.language,'nn')">norsk
</xsl:when>
306 <xsl:when test=
"starts-with($document.xml.language,'pl')">polish
</xsl:when>
307 <xsl:when test=
"starts-with($document.xml.language,'pt')">
309 <xsl:when test=
"starts-with($document.xml.language,'pt-BR')">brazil
</xsl:when>
310 <xsl:otherwise>portugese
</xsl:otherwise>
313 <xsl:when test=
"starts-with($document.xml.language,'ro')">romanian
</xsl:when>
314 <xsl:when test=
"starts-with($document.xml.language,'ru')">russian
</xsl:when>
315 <xsl:when test=
"starts-with($document.xml.language,'sk')">slovak
</xsl:when>
316 <xsl:when test=
"starts-with($document.xml.language,'sl')">slovene
</xsl:when>
317 <xsl:when test=
"starts-with($document.xml.language,'sv')">swedish
</xsl:when>
318 <xsl:when test=
"starts-with($document.xml.language,'tr')">turkish
</xsl:when>
319 <xsl:when test=
"starts-with($document.xml.language,'uk')">ukrainian
</xsl:when>
323 <doc:template xmlns=
"">
326 Common
&LaTeX; preamble shared by
<doc:db>articles
</doc:db> and
327 <doc:db>books
</doc:db>, and other document classes. Most of the
328 packages and package options are managed here.
334 The
&LaTeX; preamble, after the
<function
335 condition=
"latex">documentclass
</function> command but before the
336 <function condition=
"env">document
</function> environment.
342 <listitem><simpara><xref linkend=
"param.latex.pdf.support"/></simpara></listitem>
343 <listitem><simpara><xref linkend=
"param.latex.pdf.preamble"/></simpara></listitem>
344 <listitem><simpara><xref linkend=
"param.latex.article.varsets"/></simpara></listitem>
345 <listitem><simpara><xref linkend=
"param.latex.book.varsets"/></simpara></listitem>
346 <listitem><simpara><xref linkend=
"param.latex.bridgehead.in.lot"/></simpara></listitem>
347 <listitem><simpara><xref linkend=
"param.latex.use.fancyhdr"/></simpara></listitem>
348 <listitem><simpara><xref linkend=
"param.latex.fancyhdr.style"/></simpara></listitem>
349 <listitem><simpara><xref linkend=
"param.latex.fancyhdr.truncation.partition"/></simpara></listitem>
350 <listitem><simpara><xref linkend=
"param.latex.fancyhdr.truncation.style"/></simpara></listitem>
351 <listitem><simpara><xref linkend=
"param.latex.use.varioref"/></simpara></listitem>
352 <listitem><simpara><xref linkend=
"param.latex.varioref.options"/></simpara></listitem>
353 <listitem><simpara><xref linkend=
"param.latex.use.dcolumn"/></simpara></listitem>
354 <listitem><simpara><xref linkend=
"param.latex.decimal.point"/></simpara></listitem>
355 <listitem><simpara><xref linkend=
"param.latex.use.fancybox"/></simpara></listitem>
356 <listitem><simpara><xref linkend=
"param.latex.use.fancyvrb"/></simpara></listitem>
357 <listitem><simpara><xref linkend=
"param.latex.fancyvrb.tabsize"/></simpara></listitem>
358 <listitem><simpara><xref linkend=
"param.latex.use.isolatin1"/></simpara></listitem>
359 <listitem><simpara><xref linkend=
"param.latex.use.parskip"/></simpara></listitem>
360 <listitem><simpara><xref linkend=
"param.latex.use.rotating"/></simpara></listitem>
361 <listitem><simpara><xref linkend=
"param.latex.use.subfigure"/></simpara></listitem>
362 <listitem><simpara><xref linkend=
"param.latex.use.tabularx"/></simpara></listitem>
363 <listitem><simpara><xref linkend=
"param.latex.use.umoline"/></simpara></listitem>
364 <listitem><simpara><xref linkend=
"param.latex.use.url"/></simpara></listitem>
365 <listitem><simpara><xref linkend=
"param.latex.math.support"/></simpara></listitem>
366 <listitem><simpara><xref linkend=
"param.latex.math.preamble"/></simpara></listitem>
367 <listitem><simpara><xref linkend=
"param.latex.document.font"/></simpara></listitem>
368 <listitem><simpara><xref linkend=
"param.latex.use.hyperref"/></simpara></listitem>
369 <listitem><simpara><xref linkend=
"param.latex.admonition.environment"/></simpara></listitem>
370 <listitem><simpara><xref linkend=
"param.latex.caption.swapskip"/></simpara></listitem>
371 <listitem><simpara><xref linkend=
"param.latex.hyphenation.tttricks"/></simpara></listitem>
372 <listitem><simpara><xref linkend=
"param.latex.language.option"/></simpara></listitem>
373 <listitem><simpara><xref linkend=
"param.latex.is.draft"/></simpara></listitem>
378 <listitem><simpara><xref linkend=
"template.generate.latex.pagestyle"/></simpara></listitem>
379 <listitem><simpara><xref linkend=
"template.gentext.dingbat"/></simpara></listitem>
380 <listitem><simpara><xref linkend=
"template.latex.hyperref.preamble"/></simpara></listitem>
381 <listitem><simpara><xref linkend=
"template.float.preamble"/></simpara></listitem>
382 <listitem><simpara><xref linkend=
"template.latex.graphicext"/></simpara></listitem>
383 <listitem><simpara><xref linkend=
"template.generate.latex.draft.preamble"/></simpara></listitem>
387 <xsl:template name=
"generate.latex.common.preamble">
389 <xsl:when test=
"$latex.pdf.support=1"><xsl:value-of select=
"$latex.pdf.preamble"/></xsl:when>
390 <xsl:otherwise><xsl:text>\usepackage{graphicx}
</xsl:text></xsl:otherwise>
392 <xsl:if test=
"local-name(.)='article'">
393 <xsl:value-of select=
"$latex.article.varsets"/>
395 <xsl:if test=
"local-name(.)='book'">
396 <xsl:value-of select=
"$latex.book.varsets"/>
398 <xsl:if test=
"$latex.bridgehead.in.lot=1">
401 % redefine the listoffigures and listoftables so that the name of the chapter
402 % is printed whenever there are figures or tables from that chapter. encourage
403 % pagebreak prior to the name of the chapter (discourage orphans).
404 \let\save@@chapter\@chapter
405 \let\save@@l@figure\l@figure
406 \let\the@l@figure@leader\relax
407 \def\@chapter[#
1]#
2{\save@@chapter[{#
1}]{#
2}%
408 \addtocontents{lof}{\protect\def\the@l@figure@leader{\protect\pagebreak[
0]\protect\contentsline{chapter}{\protect\numberline{\thechapter}#
1}{}{\thepage}}}%
409 \addtocontents{lot}{\protect\def\the@l@figure@leader{\protect\pagebreak[
0]\protect\contentsline{chapter}{\protect\numberline{\thechapter}#
1}{}{\thepage}}}%
411 \renewcommand*\l@figure{\the@l@figure@leader\let\the@l@figure@leader\relax\save@@l@figure}
412 \let\l@table\l@figure
416 <xsl:if test=
"$latex.use.fancyhdr=1">
417 <xsl:text>\usepackage{fancyhdr}
</xsl:text>
418 <xsl:text>\renewcommand{\headrulewidth}{
0.4pt}
</xsl:text>
419 <xsl:text>\renewcommand{\footrulewidth}{
0.4pt}
</xsl:text>
420 <xsl:if test=
"$latex.fancyhdr.truncation.partition!=''">
421 <xsl:variable name=
"partition">
422 <xsl:value-of select=
"round(number($latex.fancyhdr.truncation.partition))"/>
424 <xsl:variable name=
"left.fraction">
426 <xsl:when test=
"$partition<1">
427 <xsl:text>0</xsl:text>
429 <xsl:when test=
"$partition>97">
430 <xsl:text>.98</xsl:text>
433 <!-- example: 60 becomes .59 -->
434 <xsl:value-of select=
"($partition - 1) div 100"/>
438 <xsl:variable name=
"right.fraction" select=
"0.98 - number($left.fraction)"/>
439 <xsl:text>% Safeguard against long headers.
</xsl:text>
440 <xsl:text>\IfFileExists{truncate.sty}{
</xsl:text>
441 <xsl:text>\usepackage{truncate}
</xsl:text>
442 <xsl:text>% Use an ellipsis when text would be larger than x% of the text width.
</xsl:text>
443 <xsl:text>% Preserve left/right text alignment using \hfill (works for English).
</xsl:text>
445 <xsl:when test=
"$latex.fancyhdr.truncation.style='lr'">
446 <!-- left vs. right -->
448 <xsl:when test=
"$left.fraction > 0.02">
449 <xsl:text>\fancyhead[ol]{\truncate{
</xsl:text><xsl:value-of select=
"$left.fraction"/><xsl:text>\textwidth}{\sl\leftmark}}
</xsl:text>
450 <xsl:text>\fancyhead[el]{\truncate{
</xsl:text><xsl:value-of select=
"$left.fraction"/><xsl:text>\textwidth}{\sl\leftmark}}
</xsl:text>
453 <xsl:text>\fancyhead[ol]{}
</xsl:text>
454 <xsl:text>\fancyhead[el]{}
</xsl:text>
458 <xsl:when test=
"$right.fraction > 0.02">
459 <xsl:text>\fancyhead[or]{\truncate{
</xsl:text><xsl:value-of select=
"$right.fraction"/><xsl:text>\textwidth}{\hfill\sl\rightmark}}
</xsl:text>
460 <xsl:text>\fancyhead[er]{\truncate{
</xsl:text><xsl:value-of select=
"$right.fraction"/><xsl:text>\textwidth}{\hfill\sl\rightmark}}
</xsl:text>
463 <xsl:text>\fancyhead[or]{}
</xsl:text>
464 <xsl:text>\fancyhead[er]{}
</xsl:text>
469 <!-- inside vs. outside -->
471 <xsl:when test=
"$left.fraction > 0.02">
472 <xsl:text>\fancyhead[ol]{\truncate{
</xsl:text><xsl:value-of select=
"$left.fraction"/><xsl:text>\textwidth}{\sl\leftmark}}
</xsl:text>
473 <xsl:text>\fancyhead[er]{\truncate{
</xsl:text><xsl:value-of select=
"$left.fraction"/><xsl:text>\textwidth}{\hfill\sl\rightmark}}
</xsl:text>
476 <xsl:text>\fancyhead[ol]{}
</xsl:text>
477 <xsl:text>\fancyhead[er]{}
</xsl:text>
481 <xsl:when test=
"$right.fraction > 0.02">
482 <xsl:text>\fancyhead[el]{\truncate{
</xsl:text><xsl:value-of select=
"$right.fraction"/><xsl:text>\textwidth}{\sl\leftmark}}
</xsl:text>
483 <xsl:text>\fancyhead[or]{\truncate{
</xsl:text><xsl:value-of select=
"$right.fraction"/><xsl:text>\textwidth}{\hfill\sl\rightmark}}
</xsl:text>
486 <xsl:text>\fancyhead[el]{}
</xsl:text>
487 <xsl:text>\fancyhead[or]{}
</xsl:text>
492 <xsl:text>}{\typeout{WARNING: truncate.sty wasn't available and functionality was skipped.}}
</xsl:text>
495 <xsl:when test=
"$latex.fancyhdr.style='natural'">
498 % Override the default from fancyhdr (which would be to have all-caps headings).
499 \newcommand{\dblatex@chaptermark}[
1]{\markboth{{\ifnum \c@secnumdepth
>\m@ne \@chapapp\ \thechapter. \ \fi #
1}}{}}
500 \def\dblatex@chaptersmark#
1{\markboth{{#
1}}{}}
501 \newcommand{\dblatex@sectionmark}[
1]{\markright{{\ifnum \c@secnumdepth
>\z@ \thesection. \ \fi #
1}}}
502 \let\dblatex@ps@fancy\ps@fancy
505 \let\chaptermark\dblatex@chaptermark
506 \let\sectionmark\dblatex@sectionmark
512 <xsl:call-template name=
"generate.latex.pagestyle"/>
515 <xsl:if test="latex.fancyhdr.lh !=''"><xsl:text>\lhead{</xsl:text><xsl:value-of select="$latex.fancyhdr.lh"/><xsl:text>} </xsl:text></xsl:if>
516 <xsl:if test="latex.fancyhdr.ch !=''"><xsl:text>\chead{</xsl:text><xsl:value-of select="$latex.fancyhdr.ch"/><xsl:text>} </xsl:text></xsl:if>
517 <xsl:if test="latex.fancyhdr.rh !=''"><xsl:text>\rhead{</xsl:text><xsl:value-of select="$latex.fancyhdr.rh"/><xsl:text>} </xsl:text></xsl:if>
518 <xsl:if test="latex.fancyhdr.lf !=''"><xsl:text>\lfoot{</xsl:text><xsl:value-of select="$latex.fancyhdr.lf"/><xsl:text>} </xsl:text></xsl:if>
519 <xsl:if test="latex.fancyhdr.cf !=''"><xsl:text>\cfoot{</xsl:text><xsl:value-of select="$latex.fancyhdr.cf"/><xsl:text>} </xsl:text></xsl:if>
520 <xsl:if test="latex.fancyhdr.rf !=''"><xsl:text>\rfoot{</xsl:text><xsl:value-of select="$latex.fancyhdr.rf"/><xsl:text>} </xsl:text></xsl:if>
523 <xsl:text>% ----------------------
</xsl:text>
524 <xsl:text>% Most Common Packages
</xsl:text>
525 <xsl:text>% ----------------------
</xsl:text>
526 <xsl:if test=
"$latex.use.varioref=1">
527 <xsl:text>\usepackage[
</xsl:text>
528 <xsl:value-of select=
"$latex.varioref.options"/>
529 <xsl:text>]{varioref}
</xsl:text>
531 <xsl:text>\usepackage{latexsym}
</xsl:text>
532 <xsl:if test=
"$latex.use.dcolumn=1">
533 <xsl:text>\usepackage{dcolumn}
</xsl:text>
534 <xsl:text>% Default decimal point-style column
</xsl:text>
535 <xsl:text>\newcolumntype{d}{D{
</xsl:text>
536 <xsl:call-template name=
"gentext.dingbat">
537 <xsl:with-param name=
"dingbat">decimalpoint
</xsl:with-param>
539 <xsl:text>}{
</xsl:text>
541 <xsl:when test=
"$latex.decimal.point!=''">
542 <xsl:value-of select=
"$latex.decimal.point"/>
545 <xsl:call-template name=
"gentext.dingbat">
546 <xsl:with-param name=
"dingbat">latexdecimal
</xsl:with-param>
550 <xsl:text>}{-
1}}
</xsl:text>
552 <xsl:text>\usepackage{enumerate}
</xsl:text>
553 <xsl:if test=
"$latex.use.fancybox=1">
554 <!-- must be before \usepackage{fancyvrb} -->
555 <xsl:text>\usepackage{fancybox}
</xsl:text>
557 <xsl:text>\usepackage{float}
</xsl:text>
558 <xsl:text>\usepackage{ragged2e}
</xsl:text>
559 <xsl:if test=
"$latex.use.fancyvrb=1">
560 <!-- must be after \usepackage{fancybox} -->
561 <xsl:text>\usepackage{fancyvrb}
</xsl:text>
562 <xsl:text>\makeatletter\@namedef{FV@fontfamily@default}{\def\FV@FontScanPrep{}\def\FV@FontFamily{}}\makeatother
</xsl:text>
563 <xsl:if test=
"$latex.fancyvrb.tabsize!=''">
564 <xsl:text>\fvset{obeytabs=true,tabsize=
</xsl:text>
565 <xsl:value-of select=
"$latex.fancyvrb.tabsize"/>
566 <xsl:text>}
</xsl:text>
569 <xsl:if test=
"$latex.use.isolatin1=1">
570 <xsl:message>Please use $latex.inputenc='latin1' instead of $latex.use.isolatin1='
1'.
</xsl:message>
571 <xsl:text>\usepackage{isolatin1}
</xsl:text>
574 <xsl:when test=
"$latex.use.parskip=1">
575 <xsl:text>\usepackage{parskip}
</xsl:text>
578 <!-- hack from parksip to stop excess whitespace after figure captions -->
579 <xsl:text><![CDATA[\makeatletter
580 \let\dblatex@center\center\let\dblatex@endcenter\endcenter
581 \def\dblatex@nolistI{\leftmargin\leftmargini\topsep\z@ \parsep\parskip \itemsep\z@}
582 \def\center{\let\@listi\dblatex@nolistI\@listi\dblatex@center\let\@listi\@listI\@listi}
583 \def\endcenter{\dblatex@endcenter}
588 <xsl:if test=
"$latex.use.rotating=1"><xsl:text>\usepackage{rotating}
</xsl:text></xsl:if>
589 <xsl:if test=
"$latex.use.subfigure=1"><xsl:text>\usepackage{subfigure}
</xsl:text></xsl:if>
590 <xsl:if test=
"$latex.use.tabularx=1"><xsl:text>\usepackage{tabularx}
</xsl:text></xsl:if>
591 <xsl:if test=
"$latex.use.ltxtable=1 or $latex.use.longtable=1"><xsl:text>\usepackage{longtable}
</xsl:text></xsl:if>
592 <xsl:if test=
"$latex.use.umoline=1"><xsl:text>\usepackage{umoline}
</xsl:text></xsl:if>
593 <xsl:if test=
"$latex.use.url=1"><xsl:text>\usepackage{url}
</xsl:text></xsl:if>
594 <xsl:if test=
"$latex.math.support=1"><xsl:value-of select=
"$latex.math.preamble"/></xsl:if>
596 <!-- Configure document font. -->
597 <xsl:if test=
"$latex.document.font != 'default'">
598 <xsl:text>% ---------------
</xsl:text>
599 <xsl:text>% Document Font
</xsl:text>
600 <xsl:text>% ---------------
</xsl:text>
601 <xsl:text>\usepackage{
</xsl:text><xsl:value-of select=
"$latex.document.font"/><xsl:text>}
</xsl:text>
604 <xsl:if test=
"$latex.use.hyperref=1">
605 <xsl:call-template name=
"latex.hyperref.preamble"/>
607 <xsl:value-of select=
"$latex.admonition.environment"/>
608 <xsl:call-template name=
"latex.float.preamble"/>
609 <xsl:call-template name=
"latex.graphicext"/>
611 <xsl:when test='$latex.caption.swapskip=
1'
>
612 <xsl:text>% --------------------------------------------
</xsl:text>
613 <xsl:text>% $latex.caption.swapskip enabled for $formal.title.placement support
</xsl:text>
614 <xsl:text>\newlength{\docbooktolatextempskip}
</xsl:text>
615 <xsl:text>\newcommand{\captionswapskip}{\setlength{\docbooktolatextempskip}{\abovecaptionskip}
</xsl:text>
616 <xsl:text>\setlength{\abovecaptionskip}{\belowcaptionskip}
</xsl:text>
617 <xsl:text>\setlength{\belowcaptionskip}{\docbooktolatextempskip}}
</xsl:text>
620 <xsl:text>\newcommand{\captionswapskip}{}
</xsl:text>
623 <xsl:if test='$latex.hyphenation.tttricks=
1'
>
624 <xsl:text>% --------------------------------------------
</xsl:text>
625 <xsl:text>% Better linebreaks
</xsl:text>
626 <xsl:text>\newcommand{\docbookhyphenatedot}[
1]{{\hyphenchar\font=`\.\relax #
1\hyphenchar\font=`\-}}
</xsl:text>
627 <xsl:text>\newcommand{\docbookhyphenatefilename}[
1]{{\hyphenchar\font=`\.\relax #
1\hyphenchar\font=`\-}}
</xsl:text>
628 <xsl:text>\newcommand{\docbookhyphenateurl}[
1]{{\hyphenchar\font=`\/\relax #
1\hyphenchar\font=`\-}}
</xsl:text>
631 <xsl:message>$document.xml.language: '<xsl:value-of select="$document.xml.language"/>'</xsl:message>
632 <xsl:message>$latex.language.option: '<xsl:value-of select="$latex.language.option"/>'</xsl:message>
634 <xsl:if test=
"$latex.language.option!='none'">
635 <xsl:text>\usepackage[
</xsl:text><xsl:value-of select=
"$latex.language.option" /><xsl:text>]{babel}
</xsl:text>
637 <xsl:if test=
"$latex.use.hyperref='1'">
638 <xsl:text>% Guard against a problem with old package versions.
</xsl:text>
639 <xsl:text>\makeatletter
</xsl:text>
640 <xsl:text>\AtBeginDocument{
</xsl:text>
641 <xsl:text>\DeclareRobustCommand\ref{\@refstar}
</xsl:text>
642 <xsl:text>\DeclareRobustCommand\pageref{\@pagerefstar}
</xsl:text>
643 <xsl:text>}
</xsl:text>
644 <xsl:text>\makeatother
</xsl:text>
647 <xsl:when test=
"$latex.is.draft!=''">
648 <xsl:if test=
"$latex.is.draft=1">
649 <xsl:call-template name=
"generate.latex.draft.preamble"/>
653 <xsl:if test=
"(/set|/book|/article)[1]/@status='draft'">
654 <xsl:call-template name=
"generate.latex.draft.preamble"/>
660 <doc:template xmlns=
"">
663 Common
&LaTeX; preamble shared by
<doc:db basename=
"article">article
</doc:db> and
664 <doc:db basename=
"book">book
</doc:db> when their
<sgmltag
665 class=
"attribute">status
</sgmltag> is
<quote>draft
</quote>.
677 <listitem><simpara><xref linkend=
"param.latex.is.draft"/></simpara></listitem>
678 <listitem><simpara><xref linkend=
"param.latex.use.varioref"/></simpara></listitem>
682 <simplelist type='inline'
>
688 <xsl:template name=
"generate.latex.draft.preamble">
690 <xsl:when test=
"$latex.use.varioref='1'">
691 <xsl:message>Combining varioref with showkeys (and hyperref?) is not supported.
</xsl:message>
694 <xsl:text>\usepackage[color]{showkeys}
</xsl:text>
695 <xsl:text>\definecolor{refkey}{gray}{
0.5}
</xsl:text>
696 <xsl:text>\definecolor{labelkey}{gray}{
0.5}
</xsl:text>
697 <xsl:text>% Rip off things from showkeys to highlight index references
</xsl:text>
698 <xsl:text>\definecolor{indexkey}{gray}{
.5}%
</xsl:text>
699 <xsl:text>\makeatletter
</xsl:text>
700 <xsl:text>\def\SK@indexcolor{\color{indexkey}}
</xsl:text>
701 <xsl:text>\def\SK@@@index#
1{\@bsphack\SK@\SK@@index{#
1}\begingroup\SK@index{#
1}\endgroup\@esphack}
</xsl:text>
702 <xsl:text>\def\SK@@index#
1>#
2\SK@{\leavevmode\vbox to\z@{\vss \SK@indexcolor \rlap{\vrule\raise
.75em\hbox{}{\circle*{
5}}}}}
</xsl:text>
703 <xsl:text>\AtBeginDocument{\let\SK@index\index
\let\index\SK@@@index}
</xsl:text>
704 <xsl:text>\makeatother
</xsl:text>
709 <doc:template xmlns=
"">
710 <refpurpose> Unavoidable
&LaTeX; preamble shared by
<doc:db
711 basename=
"article">articles
</doc:db> and
<doc:db
712 basename=
"book">books
</doc:db> </refpurpose>
714 <para>Contains custom commands
<emphasis>that you just can't get rid of!
</emphasis></para>
718 <listitem><simpara><xref linkend=
"param.latex.use.hyperref"/></simpara></listitem>
719 <listitem><simpara><xref linkend=
"param.latex.suppress.blank.page.headers"/></simpara></listitem>
720 <listitem><simpara><xref linkend=
"param.latex.use.ucs"/></simpara></listitem>
721 <listitem><simpara><xref linkend=
"param.latex.entities"/></simpara></listitem>
722 <listitem><simpara><xref linkend=
"param.latex.ucs.options"/></simpara></listitem>
723 <listitem><simpara><xref linkend=
"param.latex.inputenc"/></simpara></listitem>
724 <listitem><simpara><xref linkend=
"param.latex.fontenc"/></simpara></listitem>
729 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.biblio"/></simpara></listitem>
730 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.callout"/></simpara></listitem>
731 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.citation"/></simpara></listitem>
732 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.footnote"/></simpara></listitem>
733 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.glossary"/></simpara></listitem>
734 <listitem><simpara><xref linkend=
"template.latex.preamble.essential.index"/></simpara></listitem>
738 <xsl:template name=
"generate.latex.essential.preamble">
739 <xsl:text>% --------------------------------------------
</xsl:text>
740 <xsl:text>\makeatletter
</xsl:text>
741 <xsl:text>\newcommand{\dbz}{\penalty \z@}
</xsl:text>
742 <xsl:text>\newcommand{\docbooktolatexpipe}{\ensuremath{|}\dbz}
</xsl:text>
743 <xsl:text>\newskip\docbooktolatexoldparskip
</xsl:text>
744 <xsl:text>\newcommand{\docbooktolatexnoparskip}{\docbooktolatexoldparskip=\parskip\parskip=
0pt plus
1pt}
</xsl:text>
745 <xsl:text>\newcommand{\docbooktolatexrestoreparskip}{\parskip=\docbooktolatexoldparskip}
</xsl:text>
746 <xsl:if test=
"$latex.use.hyperref!='1'">
747 <xsl:text>\newcommand{\href}[
1]{{}}
</xsl:text>
748 <xsl:text>\newcommand{\hyperlink}[
1]{{}}
</xsl:text>
749 <xsl:text>\newcommand{\hypertarget}[
2]{#
2}
</xsl:text>
751 <!-- don't print headings on blank pages -->
752 <xsl:if test=
"$latex.suppress.blank.page.headers=1">
753 <xsl:text>\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
</xsl:text>
755 <xsl:if test=
"$latex.use.ucs='1'">
756 <xsl:text>\usepackage[
</xsl:text>
757 <xsl:value-of select=
"$latex.ucs.options"/>
758 <xsl:text>]{ucs}
</xsl:text>
760 <xsl:if test=
"$latex.entities='catcode'">
761 <xsl:text>\catcode`\
&=\active\def
&{\@ifnextchar##{\begingroup\@sanitize\@docbooktolatexunicode\@gobble}{\
&}}
</xsl:text>
762 <xsl:if test=
"$latex.use.ucs!='1'">
764 % A few example Unicode characters.
765 % For full support, use the unicode pacakge from Dominique Unruh/CTAN.
766 % \else\ifnum#
1=
8216{\textquoteleft}%
767 % \else\ifnum#
1=
8217{\textquoteright}%
768 \newcommand{\unichar}[
1]{%
770 \else\ifnum#
1=
8212{---}%
771 \else\ifnum#
1=
8216{`}%
772 \else\ifnum#
1=
8217{'}%
773 \else\ifnum#
1=
8218{\glq}%
774 \else\ifnum#
1=
8220{``}%
775 \else\ifnum#
1=
8221{''}%
776 \else\ifnum#
1=
8222{\glqq}%
783 <xsl:text>\def\@docbooktolatexunicode#
1;{\endgroup\edef\@dbtemp{#
1}\unichar{\@dbtemp}}
</xsl:text>
785 <xsl:if test=
"$latex.inputenc!=''">
786 <xsl:text>\usepackage[
</xsl:text>
787 <xsl:value-of select=
"$latex.inputenc"/>
788 <xsl:text>]{inputenc}
</xsl:text>
790 <xsl:if test=
"$latex.fontenc!=''">
791 <xsl:text>\usepackage[
</xsl:text>
792 <xsl:value-of select=
"$latex.fontenc"/>
793 <xsl:text>]{fontenc}
</xsl:text>
795 <!-- make proper headers for unnumbered chapter-level components -->
796 <!-- TODO make proper headers for unnumbered section-level components -->
798 \ifx\dblatex@chaptersmark\@undefined\def\dblatex@chaptersmark#
1{\markboth{\MakeUppercase{#
1}}{}}\fi
799 \let\save@makeschapterhead\@makeschapterhead
800 \def\dblatex@makeschapterhead#
1{\vspace*{-
80pt}\save@makeschapterhead{#
1}}
801 \def\@makeschapterhead#
1{\dblatex@makeschapterhead{#
1}\dblatex@chaptersmark{#
1}}
803 <xsl:call-template name=
"latex.preamble.essential.biblio"/>
804 <xsl:call-template name=
"latex.preamble.essential.callout"/>
805 <xsl:call-template name=
"latex.preamble.essential.citation"/>
806 <xsl:call-template name=
"latex.preamble.essential.footnote"/>
807 <xsl:call-template name=
"latex.preamble.essential.glossary"/>
808 <xsl:call-template name=
"latex.preamble.essential.index"/>
810 \def\docbooktolatexgobble{\expandafter\@gobble}
811 % Prevent multiple openings of the same aux file
812 % (happens when backref is used with multiple bibliography environments)
813 \ifx\AfterBeginDocument\undefined\let\AfterBeginDocument\AtBeginDocument\fi
815 \let\latex@@starttoc\@starttoc
817 \@ifundefined{docbooktolatex@aux#
1}{%
818 \global\@namedef{docbooktolatex@aux#
1}{}%
819 \latex@@starttoc{#
1}%
823 % --------------------------------------------
824 % Hacks for honouring row/entry/@align
825 % (\hspace not effective when in paragraph mode)
826 % Naming convention for these macros is:
827 % 'docbooktolatex' 'align' {alignment-type} {position-within-entry}
828 % where r = right, l = left, c = centre
829 \newcommand{\docbooktolatex@align}[
2]{\protect\ifvmode#
1\else\ifx\LT@@tabarray\@undefined#
2\else#
1\fi\fi}
830 \newcommand{\docbooktolatexalignll}{\docbooktolatex@align{\raggedright}{}}
831 \newcommand{\docbooktolatexalignlr}{\docbooktolatex@align{}{\hspace*\fill}}
832 \newcommand{\docbooktolatexaligncl}{\docbooktolatex@align{\centering}{\hfill}}
833 \newcommand{\docbooktolatexaligncr}{\docbooktolatex@align{}{\hspace*\fill}}
834 \newcommand{\docbooktolatexalignrl}{\protect\ifvmode\raggedleft\else\hfill\fi}
835 \newcommand{\docbooktolatexalignrr}{}
836 \ifx\captionswapskip\@undefined\newcommand{\captionswapskip}{}\fi
838 <xsl:text>\makeatother
</xsl:text>
842 <refpurpose> Preamble for certain floats
</refpurpose>
844 <xsl:template name=
"latex.float.preamble">
845 <xsl:text>% --------------------------------------------
</xsl:text>
846 <xsl:text>% Commands to manage/style/create floats
</xsl:text>
847 <xsl:text>% figures, tables, algorithms, examples, eqn
</xsl:text>
848 <xsl:text>% --------------------------------------------
</xsl:text>
849 <xsl:text> \floatstyle{ruled}
</xsl:text>
850 <xsl:text> \restylefloat{figure}
</xsl:text>
851 <xsl:text> \floatstyle{ruled}
</xsl:text>
852 <xsl:text> \restylefloat{table}
</xsl:text>
853 <xsl:text> \floatstyle{ruled}
</xsl:text>
854 <xsl:text> \newfloat{program}{ht}{lop}[section]
</xsl:text>
855 <xsl:text> \floatstyle{ruled}
</xsl:text>
856 <xsl:text> \newfloat{example}{ht}{loe}[section]
</xsl:text>
857 <xsl:text> \floatname{example}{
</xsl:text>
858 <xsl:call-template name=
"gentext.element.name">
859 <xsl:with-param name=
"element.name">example
</xsl:with-param>
861 <xsl:text>}
</xsl:text>
862 <xsl:text> \floatstyle{ruled}
</xsl:text>
863 <xsl:text> \newfloat{dbequation}{ht}{loe}[section]
</xsl:text>
864 <xsl:text> \makeatletter\def\toclevel@dbequation{
0}\makeatother
</xsl:text>
865 <xsl:text> \floatname{dbequation}{
</xsl:text>
866 <xsl:call-template name=
"gentext.element.name">
867 <xsl:with-param name=
"element.name">equation
</xsl:with-param>
869 <xsl:text>}
</xsl:text>
870 <xsl:text> \floatstyle{boxed}
</xsl:text>
871 <xsl:text> \newfloat{algorithm}{ht}{loa}[section]
</xsl:text>
872 <xsl:text> \floatname{algorithm}{Algorithm}
</xsl:text>
875 <doc:param name=
"latex.pdf.preamble" xmlns=
"">
879 % --------------------------------------------
880 % Check for PDFLaTeX/LaTeX
881 % --------------------------------------------
883 \ifx\pdfoutput\undefined
884 \pdffalse % we are not running PDFLaTeX
886 \pdfoutput=
1 % we are running PDFLaTeX
889 % --------------------------------------------
890 % Load graphicx package with pdf if needed
891 % --------------------------------------------
893 \usepackage[pdftex]{graphicx}
896 \usepackage{graphicx}
901 <xsl:param name=
"latex.pdf.preamble">
902 <xsl:text>\usepackage{ifthen}
</xsl:text>
903 <xsl:text>% --------------------------------------------
</xsl:text>
904 <xsl:text>% Check for PDFLaTeX/LaTeX
</xsl:text>
905 <xsl:text>% --------------------------------------------
</xsl:text>
906 <xsl:text>\newif\ifpdf
</xsl:text>
907 <xsl:text>\ifx\pdfoutput\undefined
</xsl:text>
908 <xsl:text>\pdffalse % we are not running PDFLaTeX
</xsl:text>
909 <xsl:text>\else
</xsl:text>
910 <xsl:text>\pdfoutput=
1 % we are running PDFLaTeX
</xsl:text>
911 <xsl:text>\pdftrue
</xsl:text>
912 <xsl:text>\fi
</xsl:text>
913 <xsl:text>% --------------------------------------------
</xsl:text>
914 <xsl:text>% Load graphicx package with pdf if needed
</xsl:text>
915 <xsl:text>% --------------------------------------------
</xsl:text>
916 <xsl:text>\ifpdf
</xsl:text>
917 <xsl:text>\usepackage[pdftex]{graphicx}
</xsl:text>
918 <xsl:text>\pdfcompresslevel=
9 </xsl:text>
919 <xsl:text>\else
</xsl:text>
920 <xsl:text>\usepackage{graphicx}
</xsl:text>
921 <xsl:text>\fi
</xsl:text>
924 <doc:template name=
"latex.hyperref.preamble" xmlns=
"">
925 <refpurpose> Manage the part of the preamble that handles the hyperref package.
</refpurpose>
927 <para> This template outputs the LaTeX code
<literal>\usepackage[...]{hyperref}
</literal>
928 in order to use hyperlinks, backrefs and other goodies. If PDF support is activated,
929 outputs laTeX code to detect whether the document is being compiled with
930 <filename>pdflatex
</filename> or
<filename>latex
</filename> to supply the
931 right parameters (pdftex, dvips, etc).
932 <doc:todo> The package options should be optained
933 from XSL variables.
</doc:todo>
935 <para>Default Value with PDF support:
937 % --------------------------------------------
938 % Load hyperref package with pdf if needed
939 % --------------------------------------------
941 \usepackage[pdftex,bookmarksnumbered,colorlinks,backref, bookmarks, breaklinks, linktocpage]{hyperref}
943 \usepackage[bookmarksnumbered,colorlinks,backref, bookmarks, breaklinks, linktocpage]{hyperref}
945 % --------------------------------------------
948 <para>Default Value without PDF support:
950 % --------------------------------------------
951 % Load hyperref package
952 % --------------------------------------------
953 \usepackage[bookmarksnumbered,colorlinks,backref, bookmarks, breaklinks, linktocpage]{hyperref}
959 <listitem><simpara><xref linkend=
"param.latex.pdf.support"/></simpara></listitem>
960 <listitem><simpara><xref linkend=
"param.latex.hyperref.param.common"/></simpara></listitem>
961 <listitem><simpara><xref linkend=
"param.latex.hyperref.param.pdftex"/></simpara></listitem>
962 <listitem><simpara><xref linkend=
"param.latex.hyperref.param.dvips"/></simpara></listitem>
966 <xsl:template name=
"latex.hyperref.preamble">
968 <xsl:when test=
"$latex.pdf.support=1">
969 <xsl:text>% --------------------------------------------
</xsl:text>
970 <xsl:text>% Load hyperref package with pdf if needed
</xsl:text>
971 <xsl:text>% --------------------------------------------
</xsl:text>
972 <xsl:text>\ifpdf
</xsl:text>
973 <xsl:text>\usepackage[pdftex,
</xsl:text>
974 <xsl:value-of select=
"$latex.hyperref.param.common" />
975 <xsl:text>,
</xsl:text>
976 <xsl:value-of select=
"$latex.hyperref.param.pdftex" />
977 <xsl:text>]{hyperref}
</xsl:text>
978 <xsl:text>\else
</xsl:text>
979 <xsl:text>\usepackage[
</xsl:text>
980 <xsl:value-of select=
"$latex.hyperref.param.common" />
981 <xsl:text>,
</xsl:text>
982 <xsl:value-of select=
"$latex.hyperref.param.dvips" />
983 <xsl:text>]{hyperref}
</xsl:text>
985 <xsl:text>\makeatletter\def\pdfmark@[#1]#2{}\makeatother </xsl:text>
987 <xsl:text>\fi
</xsl:text>
988 <xsl:text>% --------------------------------------------
</xsl:text>
991 <xsl:text>% --------------------------------------------
</xsl:text>
992 <xsl:text>% Load hyperref package
</xsl:text>
993 <xsl:text>% --------------------------------------------
</xsl:text>
994 <xsl:text>\usepackage[
</xsl:text>
995 <xsl:value-of select=
"$latex.hyperref.param.common" />
996 <xsl:text>,
</xsl:text>
997 <xsl:value-of select=
"$latex.hyperref.param.dvips" />
998 <xsl:text>]{hyperref}
</xsl:text>
1000 <xsl:text>\makeatletter\def\pdfmark@[#1]#2{}\makeatother </xsl:text>
1006 <doc:param xmlns=
"">
1007 <refpurpose> &LaTeX; mathematics support
</refpurpose>
1009 <xsl:param name=
"latex.math.preamble">
1010 <xsl:text>% --------------------------------------------
</xsl:text>
1011 <xsl:text>% Math support
</xsl:text>
1012 <xsl:text>% --------------------------------------------
</xsl:text>
1013 <xsl:text>\usepackage{amsmath,amsthm, amsfonts, amssymb, amsxtra,amsopn}
</xsl:text>
1014 <xsl:text>%\newtheorem{thm}{Theorem}[section]
</xsl:text>
1015 <xsl:text>%\newtheorem{cor}[section]{Corollary}
</xsl:text>
1016 <xsl:text>%\newtheorem{lem}[section]{Lemma}
</xsl:text>
1017 <xsl:text>%\newtheorem{defn}[section]{Definition}
</xsl:text>
1018 <xsl:text>%\newtheorem{prop}[section]{Proposition}
</xsl:text>
1019 <xsl:text>%\newtheorem{ax}{Axiom}
</xsl:text>
1020 <xsl:text>%\newtheorem{theorem}[section]{Theorem}
</xsl:text>
1021 <xsl:text>%\newtheorem{corollary}{Corollary}
</xsl:text>
1022 <xsl:text>%\newtheorem{lemma}{Lemma}
</xsl:text>
1023 <xsl:text>%\newtheorem{proposition}{Proposition}
</xsl:text>
1024 <xsl:text>%\theoremstyle{definition}
</xsl:text>
1025 <xsl:text>%\newtheorem{definition}{Definition}
</xsl:text>
1026 <xsl:text>%\theoremstyle{remark}
</xsl:text>
1027 <xsl:text>%\newtheorem{rem}{Remark}
</xsl:text>
1028 <xsl:text>%\newtheorem*{notation}{Notation}
</xsl:text>
1029 <xsl:text>%\newcommand{\ntt}{\normalfont\ttfamily}
</xsl:text>
1030 <xsl:text>%\newcommand{\thmref}[
1]{Theorem~\ref{#
1}}
</xsl:text>
1031 <xsl:text>%\newcommand{\secref}[
1]{\S\ref{#
1}}
</xsl:text>
1032 <xsl:text>%\newcommand{\lemref}[
1]{Lemma~\ref{#
1}}
</xsl:text>
1033 <xsl:text> \newcommand{\bysame}{\mbox{\rule{
3em}{
.4pt}}\,}
</xsl:text>
1034 <xsl:text> \newcommand{\A}{\mathcal{A}}
</xsl:text>
1035 <xsl:text> \newcommand{\B}{\mathcal{B}}
</xsl:text>
1036 <xsl:text> \newcommand{\XcY}{{(X,Y)}}
</xsl:text>
1037 <xsl:text> \newcommand{\SX}{{S_X}}
</xsl:text>
1038 <xsl:text> \newcommand{\SY}{{S_Y}}
</xsl:text>
1039 <xsl:text> \newcommand{\SXY}{{S_{X,Y}}}
</xsl:text>
1040 <xsl:text> \newcommand{\SXgYy}{{S_{X|Y}(y)}}
</xsl:text>
1041 <xsl:text> \newcommand{\Cw}[
1]{{\hat C_#
1(X|Y)}}
</xsl:text>
1042 <xsl:text> \newcommand{\G}{{G(X|Y)}}
</xsl:text>
1043 <xsl:text> \newcommand{\PY}{{P_{\mathcal{Y}}}}
</xsl:text>
1044 <xsl:text> \newcommand{\X}{\mathcal{X}}
</xsl:text>
1045 <xsl:text> \newcommand{\wt}{\widetilde}
</xsl:text>
1046 <xsl:text> \newcommand{\wh}{\widehat}
</xsl:text>
1047 <xsl:text> % --------------------------------------------
</xsl:text>
1048 <xsl:text> %\DeclareMathOperator{\per}{per}
</xsl:text>
1049 <xsl:text> \DeclareMathOperator{\cov}{cov}
</xsl:text>
1050 <xsl:text> \DeclareMathOperator{\non}{non}
</xsl:text>
1051 <xsl:text> \DeclareMathOperator{\cf}{cf}
</xsl:text>
1052 <xsl:text> \DeclareMathOperator{\add}{add}
</xsl:text>
1053 <xsl:text> \DeclareMathOperator{\Cham}{Cham}
</xsl:text>
1054 <xsl:text> \DeclareMathOperator{\IM}{Im}
</xsl:text>
1055 <xsl:text> \DeclareMathOperator{\esssup}{ess\,sup}
</xsl:text>
1056 <xsl:text> \DeclareMathOperator{\meas}{meas}
</xsl:text>
1057 <xsl:text> \DeclareMathOperator{\seg}{seg}
</xsl:text>
1058 <xsl:text>% --------------------------------------------
</xsl:text>
1061 <doc:template xmlns=
"">
1062 <refpurpose> Declared graphic extensions
</refpurpose>
1065 This template checks whether the user has overridden
<command>grafic.default.extension
</command>
1066 Otherwise, declares .pdf, .png, .jpg if using pdflatex and .eps if using latex.
1068 <programlisting><![CDATA[
1069 <xsl:template name=
"latex.graphicext">
1071 <xsl:when test=
"$graphic.default.extension !=''">
1072 <xsl:text>\DeclareGraphicsExtensions{
</xsl:text>
1073 <xsl:if test=
"not(contains($graphic.default.extension,'.'))">
1074 <xsl:text>.
</xsl:text>
1076 <xsl:value-of select=
"$graphic.default.extension"/>
1077 <xsl:text>}
</xsl:text>
1081 <xsl:when test=
"$latex.pdf.support=1">
1082 <xsl:text>\ifpdf
</xsl:text>
1083 <xsl:text>\DeclareGraphicsExtensions{.pdf,.png,.jpg}
</xsl:text>
1084 <xsl:text>\else
</xsl:text>
1085 <xsl:text>\DeclareGraphicsExtensions{.eps}
</xsl:text>
1086 <xsl:text>\fi
</xsl:text>
1089 <xsl:text>\DeclareGraphicsExtensions{.eps}
</xsl:text>
1095 ]]
></programlisting>
1099 <listitem><simpara><xref linkend=
"param.graphic.default.extension"/></simpara></listitem>
1100 <listitem><simpara><xref linkend=
"param.latex.pdf.support"/></simpara></listitem>
1104 <xsl:template name=
"latex.graphicext">
1106 <xsl:when test=
"$graphic.default.extension !=''">
1107 <xsl:text>\DeclareGraphicsExtensions{
</xsl:text>
1108 <xsl:if test=
"not(contains($graphic.default.extension,'.'))">
1109 <xsl:text>.
</xsl:text>
1111 <xsl:value-of select=
"$graphic.default.extension"/>
1112 <xsl:text>}
</xsl:text>
1116 <xsl:when test=
"$latex.pdf.support=1">
1117 <xsl:text>\ifpdf
</xsl:text>
1118 <xsl:text>\DeclareGraphicsExtensions{.pdf,.png,.jpg}
</xsl:text>
1119 <xsl:text>\else
</xsl:text>
1120 <xsl:text>\DeclareGraphicsExtensions{.eps}
</xsl:text>
1121 <xsl:text>\fi
</xsl:text>
1124 <xsl:text>\DeclareGraphicsExtensions{.eps}
</xsl:text>