summaryrefslogtreecommitdiff
path: root/docs/xslt/latex.xsl
blob: 4b514b138742689e7a1b94d4252826961f1ee27f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:import href="http://db2latex.sourceforge.net/xsl/docbook.xsl"/>
<xsl:import href="strip-references.xsl"/>

<xsl:param name="latex.mapping.xml" select="document('latex.overrides.xml')"/>

<xsl:param name="generate.toc">
	/appendix toc,title
	article/appendix  nop
	/article  toc,title
	book      toc,title,figure,table,example,equation
	/chapter  toc,title,lop
	part      toc,title
	/preface  toc,title
	qandadiv  toc
	qandaset  toc
	procedure lop
	reference toc,title
	/sect1    toc
	/sect2    toc
	/sect3    toc
	/sect4    toc
	/sect5    toc
	/section  toc
	set       toc,title
</xsl:param>

<!-- Show real name of the link rather then user specified description -->
<xsl:template name="link">
	<xsl:element name="link">
		<xsl:copy-of select="@*"/>
	</xsl:element>
</xsl:template>

<!-- LaTeX doesn't accept verbatim stuff in titles -->
<xsl:template match="//title/filename|//title/command|//title/parameter|//title/constant">
  <xsl:variable name="content">
    <xsl:apply-templates/>
  </xsl:variable>
  <xsl:if test="$content != ''">
    <xsl:value-of select="$content" />
  </xsl:if>
</xsl:template>

<xsl:output method="text" encoding="ISO-8859-1" indent="yes"/>
<xsl:param name="l10n.gentext.default.language" select="'en'"/>
<xsl:param name="latex.example.caption.style"></xsl:param>
<xsl:variable name="latex.hyperref.param.pdftex">hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black</xsl:variable>
<xsl:variable name="admon.graphics.path">xslt/figures</xsl:variable>
<xsl:variable name="latex.use.tabularx">1</xsl:variable>
<xsl:variable name="latex.fancyhdr.lh"></xsl:variable>
<xsl:variable name="latex.use.fancyhdr"></xsl:variable>
<xsl:variable name="latex.use.parskip">1</xsl:variable>
<!--<xsl:variable name="latex.use.ltxtable">1</xsl:variable>-->
<xsl:variable name="latex.hyphenation.tttricks">1</xsl:variable>
<xsl:variable name="latex.titlepage.file"></xsl:variable>
<xsl:template name="latex.thead.row.entry">
<xsl:text>{\bfseries </xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
</xsl:template>
<xsl:param name="latex.documentclass">sambadoc</xsl:param>
<xsl:param name="latex.documentclass.book">letterpaper,openright,twoside</xsl:param>
<xsl:param name="latex.babel.language">english</xsl:param>
<xsl:variable name="ulink.footnotes" select="1"/>
<xsl:variable name="ulink.show" select="0"/>

<xsl:template match="smbconfblock/smbconfoption">
	<xsl:text>	</xsl:text><xsl:value-of select="@name"/>
	<xsl:if test="text() != ''">
		<xsl:text> = </xsl:text>
		<xsl:value-of select="text()"/>
	</xsl:if>
	<xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="smbconfblock/smbconfcomment">
	<xsl:text># </xsl:text>
	<xsl:apply-templates/>
	<xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="smbconfblock/smbconfsection">
	<xsl:value-of select="@name"/>
	<xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="smbconfoption">
	<xsl:text>\smbconfoption{</xsl:text>
	<xsl:call-template name="scape">
		<xsl:with-param name="string" select="@name"/>
	</xsl:call-template>
	<xsl:text>}</xsl:text>

	<xsl:choose>
		<xsl:when test="text() != ''">
			<xsl:text> = </xsl:text>
			<xsl:call-template name="scape">
				<xsl:with-param name="string" select="text()"/>
			</xsl:call-template>
		</xsl:when>
	</xsl:choose>
</xsl:template>

<xsl:template match="smbconfblock">
	<xsl:text>&#10;\begin{lstlisting}[language=smbconf,style=smbconfblock]&#10;</xsl:text>
	<xsl:apply-templates/>
	<xsl:text>\end{lstlisting}&#10;</xsl:text>
</xsl:template>

<xsl:template match="smbconfsection">
	<xsl:text>\smbconfsection{</xsl:text>
	<xsl:call-template name="scape">
		<xsl:with-param name="string" select="@name"/>
	</xsl:call-template>
	<xsl:text>}</xsl:text>
</xsl:template>

<xsl:template match="imagefile">
	<xsl:text>\includegraphics[scale=.</xsl:text>
	<xsl:choose>
		<xsl:when test="@scale != ''"><xsl:value-of select="@scale"/></xsl:when>

		<xsl:otherwise><xsl:text>50</xsl:text></xsl:otherwise>
	</xsl:choose>
	<xsl:text>]{</xsl:text>
	<xsl:value-of select="$latex.imagebasedir"/><xsl:text>images/</xsl:text>
	<xsl:value-of select="text()"/>
	<xsl:text>}&#10;</xsl:text>
</xsl:template>

</xsl:stylesheet>