Created Debian package
[xmldoc.git] / latex.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="1.0"
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                 xmlns="http://www.w3.org/TR/xhtml1/strict">
5
6 <xsl:strip-space elements="doc chapter section"/>
7 <xsl:output method="text" indent="yes" encoding="iso-8859-1"/>
8
9 <xsl:template match="article">
10 \documentclass[a4paper]{article}
11 \usepackage{xcolor}
12 \usepackage{graphics}
13 \usepackage{latexsym}
14 \usepackage{marvosym}
15 \begin{document}
16    <xsl:apply-templates/>
17 \end{document}
18 </xsl:template>
19
20 <xsl:template match="book">
21 \documentclass[a4paper]{book}
22 \usepackage{xcolor}
23 \usepackage{graphics}
24 \usepackage{latexsym}
25 \usepackage{marvosym}
26 \begin{document}
27    <xsl:apply-templates/>
28 \end{document}
29 </xsl:template>
30
31 <xsl:template match="report">
32 \documentclass[a4paper]{report}
33 \usepackage{xcolor}
34 \usepackage{graphics}
35 \usepackage{latexsym}
36 \usepackage{marvosym}
37 \begin{document}
38    <xsl:apply-templates/>
39 \end{document}
40 </xsl:template>
41
42 <xsl:template match="titlepage">
43    \begin{titlepage}
44    <xsl:apply-templates/>
45    \end{titlepage}
46 </xsl:template>
47
48 <xsl:template match="title">
49    \begin{center}
50    \sffamily\bfseries\LARGE{<xsl:apply-templates/>}
51    \end{center}
52 </xsl:template>
53
54 <xsl:template match="subtitle">
55    \begin{center}
56    \sffamily\bfseries\Large{<xsl:apply-templates/>}
57    \end{center}
58 </xsl:template>
59
60 <xsl:template match="author">
61    \begin{center}
62    \sffamily{<xsl:apply-templates/>}
63    \end{center}
64 </xsl:template>
65
66 <xsl:template match="date">
67    \begin{center}
68    \sffamily{<xsl:apply-templates/>}
69    \end{center}
70 </xsl:template>
71
72 <xsl:template match="docinfo">
73    \begin{tabular}{|l|l|}
74    \hline
75    \multicolumn{2}{|c|}{\textbf{Document Information}} \\
76    \hline
77    <xsl:apply-templates/>
78    \end{tabular}
79 </xsl:template>
80
81 <xsl:template match="infoitem">
82      <xsl:value-of select="@label"/> &amp;
83      <xsl:apply-templates/> \\
84      \hline
85 </xsl:template>
86
87 <xsl:template match="abstract">
88    
89    \vspace{0.5cm}
90    \begin{bfseries}Abstract:\end{bfseries}
91
92    \begin{quote}
93    <xsl:apply-templates/>
94    \end{quote}
95 </xsl:template>
96
97 <xsl:template match="toc">
98 \tableofcontents
99 \newpage
100 </xsl:template>
101
102 <xsl:template match="chapter/heading">
103    \chapter{<xsl:apply-templates/>}
104 </xsl:template>
105
106 <xsl:template match="section/heading">
107    \section{<xsl:apply-templates/>}
108 </xsl:template>
109
110 <xsl:template match="subsection/heading">
111    \subsection{<xsl:apply-templates/>}
112 </xsl:template>
113
114 <xsl:template match="subsubsection/heading">
115    \subsubsection{<xsl:apply-templates/>}
116 </xsl:template>
117
118 <xsl:template match="paragraph/heading">
119    \paragraph{<xsl:apply-templates/>}
120 </xsl:template>
121
122 <xsl:template match="subparagraph/heading">
123    \subparagraph{<xsl:apply-templates/>}
124 </xsl:template>
125
126 <xsl:template match="para">
127    
128      <xsl:apply-templates/>
129 </xsl:template>
130
131 <xsl:template match="quote">
132 \begin{quote} 
133      <xsl:apply-templates/>
134 \end{quote}
135 </xsl:template>
136
137 <xsl:template match="verbatim">
138 \begin{verbatim} 
139      <xsl:apply-templates/>
140 \end{verbatim}
141 </xsl:template>
142
143 <xsl:template match="example">
144 \begin{verbatim} 
145  <xsl:apply-templates/>
146 \end{verbatim}
147 </xsl:template>
148
149 <xsl:template match="itemize">
150 \begin{itemize}
151    <xsl:apply-templates/>
152 \end{itemize}
153 </xsl:template>
154
155 <xsl:template match="enumerate">
156 \begin{enumerate}
157    <xsl:apply-templates/>
158 \end{enumerate}
159 </xsl:template>
160
161 <xsl:template match="description">
162 \begin{description}
163    <xsl:apply-templates/>
164 \end{description}
165 </xsl:template>
166
167 <xsl:template match="itemize/item">
168 \item <xsl:apply-templates/>
169 </xsl:template>
170
171 <xsl:template match="enumerate/item">
172 \item <xsl:apply-templates/>
173 </xsl:template>
174
175 <xsl:template match="description/item">
176 \item[<xsl:value-of select='@tag'/>] <xsl:apply-templates/>
177 </xsl:template>
178
179 <xsl:template match="footnote">\footnote{<xsl:apply-templates/>}</xsl:template>
180
181 <xsl:template match="emph">\begin{itshape}<xsl:apply-templates/>\end{itshape}</xsl:template>
182
183 <xsl:template match="strong">\begin{bfseries}<xsl:apply-templates/>\end{bfseries}</xsl:template>
184
185 <xsl:template match="code">\begin{ttfamily}<xsl:apply-templates/>\end{ttfamily}</xsl:template>
186
187 <xsl:template match="remark">\begin{slshape}<xsl:apply-templates/>\end{slshape}</xsl:template>
188
189 <xsl:template match="sub">$_{<xsl:apply-templates/>}$</xsl:template>
190 <xsl:template match="sup">$^{<xsl:apply-templates/>}$</xsl:template>
191
192 <xsl:template match="color">\textcolor{<xsl:value-of select="@colorname"/>}{<xsl:apply-templates/>}</xsl:template>
193
194 <xsl:template match="big">\large{<xsl:apply-templates/>}</xsl:template>
195 <xsl:template match="small">\small{<xsl:apply-templates/>}</xsl:template>
196
197 <xsl:template match="newline">\\</xsl:template>
198 <xsl:template match="newpage">\newpage</xsl:template>
199
200 <xsl:template match="table">
201 \begin{tabular}{<xsl:value-of select="@cpos"/>c}
202 <xsl:apply-templates/>
203 \end{tabular}
204 </xsl:template>
205
206 <xsl:template match="thead">
207 <xsl:apply-templates/>\\
208 </xsl:template>
209
210 <xsl:template match="thead/col">
211 \begin{bfseries}<xsl:apply-templates/>\end{bfseries}&amp;
212 </xsl:template>
213
214 <xsl:template match="row">
215 <xsl:apply-templates/>\\
216 </xsl:template>
217
218 <xsl:template match="row/col">
219 <xsl:apply-templates/>&amp;
220 </xsl:template>
221
222 <xsl:template match="picture">
223 \scalebox{<xsl:value-of select="@scale"/>}{\includegraphics{<xsl:value-of select="@eps"/>}}
224 </xsl:template>
225
226 <xsl:template match="label">\label{<xsl:value-of select="@name"/>}</xsl:template>
227
228 <xsl:template match="index"></xsl:template>
229 <xsl:template match="ref"><xsl:apply-templates/>\ref{<xsl:value-of select="@to"/>}</xsl:template>
230 <xsl:template match="page"><xsl:apply-templates/>\pageref{<xsl:value-of select="@to"/>}</xsl:template>
231 <xsl:template match="reference">
232 <xsl:apply-templates/>[<xsl:value-of select="@href"/>]
233 </xsl:template>
234
235 <xsl:template match="include">
236    <xsl:apply-templates select="document(@href)"/>
237 </xsl:template>
238
239 <xsl:template match="LaTeX">
240  <xsl:value-of select="@command"/>
241 </xsl:template>
242 </xsl:stylesheet>
243