1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
4 <xsl:import href="include/common_pdf.xsl" />
5 <xsl:variable name="toc.section.depth">1</xsl:variable>
6 <xsl:variable name="admon.graphics.path">../../xsl/db2latex/xsl/figures</xsl:variable>
7 <xsl:variable name="latex.documentclass.book">a4paper,10pt,oneside</xsl:variable>
9 <xsl:template match="book">
10 <!-- book:1: generate.latex.book.preamble -->
11 <xsl:call-template name="generate.latex.book.preamble"/>
12 <!-- book:2: output title information -->
13 <xsl:text>\title{</xsl:text>
14 <xsl:apply-templates select="title|bookinfo/title"/>
15 <xsl:apply-templates select="subtitle|bookinfo/subtitle"/>
16 <xsl:text>} </xsl:text>
17 <!-- book:3: output author information -->
18 <xsl:text>\author{</xsl:text>
20 <xsl:when test="bookinfo/authorgroup">
21 <xsl:apply-templates select="bookinfo/authorgroup"/>
24 <xsl:for-each select="bookinfo">
25 <xsl:call-template name="authorgroup"/>
29 <xsl:text>} </xsl:text>
30 <!-- book:4: dump any preamble after author -->
31 <xsl:value-of select="$latex.book.afterauthor"/>
32 <!-- book:5: set some counters -->
33 <xsl:text> \setcounter{tocdepth}{</xsl:text><xsl:value-of select="$toc.section.depth"/><xsl:text>} </xsl:text>
34 <xsl:text> \setcounter{secnumdepth}{</xsl:text><xsl:value-of select="$section.depth"/><xsl:text>} </xsl:text>
35 <!-- book:6: dump the begin document command -->
36 <xsl:value-of select="$latex.book.begindocument"/>
37 <!-- book:7: include external Cover page if specified -->
38 <xsl:if test="$latex.titlepage.file != ''">
39 <xsl:text> \InputIfFileExists{</xsl:text><xsl:value-of select="$latex.titlepage.file"/>
40 <xsl:text>}{\typeout{WARNING: Using cover page </xsl:text>
41 <xsl:value-of select="$latex.titlepage.file"/>
42 <xsl:text>}}</xsl:text>
44 <!-- book:7b: maketitle and set up pagestyle -->
45 <xsl:value-of select="$latex.maketitle"/>
46 <!-- book:8: - APPLY TEMPLATES -->
47 <xsl:apply-templates select="bookinfo"/>
48 <xsl:call-template name="toc" />
49 <xsl:call-template name="content-templates-rootid"/>
50 <!-- book:9: call map.end -->
51 <xsl:call-template name="map.end"/>
54 <xsl:template match="book/article">
55 <!-- Get and output article title -->
56 <xsl:variable name="article.title">
58 <xsl:when test="./title">
59 <xsl:apply-templates select="./title"/>
61 <xsl:when test="./articleinfo/title">
62 <xsl:apply-templates select="./articleinfo/title"/>
65 <xsl:apply-templates select="./artheader/title"/>
69 <xsl:text>\chapter{</xsl:text><xsl:value-of select="$article.title"/><xsl:text>} </xsl:text>
70 <!-- Display date information -->
71 <xsl:variable name="article.date">
72 <xsl:apply-templates select="./artheader/date|./articleinfo/date"/>
74 <xsl:if test="$article.date!=''">
75 <xsl:text>{</xsl:text>
76 <xsl:value-of select="$article.date"/>
77 <xsl:text>}\par </xsl:text>
79 <!-- Display author information -->
80 <xsl:text>{</xsl:text>
81 <xsl:value-of select="$latex.book.article.header.style"/>
82 <xsl:text>{</xsl:text>
84 <xsl:when test="articleinfo/authorgroup">
85 <xsl:apply-templates select="articleinfo/authorgroup"/>
87 <xsl:when test="artheader/authorgroup">
88 <xsl:apply-templates select="artheader/authorgroup"/>
90 <xsl:when test="articleinfo/author">
91 <xsl:for-each select="artheader">
92 <xsl:call-template name="authorgroup"/>
95 <xsl:when test="artheader/author">
96 <xsl:for-each select="artheader">
97 <xsl:call-template name="authorgroup"/>
101 <xsl:call-template name="authorgroup"/>
104 <xsl:text>}}\par </xsl:text>
105 <xsl:apply-templates select="artheader|articleinfo" mode="article.within.book"/>
106 <xsl:call-template name="content-templates"/>