2 <!DOCTYPE xsl:transform [
3 <!ENTITY % latex.characters SYSTEM "ltexchar.mod">
7 <xsl:transform version="1.0"
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
10 <xsl:output method="text" encoding="ISO-8859-1" />
12 <xsl:strip-space elements="gamebook meta section data ol ul dl li dd footnotes footnote illustration instance table tr th td" />
13 <xsl:preserve-space elements="p choice" />
19 The implementation of tables is incomplete and kludgy.
24 <!-- ====================== parameters ========================== -->
26 <xsl:param name="title-color"><xsl:text>0.0,0.0,0.0</xsl:text></xsl:param>
27 <xsl:param name="use-illustrators" />
28 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
29 <xsl:param name="pagelayout"><xsl:text>twoside</xsl:text></xsl:param>
30 <xsl:param name="usesouvenirfont"><xsl:text>no</xsl:text></xsl:param>
31 <xsl:param name="papersize"><xsl:text>a4paper</xsl:text></xsl:param>
32 <xsl:param name="papersize_de"><xsl:text>a5paper</xsl:text></xsl:param>
33 <xsl:param name="papersize_es"><xsl:text>a4paper</xsl:text></xsl:param>
34 <xsl:param name="papersize_us"><xsl:text>letterpaper</xsl:text></xsl:param>
37 <!-- ======================= variables ========================== -->
39 <xsl:variable name="newline">
44 <xsl:variable name="newparagraph">
45 <xsl:value-of select="$newline" />
46 <xsl:value-of select="$newline" />
50 <!-- ======================== Templates ========================= -->
52 <!-- ================= hierarchical sections ==================== -->
54 <xsl:template match="meta" />
56 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
58 <xsl:template match="/gamebook/section[@id='title']">
61 \RequirePackage{ifpdf}
63 \documentclass[pdftex,a4paper,fontsize=12pt,</xsl:text><xsl:value-of select="$pagelayout" /><xsl:text>,BCOR10mm,DIV=calc,headinclude,cleardoublepage=empty]{scrbook}
65 \documentclass[a4paper,fontsize=12pt,</xsl:text><xsl:value-of select="$pagelayout" /><xsl:text>,BCOR10mm,DIV=calc,headinclude,cleardoublepage=empty]{scrbook}
70 <xsl:when test="$language='es'">
72 % Use this if you are compiling spanish PDFs:
73 \usepackage[latin1]{inputenc}
74 \usepackage[spanish]{babel}
79 <xsl:when test="$usesouvenirfont='yes'">
83 \renewcommand{\rmdefault}{souvnrttf}
85 <xsl:value-of select="$newline" />
90 \usepackage[T1]{fontenc}
97 \newcommand{\pdfgraphics}{\ifpdf\DeclareGraphicsExtensions{.pdf,.jpg}\fi}
102 %\documentclass[letterpaper,12pt,oneside]{book}
103 % For european books:
104 %\documentclass[a4paper,12pt,oneside]{book}
108 \usepackage[pdftex]{graphicx}
109 \pdfobjcompresslevel=2
112 \usepackage{graphicx}
114 \usepackage[pdftex]{graphicx}
119 \definecolor{titlecolor}{rgb}{</xsl:text><xsl:value-of select="$title-color" /><xsl:text>}
120 \definecolor{lightgray}{gray}{0.75}
122 %% headers and footers %%
123 \usepackage{fancyhdr}
125 \renewcommand{\chaptermark}[1]{}
126 \renewcommand{\sectionmark}[1]{}
129 \ifthenelse{\boolean{@twoside}}%
131 \fancyhead[CO]{\iffloatpage{}{</xsl:text><xsl:value-of select="/gamebook/meta/creator[@class='short']" /><xsl:text>}}
132 \fancyhead[CE]{\iffloatpage{}{\bfseries </xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>}}
133 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}
135 \fancyhead[C]{\iffloatpage{}{\bfseries{</xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>:} \normalfont{</xsl:text><xsl:value-of select="/gamebook/meta/creator[@class='short']" /><xsl:text>}}}
136 \fancyhead[R]{\iffloatpage{}{\thepage}}}
137 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
139 \fancypagestyle{plain}{
141 \renewcommand{\headrulewidth}{0pt}
144 \fancypagestyle{empty}{
146 \renewcommand{\headrulewidth}{0pt}
149 %% hyper-references %%
151 \usepackage[pdftex,colorlinks=true,linkcolor=black,bookmarks=false]{hyperref}
152 % XMP information for PDF file, could actually be done with pdfinfo
153 \usepackage{hyperxmp}
155 pdftitle={</xsl:text><xsl:apply-templates select="/gamebook/meta/title[1]" /><xsl:text>},
156 pdfauthor={</xsl:text>
157 <xsl:apply-templates select="/gamebook/meta/rights[@class='copyrights']" />
159 <xsl:when test="$language='es'">
160 <xsl:text> Publicado por </xsl:text>
163 <xsl:text> Published by </xsl:text>
166 <xsl:apply-templates select="/gamebook/meta/publisher[1]" />
168 pdflicenseurl={http://www.projectaon.org/en/Main/License},
169 %% We need a meta-variable for the series in order to include it here:
170 pdfsubject={Lone Wolf Series},
171 pdfkeywords={lone wolf, project aon}
174 \usepackage[colorlinks=true,linkcolor=black,bookmarks=false]{hyperref}
178 %% custom style info %%
179 \setlength{\parindent}{0pt}
180 \setlength{\parskip}{1em}
181 \setlength{\headheight}{18pt}
182 \addtolength{\headwidth}{\marginparwidth}
183 \addtolength{\headwidth}{\marginparsep}
184 \setlength{\textheight}{44\baselineskip}
185 \ifthenelse{\lengthtest{\paperwidth = 210mm}}%
186 {%% if A4 (210.0 mm x 297.0 mm)
187 \addtolength{\topmargin}{-1\baselineskip}}%
188 {%% else if letter (8.5" x 11" == 215.9 mm x 279.4 mm)
189 \addtolength{\topmargin}{-2.5\baselineskip}}
193 %% new environments %%
194 \newenvironment{aonchoice}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
195 \newenvironment{aoncombat}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
196 \newenvironment{aonitemize}{\begin{list}{}{\setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
197 \newenvironment{aonordereditemize}{\begin{list}{\arabic{aoncounter}.}{\usecounter{aoncounter} \setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
198 \newcounter{aoncounter}
200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 \vspace*{\stretch{0.7}}
210 \Huge{\textcolor{titlecolor}{\textbf{</xsl:text><xsl:apply-templates select="/gamebook/meta/title[1]" /><xsl:text>}}} \vspace{-0.8em}\\
212 \vspace*{\stretch{1}}
213 \normalsize{</xsl:text><xsl:apply-templates select="/gamebook/meta/creator[@class='medium']" /><xsl:text>}
215 \vspace*{\stretch{1.3}}
221 \vspace*{\stretch{1}}
224 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
227 <xsl:when test="$language='es'">
228 <xsl:text>Fecha de Publicación: </xsl:text>
231 <xsl:text>Publication Date: </xsl:text>
234 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
235 <xsl:text> </xsl:text>
237 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
239 <xsl:when test="$language='es'"><xsl:text>de enero de</xsl:text></xsl:when>
240 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
243 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
245 <xsl:when test="$language='es'"><xsl:text>de febrero de</xsl:text></xsl:when>
246 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
249 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
251 <xsl:when test="$language='es'"><xsl:text>de marzo de</xsl:text></xsl:when>
252 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
255 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
257 <xsl:when test="$language='es'"><xsl:text>de abril de</xsl:text></xsl:when>
258 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
261 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
263 <xsl:when test="$language='es'"><xsl:text>de mayo de</xsl:text></xsl:when>
264 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
267 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
269 <xsl:when test="$language='es'"><xsl:text>de junio de</xsl:text></xsl:when>
270 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
273 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
275 <xsl:when test="$language='es'"><xsl:text>de julio de</xsl:text></xsl:when>
276 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
279 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
281 <xsl:when test="$language='es'"><xsl:text>de agosto de</xsl:text></xsl:when>
282 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
285 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
287 <xsl:when test="$language='es'"><xsl:text>de septiembre de</xsl:text></xsl:when>
288 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
291 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
293 <xsl:when test="$language='es'"><xsl:text>de octubre de</xsl:text></xsl:when>
294 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
297 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
299 <xsl:when test="$language='es'"><xsl:text>de noviembre de</xsl:text></xsl:when>
300 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
303 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
305 <xsl:when test="$language='es'"><xsl:text>de diciembre de</xsl:text></xsl:when>
306 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
310 <xsl:text>Invalid Month</xsl:text>
313 <xsl:text> </xsl:text>
314 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
318 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
321 \vspace*{\stretch{3}}
327 \clearpage{\pagestyle{empty}\cleardoublepage}
329 \vspace*{\stretch{1}}
331 \thispagestyle{empty}
333 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
334 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
337 \vspace*{\stretch{3}}
339 \clearpage{\pagestyle{empty}\cleardoublepage}
346 <xsl:apply-templates select="data/section[@class='frontmatter']" />
352 <xsl:if test="data/section[@class='mainmatter']">
353 <xsl:text>\begin{mainmatter}
357 <xsl:apply-templates select="data/section[@class='mainmatter']" />
364 <xsl:if test="data/section[@class='numbered']">
365 <xsl:apply-templates select="data/section[@class='numbered']" />
370 \ifthenelse{\boolean{@twoside}}%
376 \setcounter{topnumber}{6}
377 \renewcommand{\topfraction}{1}
378 \renewcommand{\textfraction}{0}
379 \setlength{\floatsep}{10pt}
382 <xsl:apply-templates select="data/section[@class='backmatter']" />
392 <xsl:template match="/gamebook/section[@id='toc']" />
394 <xsl:template match="section" />
396 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
398 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
400 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
401 <xsl:value-of select="$newparagraph" />
403 <xsl:text>{\huge \hypertarget{</xsl:text>
404 <xsl:value-of select="@id" />
405 <xsl:text>}{</xsl:text>
406 <xsl:apply-templates select="meta/title" />
407 <xsl:text>}}</xsl:text>
408 <xsl:value-of select="$newline" />
409 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
410 <xsl:apply-templates select="meta/title" />
411 <xsl:text>}}</xsl:text>
412 <xsl:value-of select="$newparagraph" />
414 <xsl:apply-templates />
418 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
420 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
422 <xsl:text>{\LARGE \hypertarget{</xsl:text>
423 <xsl:value-of select="@id" />
424 <xsl:text>}{</xsl:text>
425 <xsl:apply-templates select="meta/title" />
426 <xsl:text>}}</xsl:text>
427 <xsl:value-of select="$newparagraph" />
429 <xsl:apply-templates />
432 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
434 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
435 <xsl:text>{\LARGE \hypertarget{</xsl:text>
436 <xsl:value-of select="@id" />
437 <xsl:text>}{</xsl:text>
438 <xsl:apply-templates select="meta/title" />
439 <xsl:text>}}</xsl:text>
440 <xsl:value-of select="$newline" />
441 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
442 <xsl:apply-templates select="meta/title" />
443 <xsl:text>}}</xsl:text>
444 <xsl:value-of select="$newparagraph" />
446 <xsl:apply-templates />
449 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
451 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
452 <xsl:text>{\Large \hypertarget{</xsl:text>
453 <xsl:value-of select="@id" />
454 <xsl:text>}{</xsl:text>
455 <xsl:apply-templates select="meta/title" />
456 <xsl:text>}}</xsl:text>
457 <xsl:value-of select="$newparagraph" />
459 <xsl:apply-templates />
462 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
464 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
465 <xsl:text>{\large \hypertarget{</xsl:text>
466 <xsl:value-of select="@id" />
467 <xsl:text>}{</xsl:text>
468 <xsl:apply-templates select="meta/title" />
469 <xsl:text>}}</xsl:text>
470 <xsl:value-of select="$newparagraph" />
472 <xsl:apply-templates />
475 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
477 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
478 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
479 <xsl:value-of select="$newparagraph" />
481 <xsl:text>{\huge \hypertarget{</xsl:text>
482 <xsl:value-of select="@id" />
483 <xsl:text>}{</xsl:text>
484 <xsl:apply-templates select="meta/title" />
485 <xsl:text>}}</xsl:text>
486 <xsl:value-of select="$newline" />
487 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
488 <xsl:apply-templates select="meta/title" />
489 <xsl:text>}}</xsl:text>
490 <xsl:value-of select="$newparagraph" />
492 <xsl:apply-templates />
496 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
498 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section[@class='mainmatter-separate']">
500 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
501 <xsl:text>{\LARGE \hypertarget{</xsl:text>
502 <xsl:value-of select="@id" />
503 <xsl:text>}{</xsl:text>
504 <xsl:apply-templates select="meta/title" />
505 <xsl:text>}}</xsl:text>
506 <xsl:value-of select="$newline" />
507 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
508 <xsl:apply-templates select="meta/title" />
509 <xsl:text>}}</xsl:text>
510 <xsl:value-of select="$newparagraph" />
512 <xsl:apply-templates />
515 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
517 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section/data/section[@class='mainmatter-separate']">
518 <xsl:text>{\Large \hypertarget{</xsl:text>
519 <xsl:value-of select="@id" />
520 <xsl:text>}{</xsl:text>
521 <xsl:apply-templates select="meta/title" />
522 <xsl:text>}}</xsl:text>
523 <xsl:value-of select="$newparagraph" />
525 <xsl:apply-templates />
528 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
530 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
531 <xsl:text>{\large \hypertarget{</xsl:text>
532 <xsl:value-of select="@id" />
533 <xsl:text>}{</xsl:text>
534 <xsl:apply-templates select="meta/title" />
535 <xsl:text>}}</xsl:text>
536 <xsl:value-of select="$newparagraph" />
538 <xsl:apply-templates />
541 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
542 <!-- Glossary sections should be contained in a second level section. -->
544 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary'] | /gamebook/section/data/section/data/section[@class='glossary-separate']">
546 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
547 <xsl:text>{\LARGE \hypertarget{</xsl:text>
548 <xsl:value-of select="@id" />
549 <xsl:text>}{</xsl:text>
550 <xsl:apply-templates select="meta/title" />
551 <xsl:text>}}</xsl:text>
552 <xsl:value-of select="$newparagraph" />
554 <xsl:apply-templates />
557 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
559 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
560 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text> <xsl:value-of select="$newparagraph" />
562 <xsl:if test="position() = 1">
563 <xsl:text>\newcommand{\aonmarks}{
564 \ifthenelse{\equal{\leftmark}{\rightmark}}
566 {\rightmark{} - \leftmark}
567 \ifthenelse{\boolean{@twoside}}%
569 \fancyhead[RO,LE]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
570 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}
572 \fancyhead[R]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
573 \fancyhead[L]{\iffloatpage{}{\thepage}}%
575 }</xsl:text> <xsl:value-of select="$newparagraph" />
578 <xsl:if test="not( self::node()[@id='numbered'] )">
579 <xsl:text>{\huge \hypertarget{</xsl:text>
580 <xsl:value-of select="@id" />
581 <xsl:text>}{</xsl:text>
582 <xsl:apply-templates select="meta/title" />
583 <xsl:text>}}</xsl:text>
584 <xsl:value-of select="$newline" />
586 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
587 <xsl:apply-templates select="meta/title" />
588 <xsl:text>}}</xsl:text>
589 <xsl:value-of select="$newparagraph" />
591 <xsl:apply-templates />
593 <xsl:value-of select="$newparagraph" />
594 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
597 <xsl:template match="/gamebook/section/data/section[@class='numbered']/data/section[@class='numbered']">
598 <xsl:variable name="section-title" select="meta/title[1]" />
600 <xsl:value-of select="$newline" />
601 <xsl:text>\vspace{\parskip} \hypertarget{</xsl:text>
602 <xsl:value-of select="@id" />
603 <xsl:text>}{} \hspace*{\fill} \markboth{</xsl:text>
604 <xsl:value-of select="$section-title" />
605 <xsl:text>}{</xsl:text>
606 <xsl:value-of select="$section-title" />
607 <xsl:text>} {\Large \bfseries </xsl:text>
608 <xsl:value-of select="$section-title" />
609 <xsl:text>} \hspace*{\fill}\\*[\parskip]</xsl:text>
610 <xsl:value-of select="$newline" />
612 <xsl:for-each select="data/illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]">
613 <xsl:text>\hspace*{\fill} \mbox{\itshape \hyperlink{ill</xsl:text>
614 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
616 <xsl:when test="$language='es'">
617 <xsl:text>}{Ilustración </xsl:text>
620 <xsl:text>}{Illustration </xsl:text>
623 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
624 <xsl:text>}}\hspace*{\fill}\\*[\parskip]</xsl:text>
627 <xsl:apply-templates />
631 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
633 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
635 <xsl:text>\clearpage{}</xsl:text>
636 <xsl:value-of select="$newparagraph" />
638 <xsl:text>{\huge \hypertarget{</xsl:text>
639 <xsl:value-of select="@id" />
640 <xsl:text>}{</xsl:text>
641 <xsl:apply-templates select="meta/title" />
642 <xsl:text>}}</xsl:text>
643 <xsl:value-of select="$newline" />
644 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
645 <xsl:apply-templates select="meta/title" />
646 <xsl:text>}}</xsl:text>
647 <xsl:value-of select="$newparagraph" />
649 <xsl:apply-templates />
652 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
654 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
655 <xsl:text>{\LARGE \hypertarget{</xsl:text>
656 <xsl:value-of select="@id" />
657 <xsl:text>}{</xsl:text>
658 <xsl:apply-templates select="meta/title" />
659 <xsl:text>}}</xsl:text>
660 <xsl:value-of select="$newparagraph" />
662 <xsl:apply-templates />
665 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
667 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
668 <xsl:text>{\Large \hypertarget{</xsl:text>
669 <xsl:value-of select="@id" />
670 <xsl:text>}{</xsl:text>
671 <xsl:apply-templates select="meta/title" />
672 <xsl:text>}}</xsl:text>
673 <xsl:value-of select="$newparagraph" />
675 <xsl:apply-templates />
678 <!-- :::::::::::::::::: dedication template ::::::::::::::::::::: -->
680 <xsl:template match="id( 'dedicate' )">
682 <xsl:text>\vspace*{\stretch{1}}</xsl:text>
683 <xsl:value-of select="$newparagraph" />
684 <xsl:text>\begin{center}</xsl:text>
685 <xsl:value-of select="$newline" />
686 <xsl:text>\thispagestyle{empty}</xsl:text>
687 <xsl:value-of select="$newline" />
688 <xsl:text>\itshape </xsl:text>
689 <xsl:apply-templates select="data/p" />
690 <xsl:value-of select="$newline" />
691 <xsl:text>\end{center}</xsl:text>
692 <xsl:value-of select="$newparagraph" />
693 <xsl:text>\vspace*{\stretch{3}}</xsl:text>
694 <xsl:value-of select="$newline" />
696 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
697 <xsl:value-of select="$newline" />
698 <xsl:text>\tableofcontents</xsl:text>
699 <xsl:value-of select="$newline" />
700 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
701 <xsl:value-of select="$newline" />
703 <xsl:text>\setcounter{page}{1}</xsl:text><xsl:value-of select="$newline" />
704 <xsl:text>\pagenumbering{arabic}</xsl:text><xsl:value-of select="$newline" />
708 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
710 <xsl:template match="id( 'map' )">
711 <xsl:variable name="map-title" select="meta/title" />
713 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
714 <xsl:value-of select="$newparagraph" />
716 <xsl:for-each select="data/illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]">
717 <xsl:variable name="illustration-src" select="instance[@class='pdf']/@src" />
719 <xsl:text>\hypertarget{map}{map}</xsl:text>
720 <xsl:value-of select="$newline" />
721 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
722 <xsl:apply-templates select="$map-title" />
723 <xsl:text>}}</xsl:text>
724 <xsl:value-of select="$newparagraph" />
726 <!-- <xsl:value-of select="$newline" />
727 <xsl:text>\begin{figure}[!h]</xsl:text>
728 <xsl:value-of select="$newline" />
729 <xsl:text>\centering</xsl:text>
730 <xsl:value-of select="$newline" />
731 <xsl:text>\thispagestyle{empty}</xsl:text>
732 <xsl:value-of select="$newline" />
733 <xsl:text>\rotatebox{90}{\includegraphics[width=550pt,keepaspectratio]{</xsl:text><xsl:value-of select="$illustration-src" /><xsl:text>}}%</xsl:text>
734 <xsl:value-of select="$newline" />
735 <xsl:text>\end{figure}</xsl:text> -->
737 <xsl:text>\thispagestyle{empty}</xsl:text><xsl:value-of select="$newline" />
738 <xsl:text>\newlength{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
739 <xsl:text>\setlength{\saveunitlength}{\unitlength}</xsl:text><xsl:value-of select="$newline" />
740 <xsl:text>\setlength{\unitlength}{1mm}</xsl:text><xsl:value-of select="$newline" />
741 <xsl:text>\ifthenelse{\boolean{@twoside}}%</xsl:text><xsl:value-of select="$newline" />
742 <xsl:text> {%% Two-sided %%</xsl:text><xsl:value-of select="$newline" />
743 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
744 <xsl:text> \put(-23,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
745 <xsl:text> \end{picture}}%</xsl:text><xsl:value-of select="$newline" />
746 <xsl:text> {%% One-sided %%</xsl:text><xsl:value-of select="$newline" />
747 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
748 <xsl:text> \put(-29,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
749 <xsl:text> \end{picture}}</xsl:text><xsl:value-of select="$newline" />
750 <xsl:text>\setlength{\unitlength}{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
755 <!-- ==================== block elements ======================== -->
757 <xsl:template match="p">
758 <xsl:apply-templates />
759 <xsl:value-of select="$newparagraph" />
762 <xsl:template match="ul">
763 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
764 <xsl:apply-templates />
765 <xsl:text>\end{aonitemize}</xsl:text>
766 <xsl:value-of select="$newparagraph" />
769 <xsl:template match="ul[@class='unbulleted']">
770 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
771 <xsl:apply-templates />
772 <xsl:text>\end{aonitemize}</xsl:text>
773 <xsl:value-of select="$newparagraph" />
776 <xsl:template match="ol">
777 <xsl:text>\begin{enumerate}</xsl:text><xsl:value-of select="$newline" />
778 <xsl:apply-templates />
779 <xsl:text>\end{enumerate}</xsl:text>
780 <xsl:value-of select="$newparagraph" />
783 <xsl:template match="dl">
784 <xsl:apply-templates />
787 <xsl:template match="table">
788 <xsl:text>\begin{tabular}{*{</xsl:text>
789 <xsl:for-each select="tr[1]">
790 <xsl:value-of select="count(descendant::*[not(child::*)])" />
792 <xsl:text>}{l}}</xsl:text>
793 <xsl:value-of select="$newline" />
794 <xsl:apply-templates />
795 <xsl:text>\end{tabular}</xsl:text>
796 <xsl:value-of select="$newparagraph" />
799 <xsl:template match="tr">
800 <xsl:apply-templates />
801 <xsl:text>\\ </xsl:text>
804 <xsl:template match="th">
805 <xsl:text>\multicolumn{</xsl:text>
807 <xsl:when test="@colspan!=0"><xsl:value-of select="@colspan" /></xsl:when>
808 <xsl:otherwise><xsl:text>1</xsl:text></xsl:otherwise>
810 <xsl:text>}{</xsl:text>
812 <xsl:when test="@align='left'"><xsl:text>l}{\bfseries </xsl:text></xsl:when>
813 <xsl:when test="@align='right'"><xsl:text>r}{\bfseries </xsl:text></xsl:when>
814 <xsl:when test="@align='center'"><xsl:text>c}{\bfseries </xsl:text></xsl:when>
815 <xsl:otherwise><xsl:text>l}{\bfseries </xsl:text></xsl:otherwise>
817 <xsl:apply-templates />
818 <xsl:text>} </xsl:text>
819 <xsl:if test="position()!=last()"><xsl:text> & </xsl:text></xsl:if>
822 <xsl:template match="td">
823 <xsl:text>\multicolumn{</xsl:text>
825 <xsl:when test="@colspan!=0"><xsl:value-of select="@colspan" /></xsl:when>
826 <xsl:otherwise><xsl:text>1</xsl:text></xsl:otherwise>
828 <xsl:text>}{</xsl:text>
830 <xsl:when test="@align='left'"><xsl:text>l}{</xsl:text></xsl:when>
831 <xsl:when test="@align='right'"><xsl:text>r}{</xsl:text></xsl:when>
832 <xsl:when test="@align='center'"><xsl:text>c}{</xsl:text></xsl:when>
833 <xsl:otherwise><xsl:text>l}{</xsl:text></xsl:otherwise>
835 <xsl:apply-templates />
836 <xsl:text>} </xsl:text>
837 <xsl:if test="position()!=last()"><xsl:text> & </xsl:text></xsl:if>
840 <xsl:template match="combat">
841 <xsl:text>\begin{aoncombat}</xsl:text>
842 <xsl:apply-templates select="enemy" />
844 <xsl:when test="enemy-attribute[@class='combatskill']">
846 <xsl:when test="$language='es'">
847 <xsl:text>: {\small DESTREZA~EN~EL~COMBATE}~</xsl:text>
850 <xsl:text>: {\small COMBAT~SKILL}~</xsl:text>
853 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
855 <xsl:when test="enemy-attribute[@class='closecombatskill']">
857 <xsl:when test="$language='es'">
858 <xsl:text>: {\small DESTREZA~EN~EL~COMBATE~DE~PROXIMIDAD}~</xsl:text>
861 <xsl:text>: {\small CLOSE~COMBAT~SKILL}~</xsl:text>
864 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
868 <xsl:when test="enemy-attribute[@class='endurance']">
870 <xsl:when test="$language='es'">
871 <xsl:text> ~~{\small RESISTENCIA}~</xsl:text>
874 <xsl:text> ~~{\small ENDURANCE}~</xsl:text>
877 <xsl:value-of select="enemy-attribute[@class='endurance']" />
879 <xsl:when test="enemy-attribute[@class='target']">
881 <xsl:when test="$language='es'">
882 <xsl:text>~(puntos~de~{\small OBJETIVO})~</xsl:text>
885 <xsl:text>~({\small TARGET}~points)~</xsl:text>
888 <xsl:value-of select="enemy-attribute[@class='target']" />
890 <xsl:when test="enemy-attribute[@class='resistance']">
892 <xsl:when test="$language='es'">
893 <xsl:text>~(puntos~de~{\small RESISTENCIA})~</xsl:text>
896 <xsl:text>~({\small RESISTANCE}~points)~</xsl:text>
899 <xsl:value-of select="enemy-attribute[@class='resistance']" />
902 <xsl:text>\end{aoncombat}</xsl:text>
903 <xsl:value-of select="$newparagraph" />
906 <xsl:template match="choice">
907 <xsl:variable name="link">
908 <xsl:value-of select="@idref" />
911 <xsl:text>\nopagebreak\begin{aonchoice}</xsl:text>
912 <xsl:for-each select="* | text()">
914 <xsl:when test="self::link-text">
915 <xsl:text>\hyperlink{</xsl:text>
916 <xsl:value-of select="$link" />
917 <xsl:text>}{\bfseries </xsl:text>
918 <xsl:apply-templates />
919 <xsl:text>}</xsl:text>
922 <xsl:apply-templates select="." />
926 <xsl:text>\end{aonchoice}</xsl:text>
927 <xsl:value-of select="$newparagraph" />
930 <xsl:template match="signpost">
931 <xsl:text>\begin{center}</xsl:text><xsl:apply-templates /><xsl:text>\end{center}</xsl:text>
932 <xsl:value-of select="$newparagraph" />
935 <xsl:template match="blockquote">
936 <xsl:text>\begin{quote}</xsl:text><xsl:apply-templates /><xsl:text>\end{quote}</xsl:text>
937 <xsl:value-of select="$newparagraph" />
940 <xsl:template match="illustration">
942 <xsl:when test="instance[@class='pdf'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
943 <xsl:text>\begin{figure}[</xsl:text>
945 <xsl:when test="@class='inline'">!ht</xsl:when>
946 <xsl:when test="@class='float'">p</xsl:when>
947 <xsl:when test="@class='accent'">bt</xsl:when>
948 <xsl:otherwise><xsl:text>invalid class</xsl:text></xsl:otherwise>
950 <xsl:text>]</xsl:text>
951 <xsl:value-of select="$newline" />
952 <xsl:text>\centering</xsl:text>
953 <xsl:value-of select="$newline" />
954 <xsl:text>\includegraphics</xsl:text>
955 <xsl:if test="@class='float'">
956 <!--<xsl:text>[width=\textwidth,keepaspectratio]</xsl:text>-->
957 <xsl:text>[width=\textwidth,height=570pt,keepaspectratio]</xsl:text>
959 <xsl:text>{</xsl:text>
960 <xsl:value-of select="instance[@class='pdf']/@src" />
961 <xsl:text>} %</xsl:text>
962 <xsl:if test="@class='float'">
963 <xsl:value-of select="$newline" />
964 <xsl:text>\vspace*{\fill}</xsl:text>
965 <xsl:value-of select="$newline" />
966 <xsl:text>\\ \mbox{ \hypertarget{ill</xsl:text>
967 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
969 <xsl:when test="$language='es'">
970 <xsl:text>}{Ilustración </xsl:text>
973 <xsl:text>}{Illustration </xsl:text>
976 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
977 <xsl:text>}}\\[1em]{\itshape </xsl:text>
978 <xsl:apply-templates select="meta/description" />
979 <xsl:text>}</xsl:text>
981 <xsl:value-of select="$newline" />
982 <xsl:text>\end{figure}</xsl:text>
983 <xsl:value-of select="$newline" />
986 <xsl:when test="instance[@class='tex'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
987 <xsl:value-of select="$newline" />
988 <xsl:text>\begin{figure}[!h]</xsl:text>
989 <xsl:value-of select="$newline" />
990 <xsl:text>\centering</xsl:text>
991 <xsl:value-of select="$newline" />
992 <xsl:text>\input{</xsl:text><xsl:value-of select="instance[@class='tex']/@src" /><xsl:text>}</xsl:text>
993 <xsl:value-of select="$newline" />
994 <xsl:text>\end{figure}</xsl:text>
995 <xsl:value-of select="$newline" />
997 <xsl:text>\clearpage{}</xsl:text>
998 <xsl:value-of select="$newparagraph" />
1006 <xsl:template match="instance" />
1008 <xsl:template match="footnotes" />
1010 <xsl:template match="footnote">
1011 <xsl:apply-templates />
1014 <xsl:template match="hr">
1015 <xsl:text>\rule{\textwidth}{0.4pt}</xsl:text>
1016 <xsl:value-of select="$newline" />
1019 <xsl:template match="dt">
1020 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}\\*\\*</xsl:text>
1021 <xsl:value-of select="$newline" />
1024 <xsl:template match="dd">
1025 <xsl:apply-templates />
1026 <xsl:value-of select="$newparagraph" />
1029 <xsl:template match="li">
1030 <xsl:text>\item </xsl:text><xsl:apply-templates />
1031 <xsl:value-of select="$newline" />
1034 <!-- ==================== inline elements ======================= -->
1036 <xsl:template match="a">
1037 <xsl:if test="@idref">
1038 <xsl:text>\hyperlink{</xsl:text>
1039 <xsl:value-of select="@idref" />
1040 <xsl:text>}{</xsl:text>
1043 <xsl:text>\hypertarget{</xsl:text>
1044 <xsl:value-of select="@id" />
1045 <xsl:text>}{</xsl:text>
1048 <xsl:apply-templates />
1050 <xsl:if test="@idref">
1051 <xsl:text>}</xsl:text>
1054 <xsl:text>}</xsl:text>
1058 <xsl:template match="a[@class='footnote']">
1059 <xsl:apply-templates />
1060 <xsl:text>\footnote{</xsl:text>
1061 <xsl:for-each select="id( @idref )">
1062 <xsl:apply-templates />
1064 <xsl:text>}</xsl:text>
1067 <xsl:template match="em">
1068 <xsl:text>\emph{</xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1071 <xsl:template match="strong">
1072 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1075 <xsl:template match="cite">
1076 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1079 <xsl:template match="thought">
1080 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1083 <xsl:template match="onomatopoeia">
1084 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1087 <xsl:template match="spell">
1088 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1091 <xsl:template match="item">
1092 <xsl:apply-templates />
1095 <xsl:template match="foreign">
1096 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1099 <xsl:template match="quote">
1100 <xsl:text>&lsquot;</xsl:text>
1101 <xsl:apply-templates />
1102 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rsquot;</xsl:text></xsl:if>
1105 <xsl:template match="quote//quote">
1106 <xsl:text>&ldquot;</xsl:text>
1107 <xsl:apply-templates />
1108 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rdquot;</xsl:text></xsl:if>
1111 <xsl:template match="code">
1112 <xsl:text>{\ttfamily </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1115 <xsl:template match="line">
1116 <xsl:apply-templates />
1117 <xsl:if test="position( ) != last( )">\\</xsl:if>
1120 <xsl:template match="br">
1121 <xsl:text>\\</xsl:text>
1124 <xsl:template match="typ[@class='attribute']">
1125 <xsl:text>{\small </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1128 <xsl:template match="footnote//typ[@class='attribute']">
1129 <xsl:text>{\scriptsize </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1133 <!-- ==================== character elements ==================== -->
1136 These templates define the mapping between the character elements used in
1137 the Project Aon instances of Gamebook XML and the ISO-8859-1
1140 Portions Copyright International Organization for Standardization 1986
1141 Permission to copy in any form is granted for use with conforming SGML
1142 systems and applications as defined in ISO 8879, provided this notice
1143 is included in all copies.
1147 <!-- JFS: TODO - probably the \definitions need to be in {} to prevent
1148 issues if followed by text -->
1150 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1152 <xsl:template match="ch.apos"><xsl:text>'</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
1153 <xsl:template match="ch.nbsp"><xsl:text>~</xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
1154 <xsl:template match="ch.iexcl"><xsl:text>{\textexclamdown}</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
1155 <xsl:template match="ch.cent"><xsl:text>\textcent</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
1156 <xsl:template match="ch.pound"><xsl:text>\pounds</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
1157 <xsl:template match="ch.curren"><xsl:text>\textcurrency</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
1158 <xsl:template match="ch.yen"><xsl:text>\textyen</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
1159 <xsl:template match="ch.brvbar"><xsl:text>\textbar</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
1160 <xsl:template match="ch.sect"><xsl:text>\textsection</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
1161 <xsl:template match="ch.uml"><xsl:text>\ddot{}</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
1162 <xsl:template match="ch.copy"><xsl:text>{\copyright}</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
1163 <xsl:template match="ch.ordf"><xsl:text>\textordfeminine</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
1164 <xsl:template match="ch.laquo"><xsl:text>{\guillemotleft}</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
1165 <xsl:template match="ch.not"><xsl:text>\textlnot</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
1166 <xsl:template match="ch.shy"><xsl:text>\-</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
1167 <xsl:template match="ch.reg"><xsl:text>{\texttrademark}</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
1168 <xsl:template match="ch.macr"><xsl:text>\textasciimacron</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
1169 <xsl:template match="ch.deg"><xsl:text>\textdegree</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
1170 <xsl:template match="ch.plusmn"><xsl:text>\textpm</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
1171 <xsl:template match="ch.sup2"><xsl:text>^2</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
1172 <xsl:template match="ch.sup3"><xsl:text>^3</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
1173 <xsl:template match="ch.acute"><xsl:text>\'</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
1174 <xsl:template match="ch.micro"><xsl:text>\textmu</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
1175 <xsl:template match="ch.para"><xsl:text>\textparagraph</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
1176 <xsl:template match="ch.middot"><xsl:text>\textperiodcentered</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
1177 <xsl:template match="ch.cedil"><xsl:text>\c{c}</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
1178 <xsl:template match="ch.sup1"><xsl:text>^1</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
1179 <xsl:template match="ch.ordm"><xsl:text>\textordmasculine</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
1180 <xsl:template match="ch.raquo"><xsl:text>{\guillemotright}</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
1181 <xsl:template match="ch.frac14"><xsl:text>$\frac{1}{4}$</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
1182 <xsl:template match="ch.frac12"><xsl:text>$\frac{1}{2}$</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
1183 <xsl:template match="ch.frac34"><xsl:text>$\frac{3}{4}$</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
1184 <xsl:template match="ch.frac13"><xsl:text>$\frac{1}{3}$</xsl:text></xsl:template><!-- vulgar fraction 1/3, U+2153 ISOnum -->
1185 <xsl:template match="ch.frac23"><xsl:text>$\frac{2}{3}$</xsl:text></xsl:template><!-- vulgar fraction 2/3, U+2154 ISOnum -->
1186 <xsl:template match="ch.frac15"><xsl:text>$\frac{1}{5}$</xsl:text></xsl:template><!-- vulgar fraction 1/5, U+2155 ISOnum -->
1187 <xsl:template match="ch.frac25"><xsl:text>$\frac{2}{5}$</xsl:text></xsl:template><!-- vulgar fraction 2/5, U+2156 ISOnum -->
1188 <xsl:template match="ch.frac35"><xsl:text>$\frac{3}{5}$</xsl:text></xsl:template><!-- vulgar fraction 3/5, U+2157 ISOnum -->
1189 <xsl:template match="ch.frac45"><xsl:text>$\frac{4}{5}$</xsl:text></xsl:template><!-- vulgar fraction 4/5, U+2158 ISOnum -->
1190 <xsl:template match="ch.frac16"><xsl:text>$\frac{1}{6}$</xsl:text></xsl:template><!-- vulgar fraction 1/6, U+2159 ISOnum -->
1191 <xsl:template match="ch.frac56"><xsl:text>$\frac{5}{6}$</xsl:text></xsl:template><!-- vulgar fraction 5/6, U+215A ISOnum -->
1192 <xsl:template match="ch.frac17"><xsl:text>$\frac{1}{7}$</xsl:text></xsl:template><!-- vulgar fraction 1/7, U+2150 ISOnum -->
1193 <xsl:template match="ch.frac18"><xsl:text>$\frac{1}{8}$</xsl:text></xsl:template><!-- vulgar fraction 1/8, U+215B ISOnum -->
1194 <xsl:template match="ch.frac38"><xsl:text>$\frac{3}{8}$</xsl:text></xsl:template><!-- vulgar fraction 3/8, U+215C ISOnum -->
1195 <xsl:template match="ch.frac58"><xsl:text>$\frac{5}{8}$</xsl:text></xsl:template><!-- vulgar fraction 5/8, U+215D ISOnum -->
1196 <xsl:template match="ch.frac78"><xsl:text>$\frac{7}{8}$</xsl:text></xsl:template><!-- vulgar fraction 7/8, U+215E ISOnum -->
1197 <xsl:template match="ch.frac19"><xsl:text>$\frac{1}{9}$</xsl:text></xsl:template><!-- vulgar fraction 1/9, U+2151 ISOnum -->
1198 <xsl:template match="ch.frac110"><xsl:text>$\frac{1}{10}$</xsl:text></xsl:template><!-- vulgar fraction 1/10, U+2152 ISO num -->
1199 <xsl:template match="ch.iquest"><xsl:text>{\textquestiondown}</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
1200 <xsl:template match="ch.Agrave"><xsl:text>À</xsl:text></xsl:template><!-- latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 -->
1201 <xsl:template match="ch.Aacute"><xsl:text>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
1202 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
1203 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
1204 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
1205 <xsl:template match="ch.Aring"><xsl:text>Å</xsl:text></xsl:template><!-- latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 -->
1206 <xsl:template match="ch.AElig"><xsl:text>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
1207 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
1208 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
1209 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
1210 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
1211 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
1212 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
1213 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
1214 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
1215 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
1216 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
1217 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
1218 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
1219 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
1220 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
1221 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
1222 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
1223 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
1224 <xsl:template match="ch.Oslash"><xsl:text>Ø</xsl:text></xsl:template><!-- latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1 -->
1225 <xsl:template match="ch.Ugrave"><xsl:text>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
1226 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
1227 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
1228 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
1229 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
1230 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
1231 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
1232 <xsl:template match="ch.agrave"><xsl:text>à</xsl:text></xsl:template><!-- latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 -->
1233 <xsl:template match="ch.aacute"><xsl:text>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
1234 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
1235 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
1236 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
1237 <xsl:template match="ch.aring"><xsl:text>å</xsl:text></xsl:template><!-- latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 -->
1238 <xsl:template match="ch.aelig"><xsl:text>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
1239 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
1240 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
1241 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
1242 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
1243 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
1244 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
1245 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
1246 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
1247 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
1248 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
1249 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
1250 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
1251 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
1252 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
1253 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
1254 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
1255 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
1256 <xsl:template match="ch.oslash"><xsl:text>ø</xsl:text></xsl:template><!-- latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 -->
1257 <xsl:template match="ch.ugrave"><xsl:text>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
1258 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
1259 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
1260 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
1261 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
1262 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
1263 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
1265 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1267 <xsl:template match="ch.ampersand">\&</xsl:template><!-- ampersand -->
1268 <xsl:template match="ch.lsquot">\textquoteleft </xsl:template><!-- opening left quotation mark -->
1269 <xsl:template match="ch.rsquot">\textquoteright </xsl:template><!-- closing right quotation mark -->
1270 <xsl:template match="ch.ldquot">``</xsl:template><!-- opening left double quotation mark -->
1271 <xsl:template match="ch.rdquot">''</xsl:template><!-- closing right double quotation mark -->
1272 <xsl:template match="ch.minus">$-$</xsl:template><!-- mathematical minus -->
1273 <xsl:template match="ch.endash">--</xsl:template><!-- endash -->
1274 <xsl:template match="ch.emdash">---</xsl:template><!-- emdash -->
1275 <xsl:template match="ch.ellips"> ~\ldots </xsl:template><!-- ellipsis -->
1276 <xsl:template match="ch.lellips">\ldots ~</xsl:template><!-- left ellipsis, used at the beginning of edited material -->
1277 <xsl:template match="ch.blankline">\_\_\_\_\_\_\_</xsl:template><!-- blank line to be filled in -->
1278 <xsl:template match="ch.percent"><xsl:text>\%</xsl:text></xsl:template><!-- percent sign -->
1279 <xsl:template match="ch.thinspace"><xsl:text>\ </xsl:text></xsl:template><!-- small horizontal space for use between adjacent quotation marks - added mainly for LaTeX's sake -->
1280 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1281 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1283 <!-- ==================== named templates ======================= -->
1286 A "subroutine" to generate a link to the current section, with the section title (expanded with "Section " in case of a numbered section) as link text.
1288 <xsl:template name="section-title-link">
1289 <!-- will the list always contain the closest ancestor first? -->
1290 <xsl:variable name="section-title">
1291 <!-- numbered or not? -->
1292 <xsl:if test="ancestor::section[position()=1]/@class='numbered'">
1294 <xsl:when test="$language='es'">
1295 <xsl:text>Sección </xsl:text>
1298 <xsl:text>Section </xsl:text>
1302 <xsl:apply-templates select="ancestor::section[position()=1]/meta/title[1]" />
1306 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:attribute>
1307 <xsl:value-of select="$section-title" />