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