Another set of updates; includes the new examples code and use of
[import/samba-docs-svnimport.git] / xslt / latex.xsl
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3 <xsl:import href="../settings.xsl"/>
4 <xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
5 <xsl:import href="strip-references.xsl"/>
6
7 <xsl:param name="latex.mapping.xml" select="document('latex.overrides.xml')"/>
8
9 <xsl:param name="generate.toc">
10         /appendix toc,title
11         article/appendix  nop
12         /article  toc,title
13         book      toc,title,figure,table,example,equation
14         /chapter  toc,title,lop
15         part      toc,title
16         /preface  toc,title
17         qandadiv  toc
18         qandaset  toc
19         procedure lop
20         reference toc,title
21         /sect1    toc
22         /sect2    toc
23         /sect3    toc
24         /sect4    toc
25         /sect5    toc
26         /section  toc
27         set       toc,title
28 </xsl:param>
29
30 <!-- Show real name of the link rather then user specified description -->
31 <xsl:template name="link">
32         <xsl:element name="link">
33                 <xsl:copy-of select="@*"/>
34         </xsl:element>
35 </xsl:template>
36
37 <!-- LaTeX doesn't accept verbatim stuff in titles -->
38 <xsl:template match="//title/filename|//title/command|//title/parameter|//title/constant">
39   <xsl:variable name="content">
40     <xsl:apply-templates/>
41   </xsl:variable>
42   <xsl:if test="$content != ''">
43     <xsl:value-of select="$content" />
44   </xsl:if>
45 </xsl:template>
46
47 <xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
48 <xsl:param name="l10n.gentext.default.language" select="'en'"/>
49 <xsl:param name="latex.example.caption.style"></xsl:param>
50 <xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black</xsl:variable>
51 <xsl:variable name="admon.graphics.path">xslt/figures</xsl:variable>
52 <xsl:variable name="latex.use.tabularx">1</xsl:variable>
53 <xsl:variable name="latex.fancyhdr.lh"></xsl:variable>
54 <xsl:variable name="latex.use.fancyhdr"></xsl:variable>
55 <xsl:variable name="latex.use.parskip">1</xsl:variable>
56 <!--<xsl:variable name="latex.use.ltxtable">1</xsl:variable>-->
57 <xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable>
58 <xsl:variable name="latex.titlepage.file"></xsl:variable>
59 <xsl:template name="latex.thead.row.entry">
60 <xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
61 </xsl:template>
62 <xsl:param name="latex.documentclass">sambadoc</xsl:param>
63 <xsl:param name="latex.documentclass.book">openright,twoside</xsl:param>
64 <xsl:param name="latex.babel.language">english</xsl:param>
65
66 <xsl:template match="smbconfblock/smbconfoption">
67         <xsl:value-of select="@name"/>
68         <xsl:if test="text() != ''">
69                 <xsl:text> = </xsl:text>
70                 <xsl:value-of select="text()"/>
71         </xsl:if>
72         <xsl:text>&#10;</xsl:text>
73 </xsl:template>
74
75 <xsl:template match="smbconfblock/smbconfcomment">
76         <xsl:text># </xsl:text>
77         <xsl:apply-templates/>
78         <xsl:text>&#10;</xsl:text>
79 </xsl:template>
80
81 <xsl:template match="smbconfblock/smbconfsection">
82         <xsl:value-of select="@name"/>
83         <xsl:text>&#10;</xsl:text>
84 </xsl:template>
85
86 <xsl:template match="smbconfoption">
87         <xsl:text>\smbconfoption{</xsl:text>
88         <xsl:value-of select="@name"/>
89         <xsl:text>}</xsl:text>
90
91         <xsl:choose>
92                 <xsl:when test="text() != ''">
93                         <xsl:text> = </xsl:text>
94                         <xsl:value-of select="text()"/>
95                 </xsl:when>
96         </xsl:choose>
97 </xsl:template>
98
99 <xsl:template match="smbconfblock">
100         <xsl:text>&#10;\begin{lstlisting}[language=smbconf]&#10;</xsl:text>
101         <xsl:apply-templates/>
102         <xsl:text>\end{lstlisting}&#10;</xsl:text>
103 </xsl:template>
104
105 <xsl:template match="smbconfsection">
106         <xsl:text>\smbconfsection{</xsl:text>
107                 <xsl:value-of select="translate(@name, '$','x')"/>
108         <xsl:text>}</xsl:text>
109 </xsl:template>
110
111 <xsl:template match="imagefile">
112         <xsl:text>\includegraphics[scale=.</xsl:text>
113         <xsl:choose>
114                 <xsl:when test="@scale != ''"><xsl:value-of select="@scale"/></xsl:when>
115
116                 <xsl:otherwise><xsl:text>50</xsl:text></xsl:otherwise>
117         </xsl:choose>
118         <xsl:text>]{</xsl:text>
119         <xsl:value-of select="$latex.imagebasedir"/><xsl:text>images/</xsl:text>
120         <xsl:value-of select="text()"/>
121         <xsl:text>}&#10;</xsl:text>
122 </xsl:template>
123
124 </xsl:stylesheet>