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" />
13 <xsl:preserve-space elements="p choice" />
18 Revision 1.3 2006/04/04 22:02:14 cvsuser
19 Fix two bugs (one } too much and a missing line break)
21 Revision 1.2 2005/04/09 19:51:50 angantyr
22 Added handling of open-ended quotes.
24 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
25 Initial freepository revision of XML support documents.
27 Revision 1.3 2002/10/30 06:33:22 jblake
28 Added capability to filter which illustrators' work is included in the output.
30 Revision 1.2 2002/10/20 06:29:58 jblake
31 Added support for CLOSE COMBAT SKILL from the Freeway Warrior books.
33 Revision 1.1 2002/10/15 23:30:23 jblake
42 The implementation of tables is incomplete and kludgy.
46 <!-- ====================== parameters ========================== -->
48 <xsl:param name="title-color"><xsl:text>0.0,0.0,0.0</xsl:text></xsl:param>
49 <xsl:param name="use-illustrators" />
50 <xsl:param name="language"><xsl:text>en</xsl:text></xsl:param>
52 <!-- ======================= variables ========================== -->
54 <xsl:variable name="newline">
59 <xsl:variable name="newparagraph">
60 <xsl:value-of select="$newline" />
61 <xsl:value-of select="$newline" />
64 <!-- ======================== Templates ========================= -->
66 <!-- ================= hierarchical sections ==================== -->
68 <xsl:template match="meta" />
70 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
72 <xsl:template match="/gamebook/section[@id='title']">
75 <xsl:when test="$language='es'">
78 %\documentclass[letterpaper,12pt,twoside]{book}
80 \documentclass[a4paper,12pt,twoside]{book}
86 \documentclass[letterpaper,12pt,twoside]{book}
88 %\documentclass[a4paper,12pt,twoside]{book}
95 %\documentclass[letterpaper,12pt,oneside]{book}
96 %\documentclass[a4paper,12pt,oneside]{book}
98 \usepackage[pdftex]{graphicx}
102 <xsl:when test="$language='es'">
104 % Use this if you are compiling spanish PDFs:
105 \usepackage[spanish]{babel}
112 \definecolor{titlecolor}{rgb}{</xsl:text><xsl:value-of select="$title-color" /><xsl:text>}
113 \definecolor{lightgray}{gray}{0.75}
115 %% headers and footers %%
116 \usepackage{fancyhdr}
118 \renewcommand{\chaptermark}[1]{}
119 \renewcommand{\sectionmark}[1]{}
122 \ifthenelse{\boolean{@twoside}}%
124 \fancyhead[CO]{\iffloatpage{}{</xsl:text><xsl:value-of select="/gamebook/meta/creator[@class='short']" /><xsl:text>}}
125 \fancyhead[CE]{\iffloatpage{}{\bfseries </xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>}}
126 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}
128 \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>}}}
129 \fancyhead[R]{\iffloatpage{}{\thepage}}}
130 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
132 \fancypagestyle{plain}{
134 \renewcommand{\headrulewidth}{0pt}
137 \fancypagestyle{empty}{
139 \renewcommand{\headrulewidth}{0pt}
142 %% hyper-references %%
143 \usepackage[pdftex,colorlinks=true,linkcolor=black,bookmarks=false]{hyperref}
145 %% custom style info %%
146 \setlength{\parindent}{0pt}
147 \setlength{\parskip}{1em}
148 \setlength{\headheight}{18pt}
149 \addtolength{\headwidth}{\marginparwidth}
150 \addtolength{\headwidth}{\marginparsep}
151 \setlength{\textheight}{44\baselineskip}
152 \ifthenelse{\lengthtest{\paperwidth = 210mm}}%
153 {%% if A4 (210.0 mm x 297.0 mm)
154 \addtolength{\topmargin}{-1\baselineskip}}%
155 {%% else if letter (8.5" x 11" == 215.9 mm x 279.4 mm)
156 \addtolength{\topmargin}{-2.5\baselineskip}}
159 \usepackage[T1]{fontenc}
160 % NOTE: This font might not ve available. Uncomment if you have it configured
161 % for your LaTeX fonts:
162 %\usepackage{souvenir}
163 %\renewcommand{\rmdefault}{souvnrttf}
167 %% new environments %%
168 \newenvironment{aonchoice}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
169 \newenvironment{aoncombat}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
170 \newenvironment{aonitemize}{\begin{list}{}{\setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
171 \newenvironment{aonordereditemize}{\begin{list}{\arabic{aoncounter}.}{\usecounter{aoncounter} \setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
172 \newcounter{aoncounter}
174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 \vspace*{\stretch{0.7}}
181 \Huge{\textcolor{titlecolor}{\textbf{</xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>}}} \vspace{-0.8em}\\
183 \vspace*{\stretch{1}}
184 \normalsize{</xsl:text><xsl:apply-templates select="/gamebook/meta/creator[@class='medium']" /><xsl:text>}
186 \vspace*{\stretch{1.3}}
192 \vspace*{\stretch{1}}
195 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
198 <xsl:when test="$language='es'">
199 <xsl:text>Fecha de Publicación: </xsl:text>
202 <xsl:text>Publication Date: </xsl:text>
205 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
206 <xsl:text> </xsl:text>
208 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
210 <xsl:when test="$language='es'"><xsl:text>de enero de</xsl:text></xsl:when>
211 <xsl:otherwise><xsl:text>January</xsl:text></xsl:otherwise>
214 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
216 <xsl:when test="$language='es'"><xsl:text>de febrero de</xsl:text></xsl:when>
217 <xsl:otherwise><xsl:text>February</xsl:text></xsl:otherwise>
220 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
222 <xsl:when test="$language='es'"><xsl:text>de marzo de</xsl:text></xsl:when>
223 <xsl:otherwise><xsl:text>March</xsl:text></xsl:otherwise>
226 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
228 <xsl:when test="$language='es'"><xsl:text>de abril de</xsl:text></xsl:when>
229 <xsl:otherwise><xsl:text>April</xsl:text></xsl:otherwise>
232 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
234 <xsl:when test="$language='es'"><xsl:text>de mayo de</xsl:text></xsl:when>
235 <xsl:otherwise><xsl:text>May</xsl:text></xsl:otherwise>
238 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
240 <xsl:when test="$language='es'"><xsl:text>de junio de</xsl:text></xsl:when>
241 <xsl:otherwise><xsl:text>June</xsl:text></xsl:otherwise>
244 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
246 <xsl:when test="$language='es'"><xsl:text>de julio de</xsl:text></xsl:when>
247 <xsl:otherwise><xsl:text>July</xsl:text></xsl:otherwise>
250 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
252 <xsl:when test="$language='es'"><xsl:text>de agosto de</xsl:text></xsl:when>
253 <xsl:otherwise><xsl:text>August</xsl:text></xsl:otherwise>
256 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
258 <xsl:when test="$language='es'"><xsl:text>de septiembre de</xsl:text></xsl:when>
259 <xsl:otherwise><xsl:text>September</xsl:text></xsl:otherwise>
262 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
264 <xsl:when test="$language='es'"><xsl:text>de octubre de</xsl:text></xsl:when>
265 <xsl:otherwise><xsl:text>October</xsl:text></xsl:otherwise>
268 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
270 <xsl:when test="$language='es'"><xsl:text>de noviembre de</xsl:text></xsl:when>
271 <xsl:otherwise><xsl:text>November</xsl:text></xsl:otherwise>
274 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
276 <xsl:when test="$language='es'"><xsl:text>de diciembre de</xsl:text></xsl:when>
277 <xsl:otherwise><xsl:text>December</xsl:text></xsl:otherwise>
281 <xsl:text>Invalid Month</xsl:text>
284 <xsl:text> </xsl:text>
285 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
289 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
292 \vspace*{\stretch{3}}
298 \clearpage{\pagestyle{empty}\cleardoublepage}
300 \vspace*{\stretch{1}}
302 \thispagestyle{empty}
304 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
305 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
308 \vspace*{\stretch{3}}
310 \clearpage{\pagestyle{empty}\cleardoublepage}
317 <xsl:apply-templates select="data/section[@class='frontmatter']" />
323 <xsl:if test="data/section[@class='mainmatter']">
324 <xsl:text>\begin{mainmatter}
328 <xsl:apply-templates select="data/section[@class='mainmatter']" />
335 <xsl:if test="data/section[@class='numbered']">
336 <xsl:apply-templates select="data/section[@class='numbered']" />
341 \ifthenelse{\boolean{@twoside}}%
347 \setcounter{topnumber}{6}
348 \renewcommand{\topfraction}{1}
349 \renewcommand{\textfraction}{0}
350 \setlength{\floatsep}{10pt}
353 <xsl:apply-templates select="data/section[@class='backmatter']" />
363 <xsl:template match="/gamebook/section[@id='toc']" />
365 <xsl:template match="section" />
367 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
369 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
371 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
372 <xsl:value-of select="$newparagraph" />
374 <xsl:text>{\huge \hypertarget{</xsl:text>
375 <xsl:value-of select="@id" />
376 <xsl:text>}{</xsl:text>
377 <xsl:value-of select="meta/title" />
378 <xsl:text>}}</xsl:text>
379 <xsl:value-of select="$newline" />
380 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
381 <xsl:value-of select="meta/title" />
382 <xsl:text>}}</xsl:text>
383 <xsl:value-of select="$newparagraph" />
385 <xsl:apply-templates />
389 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
391 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
393 <xsl:text>{\LARGE \hypertarget{</xsl:text>
394 <xsl:value-of select="@id" />
395 <xsl:text>}{</xsl:text>
396 <xsl:value-of select="meta/title" />
397 <xsl:text>}}</xsl:text>
398 <xsl:value-of select="$newparagraph" />
400 <xsl:apply-templates />
403 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
405 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
406 <xsl:text>{\LARGE \hypertarget{</xsl:text>
407 <xsl:value-of select="@id" />
408 <xsl:text>}{</xsl:text>
409 <xsl:value-of select="meta/title" />
410 <xsl:text>}}</xsl:text>
411 <xsl:value-of select="$newline" />
412 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
413 <xsl:value-of select="meta/title" />
414 <xsl:text>}}</xsl:text>
415 <xsl:value-of select="$newparagraph" />
417 <xsl:apply-templates />
420 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
422 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
423 <xsl:text>{\Large \hypertarget{</xsl:text>
424 <xsl:value-of select="@id" />
425 <xsl:text>}{</xsl:text>
426 <xsl:value-of select="meta/title" />
427 <xsl:text>}}</xsl:text>
428 <xsl:value-of select="$newparagraph" />
430 <xsl:apply-templates />
433 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
435 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
436 <xsl:text>{\large \hypertarget{</xsl:text>
437 <xsl:value-of select="@id" />
438 <xsl:text>}{</xsl:text>
439 <xsl:value-of select="meta/title" />
440 <xsl:text>}}</xsl:text>
441 <xsl:value-of select="$newparagraph" />
443 <xsl:apply-templates />
446 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
448 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
449 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
450 <xsl:value-of select="$newparagraph" />
452 <xsl:text>{\huge \hypertarget{</xsl:text>
453 <xsl:value-of select="@id" />
454 <xsl:text>}{</xsl:text>
455 <xsl:value-of select="meta/title" />
456 <xsl:text>}}</xsl:text>
457 <xsl:value-of select="$newline" />
458 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
459 <xsl:value-of select="meta/title" />
460 <xsl:text>}}</xsl:text>
461 <xsl:value-of select="$newparagraph" />
463 <xsl:apply-templates />
467 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
469 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section[@class='mainmatter-separate']">
471 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
472 <xsl:text>{\LARGE \hypertarget{</xsl:text>
473 <xsl:value-of select="@id" />
474 <xsl:text>}{</xsl:text>
475 <xsl:value-of select="meta/title" />
476 <xsl:text>}}</xsl:text>
477 <xsl:value-of select="$newline" />
478 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
479 <xsl:value-of select="meta/title" />
480 <xsl:text>}}</xsl:text>
481 <xsl:value-of select="$newparagraph" />
483 <xsl:apply-templates />
486 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
488 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section/data/section[@class='mainmatter-separate']">
489 <xsl:text>{\Large \hypertarget{</xsl:text>
490 <xsl:value-of select="@id" />
491 <xsl:text>}{</xsl:text>
492 <xsl:value-of select="meta/title" />
493 <xsl:text>}}</xsl:text>
494 <xsl:value-of select="$newparagraph" />
496 <xsl:apply-templates />
499 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
501 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
502 <xsl:text>{\large \hypertarget{</xsl:text>
503 <xsl:value-of select="@id" />
504 <xsl:text>}{</xsl:text>
505 <xsl:value-of select="meta/title" />
506 <xsl:text>}}</xsl:text>
507 <xsl:value-of select="$newparagraph" />
509 <xsl:apply-templates />
512 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
513 <!-- Glossary sections should be contained in a second level section. -->
515 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary'] | /gamebook/section/data/section/data/section[@class='glossary-separate']">
517 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
518 <xsl:text>{\LARGE \hypertarget{</xsl:text>
519 <xsl:value-of select="@id" />
520 <xsl:text>}{</xsl:text>
521 <xsl:value-of select="meta/title" />
522 <xsl:text>}}</xsl:text>
523 <xsl:value-of select="$newparagraph" />
525 <xsl:apply-templates />
528 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
530 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
531 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text> <xsl:value-of select="$newparagraph" />
533 <xsl:if test="position() = 1">
534 <xsl:text>\newcommand{\aonmarks}{
535 \ifthenelse{\equal{\leftmark}{\rightmark}}
537 {\rightmark{} - \leftmark}
538 \ifthenelse{\boolean{@twoside}}%
540 \fancyhead[RO,LE]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
541 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}
543 \fancyhead[R]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
544 \fancyhead[L]{\iffloatpage{}{\thepage}}%
546 }</xsl:text> <xsl:value-of select="$newparagraph" />
549 <xsl:if test="not( self::node()[@id='numbered'] )">
550 <xsl:text>{\huge \hypertarget{</xsl:text>
551 <xsl:value-of select="@id" />
552 <xsl:text>}{</xsl:text>
553 <xsl:value-of select="meta/title" />
554 <xsl:text>}}</xsl:text>
555 <xsl:value-of select="$newline" />
557 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
558 <xsl:value-of select="meta/title" />
559 <xsl:text>}}</xsl:text>
560 <xsl:value-of select="$newparagraph" />
562 <xsl:apply-templates />
564 <xsl:value-of select="$newparagraph" />
565 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
568 <xsl:template match="/gamebook/section/data/section[@class='numbered']/data/section[@class='numbered']">
569 <xsl:variable name="section-title" select="meta/title[1]" />
571 <xsl:value-of select="$newline" />
572 <xsl:text>\vspace{\parskip} \hypertarget{</xsl:text>
573 <xsl:value-of select="@id" />
574 <xsl:text>}{} \hspace*{\fill} \markboth{</xsl:text>
575 <xsl:value-of select="$section-title" />
576 <xsl:text>}{</xsl:text>
577 <xsl:value-of select="$section-title" />
578 <xsl:text>} {\Large \bfseries </xsl:text>
579 <xsl:value-of select="$section-title" />
580 <xsl:text>} \hspace*{\fill}\\*[\parskip]</xsl:text>
581 <xsl:value-of select="$newline" />
583 <xsl:for-each select="data/illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]">
584 <xsl:text>\hspace*{\fill} \mbox{\itshape \hyperlink{ill</xsl:text>
585 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
587 <xsl:when test="$language='es'">
588 <xsl:text>}{Ilustración </xsl:text>
591 <xsl:text>}{Illustration </xsl:text>
594 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
595 <xsl:text>}}\hspace*{\fill}\\*[\parskip]</xsl:text>
598 <xsl:apply-templates />
602 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
604 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
606 <xsl:text>\clearpage{}</xsl:text>
607 <xsl:value-of select="$newparagraph" />
609 <xsl:text>{\huge \hypertarget{</xsl:text>
610 <xsl:value-of select="@id" />
611 <xsl:text>}{</xsl:text>
612 <xsl:value-of select="meta/title" />
613 <xsl:text>}}</xsl:text>
614 <xsl:value-of select="$newline" />
615 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
616 <xsl:value-of select="meta/title" />
617 <xsl:text>}}</xsl:text>
618 <xsl:value-of select="$newparagraph" />
620 <xsl:apply-templates />
623 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
625 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
626 <xsl:text>{\LARGE \hypertarget{</xsl:text>
627 <xsl:value-of select="@id" />
628 <xsl:text>}{</xsl:text>
629 <xsl:value-of select="meta/title" />
630 <xsl:text>}}</xsl:text>
631 <xsl:value-of select="$newparagraph" />
633 <xsl:apply-templates />
636 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
638 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
639 <xsl:text>{\Large \hypertarget{</xsl:text>
640 <xsl:value-of select="@id" />
641 <xsl:text>}{</xsl:text>
642 <xsl:value-of select="meta/title" />
643 <xsl:text>}}</xsl:text>
644 <xsl:value-of select="$newparagraph" />
646 <xsl:apply-templates />
649 <!-- :::::::::::::::::: dedication template ::::::::::::::::::::: -->
651 <xsl:template match="id( 'dedicate' )">
653 <xsl:text>\vspace*{\stretch{1}}</xsl:text>
654 <xsl:value-of select="$newparagraph" />
655 <xsl:text>\begin{center}</xsl:text>
656 <xsl:value-of select="$newline" />
657 <xsl:text>\thispagestyle{empty}</xsl:text>
658 <xsl:value-of select="$newline" />
659 <xsl:text>\itshape </xsl:text>
660 <xsl:apply-templates select="data/p" />
661 <xsl:value-of select="$newline" />
662 <xsl:text>\end{center}</xsl:text>
663 <xsl:value-of select="$newparagraph" />
664 <xsl:text>\vspace*{\stretch{3}}</xsl:text>
665 <xsl:value-of select="$newline" />
667 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
668 <xsl:value-of select="$newline" />
669 <xsl:text>\tableofcontents</xsl:text>
670 <xsl:value-of select="$newline" />
671 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
672 <xsl:value-of select="$newline" />
674 <xsl:text>\setcounter{page}{1}</xsl:text><xsl:value-of select="$newline" />
675 <xsl:text>\pagenumbering{arabic}</xsl:text><xsl:value-of select="$newline" />
679 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
681 <xsl:template match="id( 'map' )">
682 <xsl:variable name="map-title" select="meta/title" />
684 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
685 <xsl:value-of select="$newparagraph" />
687 <xsl:for-each select="data/illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]">
688 <xsl:variable name="illustration-src" select="instance[@class='pdf']/@src" />
690 <xsl:text>\hypertarget{map}{map}</xsl:text>
691 <xsl:value-of select="$newline" />
692 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
693 <xsl:value-of select="$map-title" />
694 <xsl:text>}}</xsl:text>
695 <xsl:value-of select="$newparagraph" />
697 <!-- <xsl:value-of select="$newline" />
698 <xsl:text>\begin{figure}[!h]</xsl:text>
699 <xsl:value-of select="$newline" />
700 <xsl:text>\centering</xsl:text>
701 <xsl:value-of select="$newline" />
702 <xsl:text>\thispagestyle{empty}</xsl:text>
703 <xsl:value-of select="$newline" />
704 <xsl:text>\rotatebox{90}{\includegraphics[width=550pt,keepaspectratio]{</xsl:text><xsl:value-of select="$illustration-src" /><xsl:text>}}%</xsl:text>
705 <xsl:value-of select="$newline" />
706 <xsl:text>\end{figure}</xsl:text> -->
708 <xsl:text>\thispagestyle{empty}</xsl:text><xsl:value-of select="$newline" />
709 <xsl:text>\newlength{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
710 <xsl:text>\setlength{\saveunitlength}{\unitlength}</xsl:text><xsl:value-of select="$newline" />
711 <xsl:text>\setlength{\unitlength}{1mm}</xsl:text><xsl:value-of select="$newline" />
712 <xsl:text>\ifthenelse{\boolean{@twoside}}%</xsl:text><xsl:value-of select="$newline" />
713 <xsl:text> {%% Two-sided %%</xsl:text><xsl:value-of select="$newline" />
714 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
715 <xsl:text> \put(-23,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
716 <xsl:text> \end{picture}}%</xsl:text><xsl:value-of select="$newline" />
717 <xsl:text> {%% One-sided %%</xsl:text><xsl:value-of select="$newline" />
718 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
719 <xsl:text> \put(-29,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
720 <xsl:text> \end{picture}}</xsl:text><xsl:value-of select="$newline" />
721 <xsl:text>\setlength{\unitlength}{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
726 <!-- ==================== block elements ======================== -->
728 <xsl:template match="p">
729 <xsl:apply-templates />
730 <xsl:value-of select="$newparagraph" />
733 <xsl:template match="ul">
734 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
735 <xsl:apply-templates />
736 <xsl:text>\end{aonitemize}</xsl:text>
737 <xsl:value-of select="$newparagraph" />
740 <xsl:template match="ul[@class='unbulleted']">
741 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
742 <xsl:apply-templates />
743 <xsl:text>\end{aonitemize}</xsl:text>
744 <xsl:value-of select="$newparagraph" />
747 <xsl:template match="ol">
748 <xsl:text>\begin{enumerate}</xsl:text><xsl:value-of select="$newline" />
749 <xsl:apply-templates />
750 <xsl:text>\end{enumerate}</xsl:text>
751 <xsl:value-of select="$newparagraph" />
754 <xsl:template match="dl">
755 <xsl:apply-templates />
758 <xsl:template match="table">
759 <xsl:text>\begin{tabular}{*{</xsl:text>
760 <xsl:for-each select="tr[1]">
761 <xsl:for-each select="th[1]">
762 <xsl:number count="th" />
765 <xsl:text>}{l}}</xsl:text>
766 <xsl:value-of select="$newline" />
767 <xsl:apply-templates />
768 <xsl:text>\end{tabular}</xsl:text>
769 <xsl:value-of select="$newparagraph" />
772 <xsl:template match="tr">
773 <xsl:apply-templates />
774 <xsl:text> \\</xsl:text>
777 <xsl:template match="th">
778 <xsl:text>\multicolumn{1}{</xsl:text>
780 <xsl:when test="@align='left'"><xsl:text>l}{\bfseries </xsl:text></xsl:when>
781 <xsl:when test="@align='right'"><xsl:text>r}{\bfseries </xsl:text></xsl:when>
782 <xsl:when test="@align='center'"><xsl:text>c}{\bfseries </xsl:text></xsl:when>
783 <xsl:otherwise><xsl:text>l}{\bfseries </xsl:text></xsl:otherwise>
785 <xsl:apply-templates />
786 <xsl:text>} </xsl:text>
787 <xsl:if test="position != last()"><xsl:text>&</xsl:text></xsl:if>
790 <xsl:template match="td">
791 <xsl:text>\multicolumn{1}{</xsl:text>
793 <xsl:when test="@align='left'"><xsl:text>l}{</xsl:text></xsl:when>
794 <xsl:when test="@align='right'"><xsl:text>r}{</xsl:text></xsl:when>
795 <xsl:when test="@align='center'"><xsl:text>c}{</xsl:text></xsl:when>
796 <xsl:otherwise><xsl:text>l}{</xsl:text></xsl:otherwise>
798 <xsl:apply-templates />
799 <xsl:text>} </xsl:text>
800 <xsl:if test="position != last()"><xsl:text>&</xsl:text></xsl:if>
803 <xsl:template match="combat">
804 <xsl:text>\begin{aoncombat}</xsl:text>
805 <xsl:apply-templates select="enemy" />
807 <xsl:when test="enemy-attribute[@class='combatskill']">
809 <xsl:when test="$language='es'">
810 <xsl:text>: {\small DESTREZA~EN~EL~COMBATE}~</xsl:text>
813 <xsl:text>: {\small COMBAT~SKILL}~</xsl:text>
816 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
818 <xsl:when test="enemy-attribute[@class='closecombatskill']">
820 <xsl:when test="$language='es'">
821 <xsl:text>: {\small DESTREZA~EN~EL~COMBATE~DE~PROXIMIDAD}~</xsl:text>
824 <xsl:text>: {\small CLOSE~COMBAT~SKILL}~</xsl:text>
827 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
831 <xsl:when test="$language='es'">
832 <xsl:text> ~~{\small RESISTENCIA}~</xsl:text>
835 <xsl:text> ~~{\small ENDURANCE}~</xsl:text>
839 <xsl:when test="enemy-attribute[@class='target']">
841 <xsl:when test="$language='es'">
842 <xsl:text>~(puntos~de~{\small OBJETIVO})~</xsl:text>
845 <xsl:text>~({\small TARGET}~points)~</xsl:text>
848 <xsl:value-of select="enemy-attribute[@class='target']" />
850 <xsl:when test="enemy-attribute[@class='resistance']">
852 <xsl:when test="$language='es'">
853 <xsl:text>~(puntos~de~{\small RESISTENCIA})~</xsl:text>
856 <xsl:text>~({\small RESISTANCE}~points)~</xsl:text>
859 <xsl:value-of select="enemy-attribute[@class='resistance']" />
862 <xsl:value-of select="enemy-attribute[@class='endurance']" />
865 <xsl:text>\end{aoncombat}</xsl:text>
866 <xsl:value-of select="$newparagraph" />
869 <xsl:template match="choice">
870 <xsl:variable name="link">
871 <xsl:value-of select="@idref" />
874 <xsl:text>\begin{aonchoice}</xsl:text>
875 <xsl:for-each select="* | text()">
877 <xsl:when test="self::link-text">
878 <xsl:text>\hyperlink{</xsl:text>
879 <xsl:value-of select="$link" />
880 <xsl:text>}{\bfseries </xsl:text>
881 <xsl:apply-templates />
882 <xsl:text>}</xsl:text>
885 <xsl:apply-templates select="." />
889 <xsl:text>\end{aonchoice}</xsl:text>
890 <xsl:value-of select="$newparagraph" />
893 <xsl:template match="signpost">
894 <xsl:text>\begin{center}</xsl:text><xsl:apply-templates /><xsl:text>\end{center}</xsl:text>
895 <xsl:value-of select="$newparagraph" />
898 <xsl:template match="blockquote">
899 <xsl:text>\begin{quote}</xsl:text><xsl:apply-templates /><xsl:text>\end{quote}</xsl:text>
900 <xsl:value-of select="$newparagraph" />
903 <xsl:template match="illustration">
905 <xsl:when test="instance[@class='pdf'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
906 <xsl:text>\begin{figure}[</xsl:text>
908 <xsl:when test="@class='inline'">!ht</xsl:when>
909 <xsl:when test="@class='float'">p</xsl:when>
910 <xsl:when test="@class='accent'">bt</xsl:when>
911 <xsl:otherwise><xsl:text>invalid class</xsl:text></xsl:otherwise>
913 <xsl:text>]</xsl:text>
914 <xsl:value-of select="$newline" />
915 <xsl:text>\centering</xsl:text>
916 <xsl:value-of select="$newline" />
917 <xsl:text>\includegraphics</xsl:text>
918 <xsl:if test="@class='float'">
919 <!--<xsl:text>[width=\textwidth,keepaspectratio]</xsl:text>-->
920 <xsl:text>[width=\textwidth,height=570pt,keepaspectratio]</xsl:text>
922 <xsl:text>{</xsl:text>
923 <xsl:value-of select="instance[@class='pdf']/@src" />
924 <xsl:text>} %</xsl:text>
925 <xsl:if test="@class='float'">
926 <xsl:value-of select="$newline" />
927 <xsl:text>\vspace*{\fill}</xsl:text>
928 <xsl:value-of select="$newline" />
929 <xsl:text>\\ \mbox{ \hypertarget{ill</xsl:text>
930 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
932 <xsl:when test="$language='es'">
933 <xsl:text>}{Ilustración </xsl:text>
936 <xsl:text>}{Illustration </xsl:text>
939 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
940 <xsl:text>}}\\[1em]{\itshape </xsl:text>
941 <xsl:apply-templates select="meta/description" />
942 <xsl:text>}</xsl:text>
944 <xsl:value-of select="$newline" />
945 <xsl:text>\end{figure}</xsl:text>
946 <xsl:value-of select="$newline" />
949 <xsl:when test="instance[@class='tex'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
950 <xsl:value-of select="$newline" />
951 <xsl:text>\begin{figure}[!h]</xsl:text>
952 <xsl:value-of select="$newline" />
953 <xsl:text>\centering</xsl:text>
954 <xsl:value-of select="$newline" />
955 <xsl:text>\input{</xsl:text><xsl:value-of select="instance[@class='tex']/@src" /><xsl:text>}</xsl:text>
956 <xsl:value-of select="$newline" />
957 <xsl:text>\end{figure}</xsl:text>
958 <xsl:value-of select="$newline" />
960 <xsl:text>\clearpage{}</xsl:text>
961 <xsl:value-of select="$newparagraph" />
969 <xsl:template match="instance" />
971 <xsl:template match="footnotes" />
973 <xsl:template match="footnote">
974 <xsl:apply-templates />
977 <xsl:template match="hr">
978 <xsl:text>\rule{\textwidth}{0.4pt}</xsl:text>
979 <xsl:value-of select="$newline" />
982 <xsl:template match="dt">
983 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}\\*\\*</xsl:text>
984 <xsl:value-of select="$newline" />
987 <xsl:template match="dd">
988 <xsl:apply-templates />
989 <xsl:value-of select="$newparagraph" />
992 <xsl:template match="li">
993 <xsl:text>\item </xsl:text><xsl:apply-templates />
994 <xsl:value-of select="$newline" />
997 <!-- ==================== inline elements ======================= -->
999 <xsl:template match="a">
1000 <xsl:if test="@idref">
1001 <xsl:text>\hyperlink{</xsl:text>
1002 <xsl:value-of select="@idref" />
1003 <xsl:text>}{</xsl:text>
1006 <xsl:text>\hypertarget{</xsl:text>
1007 <xsl:value-of select="@id" />
1008 <xsl:text>}{</xsl:text>
1011 <xsl:apply-templates />
1013 <xsl:if test="@idref">
1014 <xsl:text>}</xsl:text>
1017 <xsl:text>}</xsl:text>
1021 <xsl:template match="a[@class='footnote']">
1022 <xsl:apply-templates />
1023 <xsl:text>\footnote{</xsl:text>
1024 <xsl:for-each select="id( @idref )">
1025 <xsl:apply-templates />
1027 <xsl:text>}</xsl:text>
1030 <xsl:template match="em">
1031 <xsl:text>\emph{</xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1034 <xsl:template match="strong">
1035 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1038 <xsl:template match="cite">
1039 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1042 <xsl:template match="thought">
1043 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1046 <xsl:template match="onomatopoeia">
1047 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1050 <xsl:template match="spell">
1051 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1054 <xsl:template match="item">
1055 <xsl:apply-templates />
1058 <xsl:template match="foreign">
1059 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1062 <xsl:template match="quote">
1063 <xsl:text>&lsquot;</xsl:text>
1064 <xsl:apply-templates />
1065 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rsquot;</xsl:text></xsl:if>
1068 <xsl:template match="quote//quote">
1069 <xsl:text>&ldquot;</xsl:text>
1070 <xsl:apply-templates />
1071 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rdquot;</xsl:text></xsl:if>
1074 <xsl:template match="code">
1075 <xsl:text>{\ttfamily </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1078 <xsl:template match="br">
1079 <xsl:text>\\</xsl:text>
1082 <xsl:template match="typ[@class='attribute']">
1083 <xsl:text>{\small </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1086 <xsl:template match="footnote//typ[@class='attribute']">
1087 <xsl:text>{\scriptsize </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
1091 <!-- ==================== character elements ==================== -->
1094 These templates define the mapping between the character elements used in
1095 the Project Aon instances of Gamebook XML and the ISO-8859-1
1098 Portions Copyright International Organization for Standardization 1986
1099 Permission to copy in any form is granted for use with conforming SGML
1100 systems and applications as defined in ISO 8879, provided this notice
1101 is included in all copies.
1105 <!-- JFS: TODO - probably the \definitions need to be in {} to prevent
1106 issues if followed by text -->
1108 <xsl:template match="ch.apos"><xsl:text>'</xsl:text></xsl:template><!-- apostrophe = single quotation mark -->
1109 <xsl:template match="ch.nbsp"><xsl:text>~</xsl:text></xsl:template><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
1110 <xsl:template match="ch.iexcl"><xsl:text>{\textexclamdown}</xsl:text></xsl:template><!-- inverted exclamation mark, U+00A1 ISOnum -->
1111 <xsl:template match="ch.cent"><xsl:text>\textcent</xsl:text></xsl:template><!-- cent sign, U+00A2 ISOnum -->
1112 <xsl:template match="ch.pound"><xsl:text>\pounds</xsl:text></xsl:template><!-- pound sign, U+00A3 ISOnum -->
1113 <xsl:template match="ch.curren"><xsl:text>\textcurrency</xsl:text></xsl:template><!-- currency sign, U+00A4 ISOnum -->
1114 <xsl:template match="ch.yen"><xsl:text>\textyen</xsl:text></xsl:template><!-- yen sign = yuan sign, U+00A5 ISOnum -->
1115 <xsl:template match="ch.brvbar"><xsl:text>\textbar</xsl:text></xsl:template><!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
1116 <xsl:template match="ch.sect"><xsl:text>\textsection</xsl:text></xsl:template><!-- section sign, U+00A7 ISOnum -->
1117 <xsl:template match="ch.uml"><xsl:text>\ddot{}</xsl:text></xsl:template><!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
1118 <xsl:template match="ch.copy"><xsl:text>\copyright</xsl:text></xsl:template><!-- copyright sign, U+00A9 ISOnum -->
1119 <xsl:template match="ch.ordf"><xsl:text>\textordfeminine</xsl:text></xsl:template><!-- feminine ordinal indicator, U+00AA ISOnum -->
1120 <xsl:template match="ch.laquo"><xsl:text>{\guillemotleft}</xsl:text></xsl:template><!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
1121 <xsl:template match="ch.not"><xsl:text>\textlnot</xsl:text></xsl:template><!-- not sign, U+00AC ISOnum -->
1122 <xsl:template match="ch.shy"><xsl:text>\-</xsl:text></xsl:template><!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
1123 <xsl:template match="ch.reg"><xsl:text>{\texttrademark}</xsl:text></xsl:template><!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
1124 <xsl:template match="ch.macr"><xsl:text>\textasciimacron</xsl:text></xsl:template><!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
1125 <xsl:template match="ch.deg"><xsl:text>\textdegree</xsl:text></xsl:template><!-- degree sign, U+00B0 ISOnum -->
1126 <xsl:template match="ch.plusmn"><xsl:text>\textpm</xsl:text></xsl:template><!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
1127 <xsl:template match="ch.sup2"><xsl:text>^2</xsl:text></xsl:template><!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
1128 <xsl:template match="ch.sup3"><xsl:text>^3</xsl:text></xsl:template><!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
1129 <xsl:template match="ch.acute"><xsl:text>\'</xsl:text></xsl:template><!-- acute accent = spacing acute, U+00B4 ISOdia -->
1130 <xsl:template match="ch.micro"><xsl:text>\textmu</xsl:text></xsl:template><!-- micro sign, U+00B5 ISOnum -->
1131 <xsl:template match="ch.para"><xsl:text>\textparagraph</xsl:text></xsl:template><!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
1132 <xsl:template match="ch.middot"><xsl:text>\textperiodcentered</xsl:text></xsl:template><!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
1133 <xsl:template match="ch.cedil"><xsl:text>\c{c}</xsl:text></xsl:template><!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
1134 <xsl:template match="ch.sup1"><xsl:text>^1</xsl:text></xsl:template><!-- superscript one = superscript digit one, U+00B9 ISOnum -->
1135 <xsl:template match="ch.ordm"><xsl:text>\textordmasculine</xsl:text></xsl:template><!-- masculine ordinal indicator, U+00BA ISOnum -->
1136 <xsl:template match="ch.raquo"><xsl:text>{\guillemotright}</xsl:text></xsl:template><!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
1137 <xsl:template match="ch.frac14"><xsl:text>\frac{1}{4}</xsl:text></xsl:template><!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
1138 <xsl:template match="ch.frac12"><xsl:text>\frac{1}{2}</xsl:text></xsl:template><!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
1139 <xsl:template match="ch.frac34"><xsl:text>\frac{3}{4}</xsl:text></xsl:template><!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
1140 <xsl:template match="ch.iquest"><xsl:text>{\textquestiondown}</xsl:text></xsl:template><!-- inverted question mark = turned question mark, U+00BF ISOnum -->
1141 <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 -->
1142 <xsl:template match="ch.Aacute"><xsl:text>Á</xsl:text></xsl:template><!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
1143 <xsl:template match="ch.Acirc"><xsl:text>Â</xsl:text></xsl:template><!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
1144 <xsl:template match="ch.Atilde"><xsl:text>Ã</xsl:text></xsl:template><!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
1145 <xsl:template match="ch.Auml"><xsl:text>Ä</xsl:text></xsl:template><!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
1146 <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 -->
1147 <xsl:template match="ch.AElig"><xsl:text>Æ</xsl:text></xsl:template><!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
1148 <xsl:template match="ch.Ccedil"><xsl:text>Ç</xsl:text></xsl:template><!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
1149 <xsl:template match="ch.Egrave"><xsl:text>È</xsl:text></xsl:template><!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
1150 <xsl:template match="ch.Eacute"><xsl:text>É</xsl:text></xsl:template><!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
1151 <xsl:template match="ch.Ecirc"><xsl:text>Ê</xsl:text></xsl:template><!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
1152 <xsl:template match="ch.Euml"><xsl:text>Ë</xsl:text></xsl:template><!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
1153 <xsl:template match="ch.Igrave"><xsl:text>Ì</xsl:text></xsl:template><!-- latin capital letter I with grave, U+00CC ISOlat1 -->
1154 <xsl:template match="ch.Iacute"><xsl:text>Í</xsl:text></xsl:template><!-- latin capital letter I with acute, U+00CD ISOlat1 -->
1155 <xsl:template match="ch.Icirc"><xsl:text>Î</xsl:text></xsl:template><!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
1156 <xsl:template match="ch.Iuml"><xsl:text>Ï</xsl:text></xsl:template><!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
1157 <xsl:template match="ch.ETH"><xsl:text>Ð</xsl:text></xsl:template><!-- latin capital letter ETH, U+00D0 ISOlat1 -->
1158 <xsl:template match="ch.Ntilde"><xsl:text>Ñ</xsl:text></xsl:template><!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
1159 <xsl:template match="ch.Ograve"><xsl:text>Ò</xsl:text></xsl:template><!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
1160 <xsl:template match="ch.Oacute"><xsl:text>Ó</xsl:text></xsl:template><!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
1161 <xsl:template match="ch.Ocirc"><xsl:text>Ô</xsl:text></xsl:template><!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
1162 <xsl:template match="ch.Otilde"><xsl:text>Õ</xsl:text></xsl:template><!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
1163 <xsl:template match="ch.Ouml"><xsl:text>Ö</xsl:text></xsl:template><!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
1164 <xsl:template match="ch.times"><xsl:text>×</xsl:text></xsl:template><!-- multiplication sign, U+00D7 ISOnum -->
1165 <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 -->
1166 <xsl:template match="ch.Ugrave"><xsl:text>Ù</xsl:text></xsl:template><!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
1167 <xsl:template match="ch.Uacute"><xsl:text>Ú</xsl:text></xsl:template><!-- latin capital letter U with acute, U+00DA ISOlat1 -->
1168 <xsl:template match="ch.Ucirc"><xsl:text>Û</xsl:text></xsl:template><!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
1169 <xsl:template match="ch.Uuml"><xsl:text>Ü</xsl:text></xsl:template><!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
1170 <xsl:template match="ch.Yacute"><xsl:text>Ý</xsl:text></xsl:template><!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
1171 <xsl:template match="ch.THORN"><xsl:text>Þ</xsl:text></xsl:template><!-- latin capital letter THORN, U+00DE ISOlat1 -->
1172 <xsl:template match="ch.szlig"><xsl:text>ß</xsl:text></xsl:template><!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
1173 <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 -->
1174 <xsl:template match="ch.aacute"><xsl:text>á</xsl:text></xsl:template><!-- latin small letter a with acute, U+00E1 ISOlat1 -->
1175 <xsl:template match="ch.acirc"><xsl:text>â</xsl:text></xsl:template><!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
1176 <xsl:template match="ch.atilde"><xsl:text>ã</xsl:text></xsl:template><!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
1177 <xsl:template match="ch.auml"><xsl:text>ä</xsl:text></xsl:template><!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
1178 <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 -->
1179 <xsl:template match="ch.aelig"><xsl:text>æ</xsl:text></xsl:template><!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
1180 <xsl:template match="ch.ccedil"><xsl:text>ç</xsl:text></xsl:template><!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
1181 <xsl:template match="ch.egrave"><xsl:text>è</xsl:text></xsl:template><!-- latin small letter e with grave, U+00E8 ISOlat1 -->
1182 <xsl:template match="ch.eacute"><xsl:text>é</xsl:text></xsl:template><!-- latin small letter e with acute, U+00E9 ISOlat1 -->
1183 <xsl:template match="ch.ecirc"><xsl:text>ê</xsl:text></xsl:template><!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
1184 <xsl:template match="ch.euml"><xsl:text>ë</xsl:text></xsl:template><!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
1185 <xsl:template match="ch.igrave"><xsl:text>ì</xsl:text></xsl:template><!-- latin small letter i with grave, U+00EC ISOlat1 -->
1186 <xsl:template match="ch.iacute"><xsl:text>í</xsl:text></xsl:template><!-- latin small letter i with acute, U+00ED ISOlat1 -->
1187 <xsl:template match="ch.icirc"><xsl:text>î</xsl:text></xsl:template><!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
1188 <xsl:template match="ch.iuml"><xsl:text>ï</xsl:text></xsl:template><!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
1189 <xsl:template match="ch.eth"><xsl:text>ð</xsl:text></xsl:template><!-- latin small letter eth, U+00F0 ISOlat1 -->
1190 <xsl:template match="ch.ntilde"><xsl:text>ñ</xsl:text></xsl:template><!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
1191 <xsl:template match="ch.ograve"><xsl:text>ò</xsl:text></xsl:template><!-- latin small letter o with grave, U+00F2 ISOlat1 -->
1192 <xsl:template match="ch.oacute"><xsl:text>ó</xsl:text></xsl:template><!-- latin small letter o with acute, U+00F3 ISOlat1 -->
1193 <xsl:template match="ch.ocirc"><xsl:text>ô</xsl:text></xsl:template><!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
1194 <xsl:template match="ch.otilde"><xsl:text>õ</xsl:text></xsl:template><!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
1195 <xsl:template match="ch.ouml"><xsl:text>ö</xsl:text></xsl:template><!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
1196 <xsl:template match="ch.divide"><xsl:text>÷</xsl:text></xsl:template><!-- division sign, U+00F7 ISOnum -->
1197 <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 -->
1198 <xsl:template match="ch.ugrave"><xsl:text>ù</xsl:text></xsl:template><!-- latin small letter u with grave, U+00F9 ISOlat1 -->
1199 <xsl:template match="ch.uacute"><xsl:text>ú</xsl:text></xsl:template><!-- latin small letter u with acute, U+00FA ISOlat1 -->
1200 <xsl:template match="ch.ucirc"><xsl:text>û</xsl:text></xsl:template><!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
1201 <xsl:template match="ch.uuml"><xsl:text>ü</xsl:text></xsl:template><!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
1202 <xsl:template match="ch.yacute"><xsl:text>ý</xsl:text></xsl:template><!-- latin small letter y with acute, U+00FD ISOlat1 -->
1203 <xsl:template match="ch.thorn"><xsl:text>þ</xsl:text></xsl:template><!-- latin small letter thorn, U+00FE ISOlat1 -->
1204 <xsl:template match="ch.yuml"><xsl:text>ÿ</xsl:text></xsl:template><!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
1206 <!-- ~~~~~~~~~~~~~~~~~~~~~ Special Characters ~~~~~~~~~~~~~~~~~~~~ -->
1208 <xsl:template match="ch.ampersand">\&</xsl:template><!-- ampersand -->
1209 <xsl:template match="ch.lsquot">\textquoteleft</xsl:template><!-- opening left quotation mark -->
1210 <xsl:template match="ch.rsquot">\textquoteright</xsl:template><!-- closing right quotation mark -->
1211 <xsl:template match="ch.ldquot">``</xsl:template><!-- opening left double quotation mark -->
1212 <xsl:template match="ch.rdquot">''</xsl:template><!-- closing right double quotation mark -->
1213 <xsl:template match="ch.minus">\-</xsl:template><!-- mathematical minus -->
1214 <xsl:template match="ch.emdash">\-</xsl:template><!-- emdash -->
1215 <xsl:template match="ch.ellips"> \ldots </xsl:template><!-- ellipsis -->
1216 <xsl:template match="ch.lellips">\ldots </xsl:template><!-- left ellipsis, used at the beginning of edited material -->
1217 <xsl:template match="ch.blankline">\_\_\_\_\_\_\_</xsl:template><!-- blank line to be filled in -->
1218 <xsl:template match="ch.percent"><xsl:text>\%</xsl:text></xsl:template><!-- percent sign -->
1219 <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 -->
1220 <xsl:template match="ch.frac116"><xsl:text>1/16</xsl:text></xsl:template><!-- vulgar fraction one sixteenth = fraction on sixteenth -->
1221 <xsl:template match="ch.plus"><xsl:text>+</xsl:text></xsl:template><!-- mathematical plus -->
1223 <!-- ==================== named templates ======================= -->
1226 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.
1228 <xsl:template name="section-title-link">
1229 <!-- will the list always contain the closest ancestor first? -->
1230 <xsl:variable name="section-title">
1231 <!-- numbered or not? -->
1232 <xsl:if test="ancestor::section[position()=1]/@class='numbered'">
1234 <xsl:when test="$language='es'">
1235 <xsl:text>Sección </xsl:text>
1238 <xsl:text>Section </xsl:text>
1242 <xsl:apply-templates select="ancestor::section[position()=1]/meta/title[1]" />
1246 <xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:value-of select="ancestor::section[position()=1]/@id" /></xsl:attribute>
1247 <xsl:value-of select="$section-title" />