ignore some files
[tridge/bind9.git] / doc / xsl / isc-docbook-latex.xsl
1 <!--
2  - Copyright (C) 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
3  -
4  - Permission to use, copy, modify, and/or distribute this software for any
5  - purpose with or without fee is hereby granted, provided that the above
6  - copyright notice and this permission notice appear in all copies.
7  -
8  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10  - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14  - PERFORMANCE OF THIS SOFTWARE.
15 -->
16
17 <!-- $Id: isc-docbook-latex.xsl.in,v 1.6 2007/06/19 23:47:13 tbox Exp $ -->
18
19 <!-- ISC customizations for db2latex generator -->
20
21 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
22
23   <!-- Import the db2latex stuff -->
24   <xsl:import href="db2latex/xsl/docbook.xsl"/>
25
26   <!-- Blank lines between paragraphs, please -->
27   <xsl:param name="latex.use.parskip" select="1"/>
28
29   <!-- Least bad current option for constructing tables -->
30   <xsl:param name="latex.use.ltxtable" select="1"/>
31   <xsl:param name="latex.use.longtable" select="1"/>
32
33   <!-- LaTeX2e documentclass options. -->
34   <xsl:param name="latex.documentclass.common"/>
35   <xsl:param name="latex.documentclass.book">10pt,twoside,openright</xsl:param>
36
37   <!-- This documentation is in English (or maybe Bad English) -->
38   <xsl:param name="latex.babel.language" select="'english'"/>
39   <xsl:param name="l10n.gentext.default.language" select="'en'"/>
40
41   <!-- Where to find "admonition" graphics -->
42   <xsl:param name="admon.graphics.path" select="'db2latex/xsl/figures'"/>
43
44   <!-- ANSI C function prototypes, please -->
45   <xsl:param name="funcsynopsis.style">ansi</xsl:param>
46
47   <!-- Local modifications to db2latex's mapping rules -->
48   <xsl:param name="latex.mapping.xml" select="document('isc-docbook-latex-mappings.xml')"/>
49
50   <!-- Patch around db2latex (0.8pre1) bug -->
51   <xsl:template match="copyright/year">
52     <xsl:apply-templates />
53     <xsl:if test="position() != last()">
54       <xsl:text>, </xsl:text>
55     </xsl:if>
56   </xsl:template>
57
58   <!-- Include our copyright generator -->
59   <xsl:include href="copyright.xsl"/>
60
61   <!-- Set comment convention for this output format -->
62   <xsl:param name="isc.copyright.leader">% </xsl:param>
63
64   <!-- Intercept top level to prepend copyright -->
65   <xsl:template match="/">
66     <xsl:value-of select="$isc.copyright"/>
67     <xsl:apply-imports/>
68   </xsl:template>
69
70   <!--
71     - Add support for multiple <para/> elements in a table entry.
72     - db2latex is already typesetting the table entry as a parbox,
73     - so we just have to insert the paragraph breaks.
74    -->
75   <xsl:template match="tbody/row/entry/para[position() != last()]">
76     <xsl:apply-imports/>
77     <xsl:text> \par </xsl:text>
78   </xsl:template>
79
80   <!-- 
81     - Add support for <optional/> in <programlisting/>.
82    -->
83   <xsl:template match="optional" mode="latex.verbatim">
84     <xsl:text>[</xsl:text>
85     <xsl:apply-templates mode="latex.verbatim"/>
86     <xsl:text>]</xsl:text>
87   </xsl:template>
88
89   <!--
90     - Customize the title page.  Are we having fun yet?
91     -
92     - NB: filename of graphic specified without extension.
93     - LaTeX includes file.eps, PDFLaTeX includes file.pdf.
94     -
95     - Spacing and font sizes could probably use some work.
96    -->
97   <xsl:param name="latex.maketitle">
98     <xsl:text>
99       \begin{titlepage}
100         \null\vfil
101         \vskip 60pt
102         \begin{center}%
103           { %\LARGE
104             \Huge
105             \bfseries
106             </xsl:text>
107             <xsl:for-each select="/book/title">
108               <xsl:call-template name="text"/>
109             </xsl:for-each>
110             <xsl:text>
111             \par}%
112           \vskip 3em%
113           { %\large
114             \Large
115             \lineskip .75em%
116             </xsl:text>
117             <xsl:for-each select="/book/bookinfo/releaseinfo[1]">
118               <xsl:call-template name="text"/>
119             </xsl:for-each>
120             <xsl:text>
121             \par}
122           %\vskip 1.5em%
123           \vfil
124           \includegraphics{isc-logo}
125         \end{center}\par
126         \vfil\null
127       \end{titlepage}
128     </xsl:text>
129     <xsl:text>&#10;</xsl:text>
130   </xsl:param>
131
132   <!--
133     - More front matter: copyright notice, CVS revision number, table
134     - of contents.
135    -->
136   <xsl:template match="book/bookinfo">
137     <xsl:apply-imports/>
138     <xsl:text>\begin{center}&#10;</xsl:text>
139     <xsl:value-of select="$isc.copyright.text"/>
140     <xsl:text>\end{center}&#10;</xsl:text>
141     <xsl:for-each select="/book/bookinfo/releaseinfo[position() &gt; 1]">
142       <xsl:text>\begin{center}</xsl:text>
143       <xsl:call-template name="text"/>
144       <xsl:text>\end{center}&#10;</xsl:text>
145     </xsl:for-each>
146     <xsl:text>\tableofcontents&#10;</xsl:text>
147   </xsl:template>
148
149   <!--
150     - Try to avoid some weird looking line breaks.
151     -
152     - This doesn't really work right, so disable for now.
153    -->
154   <xsl:template match="literal" mode="disabled">
155     <xsl:text>\mbox{</xsl:text>
156     <xsl:apply-imports/>
157     <xsl:text>}</xsl:text>
158   </xsl:template>
159
160 </xsl:stylesheet>
161
162 <!-- 
163   - Local variables:
164   - mode: sgml
165   - End:
166  -->