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" />
20 Revision 1.3 2006/04/04 22:02:14 cvsuser
21 Fix two bugs (one } too much and a missing line break)
23 Revision 1.2 2005/04/09 19:51:50 angantyr
24 Added handling of open-ended quotes.
26 Revision 1.1 2005/01/30 01:32:52 jonathan.blake
27 Initial freepository revision of XML support documents.
29 Revision 1.3 2002/10/30 06:33:22 jblake
30 Added capability to filter which illustrators' work is included in the output.
32 Revision 1.2 2002/10/20 06:29:58 jblake
33 Added support for CLOSE COMBAT SKILL from the Freeway Warrior books.
35 Revision 1.1 2002/10/15 23:30:23 jblake
44 The implementation of tables is incomplete and kludgy.
48 <!-- ====================== parameters ========================== -->
50 <xsl:param name="title-color"><xsl:text>0.0,0.0,0.0</xsl:text></xsl:param>
51 <xsl:param name="use-illustrators" />
53 <!-- ======================= variables ========================== -->
55 <xsl:variable name="newline">
60 <xsl:variable name="newparagraph">
61 <xsl:value-of select="$newline" />
62 <xsl:value-of select="$newline" />
65 <!-- ======================== Templates ========================= -->
67 <!-- ================= hierarchical sections ==================== -->
69 <xsl:template match="meta" />
71 <!-- ::::::::::::::::::: top-level section :::::::::::::::::::::: -->
73 <xsl:template match="/gamebook/section[@id='title']">
77 \documentclass[letterpaper,12pt,twoside]{book}
78 %\documentclass[a4paper,12pt,twoside]{book}
81 %\documentclass[letterpaper,12pt,oneside]{book}
82 %\documentclass[a4paper,12pt,oneside]{book}
84 \usepackage[pdftex]{graphicx}
89 \definecolor{titlecolor}{rgb}{</xsl:text><xsl:value-of select="$title-color" /><xsl:text>}
90 \definecolor{lightgray}{gray}{0.75}
92 %% headers and footers %%
95 \renewcommand{\chaptermark}[1]{}
96 \renewcommand{\sectionmark}[1]{}
99 \ifthenelse{\boolean{@twoside}}%
101 \fancyhead[CO]{\iffloatpage{}{</xsl:text><xsl:value-of select="/gamebook/meta/creator[@class='short']" /><xsl:text>}}
102 \fancyhead[CE]{\iffloatpage{}{\bfseries </xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>}}
103 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}%
105 %\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>}}}
106 %\fancyhead[R]{\iffloatpage{}{\thepage}}}
107 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}}
109 \fancypagestyle{plain}{
111 \renewcommand{\headrulewidth}{0pt}
114 \fancypagestyle{empty}{
116 \renewcommand{\headrulewidth}{0pt}
119 %% hyper-references %%
120 \usepackage[pdftex,colorlinks=true,linkcolor=black,bookmarks=false]{hyperref}
122 %% custom style info %%
123 \setlength{\parindent}{0pt}
124 \setlength{\parskip}{1em}
125 \setlength{\headheight}{18pt}
126 \addtolength{\headwidth}{\marginparwidth}
127 \addtolength{\headwidth}{\marginparsep}
128 \setlength{\textheight}{44\baselineskip}
129 \ifthenelse{\lengthtest{\paperwidth = 210mm}}%
130 {%% if A4 (210.0 mm x 297.0 mm)
131 \addtolength{\topmargin}{-1\baselineskip}}%
132 {%% else if letter (8.5" x 11" == 215.9 mm x 279.4 mm)
133 \addtolength{\topmargin}{-2.5\baselineskip}}
136 \usepackage[T1]{fontenc}
137 \usepackage{souvenir}
138 %\renewcommand{\rmdefault}{souvnrttf}
142 %% new environments %%
143 \newenvironment{aonchoice}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
144 \newenvironment{aoncombat}{\begin{list}{}{\setlength{\topsep}{0pt}} \item}{\end{list}}
145 \newenvironment{aonitemize}{\begin{list}{}{\setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
146 \newenvironment{aonordereditemize}{\begin{list}{\arabic{aoncounter}.}{\usecounter{aoncounter} \setlength{\topsep}{0pt} \setlength{\parsep}{0pt} \setlength{\itemsep}{0pt}}}{\end{list}}
147 \newcounter{aoncounter}
149 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 \vspace*{\stretch{0.7}}
156 \Huge{\textcolor{titlecolor}{\textbf{</xsl:text><xsl:value-of select="/gamebook/meta/title[1]" /><xsl:text>}}} \vspace{-0.8em}\\
158 \vspace*{\stretch{1}}
159 \normalsize{</xsl:text><xsl:apply-templates select="/gamebook/meta/creator[@class='medium']" /><xsl:text>}
161 \vspace*{\stretch{1.3}}
167 \vspace*{\stretch{1}}
170 <xsl:apply-templates select="/gamebook/meta/rights[@class='license-notification']" />
173 Publication Date: </xsl:text>
174 <xsl:value-of select="/gamebook/meta/date[@class='publication']/day" />
175 <xsl:text> </xsl:text>
177 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 1">
178 <xsl:text>January</xsl:text>
180 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 2">
181 <xsl:text>February</xsl:text>
183 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 3">
184 <xsl:text>March</xsl:text>
186 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 4">
187 <xsl:text>April</xsl:text>
189 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 5">
190 <xsl:text>May</xsl:text>
192 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 6">
193 <xsl:text>June</xsl:text>
195 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 7">
196 <xsl:text>July</xsl:text>
198 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 8">
199 <xsl:text>August</xsl:text>
201 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 9">
202 <xsl:text>September</xsl:text>
204 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 10">
205 <xsl:text>October</xsl:text>
207 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 11">
208 <xsl:text>November</xsl:text>
210 <xsl:when test="/gamebook/meta/date[@class='publication']/month = 12">
211 <xsl:text>December</xsl:text>
214 <xsl:text>Invalid Month</xsl:text>
217 <xsl:text> </xsl:text>
218 <xsl:value-of select="/gamebook/meta/date[@class='publication']/year" />
222 <xsl:apply-templates select="/gamebook/meta/description[@class='publication']" />
225 \vspace*{\stretch{3}}
231 \clearpage{\pagestyle{empty}\cleardoublepage}
233 \vspace*{\stretch{1}}
235 \thispagestyle{empty}
237 <xsl:apply-templates select="/gamebook/meta/description[@class='blurb']" />
238 <xsl:apply-templates select="/gamebook/meta/creator[@class='long']" />
241 \vspace*{\stretch{3}}
243 \clearpage{\pagestyle{empty}\cleardoublepage}
250 <xsl:apply-templates select="data/section[@class='frontmatter']" />
256 <xsl:if test="data/section[@class='mainmatter']">
257 <xsl:text>\begin{mainmatter}
261 <xsl:apply-templates select="data/section[@class='mainmatter']" />
268 <xsl:if test="data/section[@class='numbered']">
269 <xsl:apply-templates select="data/section[@class='numbered']" />
274 \ifthenelse{\boolean{@twoside}}%
280 \setcounter{topnumber}{6}
281 \renewcommand{\topfraction}{1}
282 \renewcommand{\textfraction}{0}
283 \setlength{\floatsep}{10pt}
286 <xsl:apply-templates select="data/section[@class='backmatter']" />
296 <xsl:template match="/gamebook/section[@id='toc']" />
298 <xsl:template match="section" />
300 <!-- ::::::::::: second-level frontmatter sections :::::::::::::: -->
302 <xsl:template match="/gamebook/section/data/section[@class='frontmatter']">
304 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
305 <xsl:value-of select="$newparagraph" />
307 <xsl:text>{\huge \hypertarget{</xsl:text>
308 <xsl:value-of select="@id" />
309 <xsl:text>}{</xsl:text>
310 <xsl:value-of select="meta/title" />
311 <xsl:text>}}</xsl:text>
312 <xsl:value-of select="$newline" />
313 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
314 <xsl:value-of select="meta/title" />
315 <xsl:text>}}</xsl:text>
316 <xsl:value-of select="$newparagraph" />
318 <xsl:apply-templates />
322 <!-- :::::::::::: third-level front matter sections ::::::::::::: -->
324 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter']">
326 <xsl:text>{\LARGE \hypertarget{</xsl:text>
327 <xsl:value-of select="@id" />
328 <xsl:text>}{</xsl:text>
329 <xsl:value-of select="meta/title" />
330 <xsl:text>}}</xsl:text>
331 <xsl:value-of select="$newparagraph" />
333 <xsl:apply-templates />
336 <xsl:template match="/gamebook/section/data/section/data/section[@class='frontmatter-separate']">
338 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
339 <xsl:text>{\LARGE \hypertarget{</xsl:text>
340 <xsl:value-of select="@id" />
341 <xsl:text>}{</xsl:text>
342 <xsl:value-of select="meta/title" />
343 <xsl:text>}}</xsl:text>
344 <xsl:value-of select="$newline" />
345 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
346 <xsl:value-of select="meta/title" />
347 <xsl:text>}}</xsl:text>
348 <xsl:value-of select="$newparagraph" />
350 <xsl:apply-templates />
353 <!-- :::::::::::: fourth-level front matter sections :::::::::::: -->
355 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='frontmatter']">
356 <xsl:text>{\Large \hypertarget{</xsl:text>
357 <xsl:value-of select="@id" />
358 <xsl:text>}{</xsl:text>
359 <xsl:value-of select="meta/title" />
360 <xsl:text>}}</xsl:text>
361 <xsl:value-of select="$newparagraph" />
363 <xsl:apply-templates />
366 <!-- ::::::::::::: fifth-level front matter sections :::::::::::: -->
368 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='frontmatter']">
369 <xsl:text>{\large \hypertarget{</xsl:text>
370 <xsl:value-of select="@id" />
371 <xsl:text>}{</xsl:text>
372 <xsl:value-of select="meta/title" />
373 <xsl:text>}}</xsl:text>
374 <xsl:value-of select="$newparagraph" />
376 <xsl:apply-templates />
379 <!-- ::::::::::: second-level main matter sections :::::::::::::: -->
381 <xsl:template match="/gamebook/section/data/section[@class='mainmatter']">
382 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
383 <xsl:value-of select="$newparagraph" />
385 <xsl:text>{\huge \hypertarget{</xsl:text>
386 <xsl:value-of select="@id" />
387 <xsl:text>}{</xsl:text>
388 <xsl:value-of select="meta/title" />
389 <xsl:text>}}</xsl:text>
390 <xsl:value-of select="$newline" />
391 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
392 <xsl:value-of select="meta/title" />
393 <xsl:text>}}</xsl:text>
394 <xsl:value-of select="$newparagraph" />
396 <xsl:apply-templates />
400 <!-- :::::::::::: third-level main matter sections ::::::::::::: -->
402 <xsl:template match="/gamebook/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section[@class='mainmatter-separate']">
404 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
405 <xsl:text>{\LARGE \hypertarget{</xsl:text>
406 <xsl:value-of select="@id" />
407 <xsl:text>}{</xsl:text>
408 <xsl:value-of select="meta/title" />
409 <xsl:text>}}</xsl:text>
410 <xsl:value-of select="$newline" />
411 <xsl:text>\addcontentsline{toc}{subsection}{\protect\numberline{}{</xsl:text>
412 <xsl:value-of select="meta/title" />
413 <xsl:text>}}</xsl:text>
414 <xsl:value-of select="$newparagraph" />
416 <xsl:apply-templates />
419 <!-- :::::::::::: fourth-level main matter sections :::::::::::: -->
421 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='mainmatter'] | /gamebook/section/data/section/data/section/data/section[@class='mainmatter-separate']">
422 <xsl:text>{\Large \hypertarget{</xsl:text>
423 <xsl:value-of select="@id" />
424 <xsl:text>}{</xsl:text>
425 <xsl:value-of select="meta/title" />
426 <xsl:text>}}</xsl:text>
427 <xsl:value-of select="$newparagraph" />
429 <xsl:apply-templates />
432 <!-- ::::::::::::: fifth-level main matter sections :::::::::::: -->
434 <xsl:template match="/gamebook/section/data/section/data/section/data/section/data/section[@class='mainmatter']">
435 <xsl:text>{\large \hypertarget{</xsl:text>
436 <xsl:value-of select="@id" />
437 <xsl:text>}{</xsl:text>
438 <xsl:value-of select="meta/title" />
439 <xsl:text>}}</xsl:text>
440 <xsl:value-of select="$newparagraph" />
442 <xsl:apply-templates />
445 <!-- :::::::::::: third-level glossary sections ::::::::::::: -->
446 <!-- Glossary sections should be contained in a second level section. -->
448 <xsl:template match="/gamebook/section/data/section/data/section[@class='glossary'] | /gamebook/section/data/section/data/section[@class='glossary-separate']">
450 <xsl:text>\newpage</xsl:text><xsl:value-of select="$newline" />
451 <xsl:text>{\LARGE \hypertarget{</xsl:text>
452 <xsl:value-of select="@id" />
453 <xsl:text>}{</xsl:text>
454 <xsl:value-of select="meta/title" />
455 <xsl:text>}}</xsl:text>
456 <xsl:value-of select="$newparagraph" />
458 <xsl:apply-templates />
461 <!-- :::::::::::::::::: numbered sections ::::::::::::::::::::::: -->
463 <xsl:template match="/gamebook/section/data/section[@class='numbered']">
464 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text> <xsl:value-of select="$newparagraph" />
466 <xsl:if test="position() = 1">
467 <xsl:text>\newcommand{\aonmarks}{
468 \ifthenelse{\equal{\leftmark}{\rightmark}}
470 {\rightmark{} - \leftmark}}
471 \ifthenelse{\boolean{@twoside}}%
473 \fancyhead[RO,LE]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
474 \fancyhead[LO,RE]{\iffloatpage{}{\thepage}}}
476 %\fancyhead[R]{\iffloatpage{}{\large{\bfseries \aonmarks}}}
477 %\fancyhead[L]{\iffloatpage{}{\thepage}}%
478 }</xsl:text> <xsl:value-of select="$newparagraph" />
481 <xsl:if test="not( self::node()[@id='numbered'] )">
482 <xsl:text>{\huge \hypertarget{</xsl:text>
483 <xsl:value-of select="@id" />
484 <xsl:text>}{</xsl:text>
485 <xsl:value-of select="meta/title" />
486 <xsl:text>}}</xsl:text>
487 <xsl:value-of select="$newline" />
489 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
490 <xsl:value-of select="meta/title" />
491 <xsl:text>}}</xsl:text>
492 <xsl:value-of select="$newparagraph" />
494 <xsl:apply-templates />
496 <xsl:value-of select="$newparagraph" />
497 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
500 <xsl:template match="/gamebook/section/data/section[@class='numbered']/data/section[@class='numbered']">
501 <xsl:variable name="section-title" select="meta/title[1]" />
503 <xsl:value-of select="$newline" />
504 <xsl:text>\vspace{\parskip} \hypertarget{</xsl:text>
505 <xsl:value-of select="@id" />
506 <xsl:text>}{} \hspace*{\fill} \markboth{</xsl:text>
507 <xsl:value-of select="$section-title" />
508 <xsl:text>}{</xsl:text>
509 <xsl:value-of select="$section-title" />
510 <xsl:text>} {\Large \bfseries </xsl:text>
511 <xsl:value-of select="$section-title" />
512 <xsl:text>} \hspace*{\fill}\\*[\parskip]</xsl:text>
513 <xsl:value-of select="$newline" />
515 <xsl:for-each select="data/illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]">
516 <xsl:text>\hspace*{\fill} \mbox{\itshape \hyperlink{ill</xsl:text>
517 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
518 <xsl:text>}{Illustration </xsl:text>
519 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
520 <xsl:text>}}\hspace*{\fill}\\*[\parskip]</xsl:text>
523 <xsl:apply-templates />
527 <!-- :::::::::::: second-level backmatter sections :::::::::::::: -->
529 <xsl:template match="/gamebook/section/data/section[@class='backmatter']">
531 <xsl:text>\clearpage{}</xsl:text>
532 <xsl:value-of select="$newparagraph" />
534 <xsl:text>{\huge \hypertarget{</xsl:text>
535 <xsl:value-of select="@id" />
536 <xsl:text>}{</xsl:text>
537 <xsl:value-of select="meta/title" />
538 <xsl:text>}}</xsl:text>
539 <xsl:value-of select="$newline" />
540 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
541 <xsl:value-of select="meta/title" />
542 <xsl:text>}}</xsl:text>
543 <xsl:value-of select="$newparagraph" />
545 <xsl:apply-templates />
548 <!-- ::::::::::::: third-level back matter sections ::::::::::::: -->
550 <xsl:template match="/gamebook/section/data/section/data/section[@class='backmatter']">
551 <xsl:text>{\LARGE \hypertarget{</xsl:text>
552 <xsl:value-of select="@id" />
553 <xsl:text>}{</xsl:text>
554 <xsl:value-of select="meta/title" />
555 <xsl:text>}}</xsl:text>
556 <xsl:value-of select="$newparagraph" />
558 <xsl:apply-templates />
561 <!-- ::::::::::::: fourth-level back matter sections ::::::::::::: -->
563 <xsl:template match="/gamebook/section/data/section/data/section/data/section[@class='backmatter']">
564 <xsl:text>{\Large \hypertarget{</xsl:text>
565 <xsl:value-of select="@id" />
566 <xsl:text>}{</xsl:text>
567 <xsl:value-of select="meta/title" />
568 <xsl:text>}}</xsl:text>
569 <xsl:value-of select="$newparagraph" />
571 <xsl:apply-templates />
574 <!-- :::::::::::::::::: dedication template ::::::::::::::::::::: -->
576 <xsl:template match="id( 'dedicate' )">
578 <xsl:text>\vspace*{\stretch{1}}</xsl:text>
579 <xsl:value-of select="$newparagraph" />
580 <xsl:text>\begin{center}</xsl:text>
581 <xsl:value-of select="$newline" />
582 <xsl:text>\thispagestyle{empty}</xsl:text>
583 <xsl:value-of select="$newline" />
584 <xsl:text>\itshape </xsl:text>
585 <xsl:apply-templates select="data/p" />
586 <xsl:value-of select="$newline" />
587 <xsl:text>\end{center}</xsl:text>
588 <xsl:value-of select="$newparagraph" />
589 <xsl:text>\vspace*{\stretch{3}}</xsl:text>
590 <xsl:value-of select="$newline" />
592 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
593 <xsl:value-of select="$newline" />
594 <xsl:text>\tableofcontents</xsl:text>
595 <xsl:value-of select="$newline" />
596 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
597 <xsl:value-of select="$newline" />
599 <xsl:text>\setcounter{page}{1}</xsl:text><xsl:value-of select="$newline" />
600 <xsl:text>\pagenumbering{arabic}</xsl:text><xsl:value-of select="$newline" />
604 <!-- ::::::::::::::::::::: map template ::::::::::::::::::::::::: -->
606 <xsl:template match="id( 'map' )">
607 <xsl:variable name="map-title" select="meta/title" />
609 <xsl:text>\clearpage{\pagestyle{empty}\cleardoublepage}</xsl:text>
610 <xsl:value-of select="$newparagraph" />
612 <xsl:for-each select="data/illustration[contains( $use-illustrators, concat( ':', meta/creator, ':' ) ) ]">
613 <xsl:variable name="illustration-src" select="instance[@class='pdf']/@src" />
615 <xsl:text>\hypertarget{map}{~}</xsl:text>
616 <xsl:value-of select="$newline" />
617 <xsl:text>\addcontentsline{toc}{section}{\protect\numberline{}{</xsl:text>
618 <xsl:value-of select="$map-title" />
619 <xsl:text>}}</xsl:text>
620 <xsl:value-of select="$newparagraph" />
622 <!-- <xsl:value-of select="$newline" />
623 <xsl:text>\begin{figure}[!h]</xsl:text>
624 <xsl:value-of select="$newline" />
625 <xsl:text>\centering</xsl:text>
626 <xsl:value-of select="$newline" />
627 <xsl:text>\thispagestyle{empty}</xsl:text>
628 <xsl:value-of select="$newline" />
629 <xsl:text>\rotatebox{90}{\includegraphics[width=550pt,keepaspectratio]{</xsl:text><xsl:value-of select="$illustration-src" /><xsl:text>}}%</xsl:text>
630 <xsl:value-of select="$newline" />
631 <xsl:text>\end{figure}</xsl:text> -->
633 <xsl:text>\thispagestyle{empty}</xsl:text><xsl:value-of select="$newline" />
634 <xsl:text>\newlength{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
635 <xsl:text>\setlength{\saveunitlength}{\unitlength}</xsl:text><xsl:value-of select="$newline" />
636 <xsl:text>\setlength{\unitlength}{1mm}</xsl:text><xsl:value-of select="$newline" />
637 <xsl:text>\ifthenelse{\boolean{@twoside}}%</xsl:text><xsl:value-of select="$newline" />
638 <xsl:text> {%% Two-sided %%</xsl:text><xsl:value-of select="$newline" />
639 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
640 <xsl:text> \put(-23,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
641 <xsl:text> \end{picture}}%</xsl:text><xsl:value-of select="$newline" />
642 <xsl:text> {%% One-sided %%</xsl:text><xsl:value-of select="$newline" />
643 <xsl:text> \begin{picture}(10,10)</xsl:text><xsl:value-of select="$newline" />
644 <xsl:text> \put(-29,-188){\includegraphics[angle=90,origin=c,width=20cm,height=28cm,keepaspectratio]{map.pdf}}</xsl:text><xsl:value-of select="$newline" />
645 <xsl:text> \end{picture}}</xsl:text><xsl:value-of select="$newline" />
646 <xsl:text>\setlength{\unitlength}{\saveunitlength}</xsl:text><xsl:value-of select="$newline" />
651 <!-- ==================== block elements ======================== -->
653 <xsl:template match="p">
654 <xsl:apply-templates />
655 <xsl:value-of select="$newparagraph" />
658 <xsl:template match="ul">
659 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
660 <xsl:apply-templates />
661 <xsl:text>\end{aonitemize}</xsl:text>
662 <xsl:value-of select="$newparagraph" />
665 <xsl:template match="ul[@class='unbulleted']">
666 <xsl:text>\begin{aonitemize}</xsl:text><xsl:value-of select="$newline" />
667 <xsl:apply-templates />
668 <xsl:text>\end{aonitemize}</xsl:text>
669 <xsl:value-of select="$newparagraph" />
672 <xsl:template match="ol">
673 <xsl:text>\begin{enumerate}</xsl:text><xsl:value-of select="$newline" />
674 <xsl:apply-templates />
675 <xsl:text>\end{enumerate}</xsl:text>
676 <xsl:value-of select="$newparagraph" />
679 <xsl:template match="dl">
680 <xsl:apply-templates />
683 <xsl:template match="table">
684 <xsl:text>\begin{tabular}{*{</xsl:text>
685 <xsl:for-each select="tr[1]">
686 <xsl:for-each select="th[1]">
687 <xsl:number count="th" />
690 <xsl:text>}{l}}</xsl:text>
691 <xsl:value-of select="$newline" />
692 <xsl:apply-templates />
693 <xsl:text>\end{tabular}</xsl:text>
694 <xsl:value-of select="$newparagraph" />
697 <xsl:template match="tr">
698 <xsl:apply-templates />
699 <xsl:text> \\</xsl:text>
702 <xsl:template match="th">
703 <xsl:text>\multicolumn{1}{</xsl:text>
705 <xsl:when test="@align='left'"><xsl:text>l}{\bfseries </xsl:text></xsl:when>
706 <xsl:when test="@align='right'"><xsl:text>r}{\bfseries </xsl:text></xsl:when>
707 <xsl:when test="@align='center'"><xsl:text>c}{\bfseries </xsl:text></xsl:when>
708 <xsl:otherwise><xsl:text>l}{\bfseries </xsl:text></xsl:otherwise>
710 <xsl:apply-templates />
711 <xsl:text>} </xsl:text>
712 <xsl:if test="position != last()"><xsl:text>&</xsl:text></xsl:if>
715 <xsl:template match="td">
716 <xsl:text>\multicolumn{1}{</xsl:text>
718 <xsl:when test="@align='left'"><xsl:text>l}{</xsl:text></xsl:when>
719 <xsl:when test="@align='right'"><xsl:text>r}{</xsl:text></xsl:when>
720 <xsl:when test="@align='center'"><xsl:text>c}{</xsl:text></xsl:when>
721 <xsl:otherwise><xsl:text>l}{</xsl:text></xsl:otherwise>
723 <xsl:apply-templates />
724 <xsl:text>} </xsl:text>
725 <xsl:if test="position != last()"><xsl:text>&</xsl:text></xsl:if>
728 <xsl:template match="combat">
729 <xsl:text>\begin{aoncombat}</xsl:text>
730 <xsl:apply-templates select="enemy" />
732 <xsl:when test="enemy-attribute[@class='combatskill']">
733 <xsl:text>: {\small COMBAT~SKILL}~</xsl:text>
734 <xsl:value-of select="enemy-attribute[@class='combatskill']" />
736 <xsl:when test="enemy-attribute[@class='closecombatskill']">
737 <xsl:text>: {\small CLOSE~COMBAT~SKILL}~</xsl:text>
738 <xsl:value-of select="enemy-attribute[@class='closecombatskill']" />
741 <xsl:text> ~~{\small ENDURANCE}~</xsl:text>
743 <xsl:when test="enemy-attribute[@class='target']">
744 <xsl:text>~({\small TARGET}~points)~</xsl:text>
745 <xsl:value-of select="enemy-attribute[@class='target']" />
747 <xsl:when test="enemy-attribute[@class='resistance']">
748 <xsl:text>~({\small RESISTANCE}~points)~</xsl:text>
749 <xsl:value-of select="enemy-attribute[@class='resistance']" />
752 <xsl:value-of select="enemy-attribute[@class='endurance']" />
755 <xsl:text>\end{aoncombat}</xsl:text>
756 <xsl:value-of select="$newparagraph" />
759 <xsl:template match="choice">
760 <xsl:variable name="link">
761 <xsl:value-of select="@idref" />
764 <xsl:text>\begin{aonchoice}</xsl:text>
765 <xsl:for-each select="* | text()">
767 <xsl:when test="self::link-text">
768 <xsl:text>\hyperlink{</xsl:text>
769 <xsl:value-of select="$link" />
770 <xsl:text>}{\bfseries </xsl:text>
771 <xsl:apply-templates />
772 <xsl:text>}</xsl:text>
775 <xsl:apply-templates select="." />
779 <xsl:text>\end{aonchoice}</xsl:text>
780 <xsl:value-of select="$newparagraph" />
783 <xsl:template match="signpost">
784 <xsl:text>\begin{center}</xsl:text><xsl:apply-templates /><xsl:text>\end{center}</xsl:text>
785 <xsl:value-of select="$newparagraph" />
788 <xsl:template match="blockquote">
789 <xsl:text>\begin{quote}</xsl:text><xsl:apply-templates /><xsl:text>\end{quote}</xsl:text>
790 <xsl:value-of select="$newparagraph" />
793 <xsl:template match="illustration">
795 <xsl:when test="instance[@class='pdf'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
796 <xsl:text>\begin{figure}[</xsl:text>
798 <xsl:when test="@class='inline'">!ht</xsl:when>
799 <xsl:when test="@class='float'">p</xsl:when>
800 <xsl:when test="@class='accent'">bt</xsl:when>
801 <xsl:otherwise><xsl:text>invalid class</xsl:text></xsl:otherwise>
803 <xsl:text>]</xsl:text>
804 <xsl:value-of select="$newline" />
805 <xsl:text>\centering</xsl:text>
806 <xsl:value-of select="$newline" />
807 <xsl:text>\includegraphics</xsl:text>
808 <xsl:if test="@class='float'">
809 <!--<xsl:text>[width=\textwidth,keepaspectratio]</xsl:text>-->
810 <xsl:text>[width=\textwidth,height=570pt,keepaspectratio]</xsl:text>
812 <xsl:text>{</xsl:text>
813 <xsl:value-of select="instance[@class='pdf']/@src" />
814 <xsl:text>} %</xsl:text>
815 <xsl:if test="@class='float'">
816 <xsl:value-of select="$newline" />
817 <xsl:text>\vspace*{\fill}</xsl:text>
818 <xsl:value-of select="$newline" />
819 <xsl:text>\\ \mbox{ \hypertarget{ill</xsl:text>
820 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="1" />
821 <xsl:text>}{Illustration </xsl:text>
822 <xsl:number count="illustration[@class='float' and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )]" from="/" level="any" format="I" />
823 <xsl:text>}}\\[1em]{\itshape </xsl:text>
824 <xsl:apply-templates select="meta/description" />
825 <xsl:text>}</xsl:text>
827 <xsl:value-of select="$newline" />
828 <xsl:text>\end{figure}</xsl:text>
829 <xsl:value-of select="$newline" />
832 <xsl:when test="instance[@class='tex'] and contains( $use-illustrators, concat( ':', meta/creator, ':' ) )">
833 <xsl:value-of select="$newline" />
834 <xsl:text>\begin{figure}[!h]</xsl:text>
835 <xsl:value-of select="$newline" />
836 <xsl:text>\centering</xsl:text>
837 <xsl:value-of select="$newline" />
838 <xsl:text>\input{</xsl:text><xsl:value-of select="instance[@class='tex']/@src" /><xsl:text>}</xsl:text>
839 <xsl:value-of select="$newline" />
840 <xsl:text>\end{figure}</xsl:text>
841 <xsl:value-of select="$newline" />
843 <xsl:text>\clearpage{}</xsl:text>
844 <xsl:value-of select="$newparagraph" />
852 <xsl:template match="instance" />
854 <xsl:template match="footnotes" />
856 <xsl:template match="footnote">
857 <xsl:apply-templates />
860 <xsl:template match="hr">
861 <xsl:text>\rule{\textwidth}{0.4pt}</xsl:text>
862 <xsl:value-of select="$newline" />
865 <xsl:template match="dt">
866 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}\\*\\*</xsl:text>
867 <xsl:value-of select="$newline" />
870 <xsl:template match="dd">
871 <xsl:apply-templates />
872 <xsl:value-of select="$newparagraph" />
875 <xsl:template match="li">
876 <xsl:text>\item </xsl:text><xsl:apply-templates />
877 <xsl:value-of select="$newline" />
880 <!-- ==================== inline elements ======================= -->
882 <xsl:template match="a">
883 <xsl:if test="@idref">
884 <xsl:text>\hyperlink{</xsl:text>
885 <xsl:value-of select="@idref" />
886 <xsl:text>}{</xsl:text>
889 <xsl:text>\hypertarget{</xsl:text>
890 <xsl:value-of select="@id" />
891 <xsl:text>}{</xsl:text>
894 <xsl:apply-templates />
896 <xsl:if test="@idref">
897 <xsl:text>}</xsl:text>
900 <xsl:text>}</xsl:text>
904 <xsl:template match="a[@class='footnote']">
905 <xsl:apply-templates />
906 <xsl:text>\footnote{</xsl:text>
907 <xsl:for-each select="id( @idref )">
908 <xsl:apply-templates />
910 <xsl:text>}</xsl:text>
913 <xsl:template match="em">
914 <xsl:text>\emph{</xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
917 <xsl:template match="strong">
918 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
921 <xsl:template match="cite">
922 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
925 <xsl:template match="thought">
926 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
929 <xsl:template match="onomatopoeia">
930 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
933 <xsl:template match="spell">
934 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
937 <xsl:template match="item">
938 <xsl:apply-templates />
941 <xsl:template match="foreign">
942 <xsl:text>{\itshape </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
945 <xsl:template match="quote">
946 <xsl:text>&lsquot;</xsl:text>
947 <xsl:apply-templates />
948 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rsquot;</xsl:text></xsl:if>
951 <xsl:template match="quote//quote">
952 <xsl:text>&ldquot;</xsl:text>
953 <xsl:apply-templates />
954 <xsl:if test="not(self::*[@class='open-ended'])"><xsl:text>&rdquot;</xsl:text></xsl:if>
957 <xsl:template match="code">
958 <xsl:text>{\ttfamily </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
961 <xsl:template match="br">
962 <xsl:text>\\</xsl:text>
965 <xsl:template match="typ[@class='attribute']">
966 <xsl:text>{\small </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>
969 <xsl:template match="footnote//typ[@class='attribute']">
970 <xsl:text>{\scriptsize </xsl:text><xsl:apply-templates /><xsl:text>}</xsl:text>