2 <!--#############################################################################
3 |- #############################################################################
6 + ############################################################################## -->
9 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
11 exclude-result-prefixes="doc" version='1.0'>
14 <!--############################################################################# -->
15 <!-- DOCUMENTATION -->
16 <doc:reference id="verbatim" xmlns="">
18 <releaseinfo role="meta">
21 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
22 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
25 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
26 <holder>Ramon Casellas</holder>
29 <title>Verbatim <filename>verbatim.mod.xsl</filename></title>
31 <section><title>Introduction</title>
36 <!--############################################################################# -->
39 <!--############################################################################# -->
40 <!-- DOCUMENTATION -->
41 <doc:template match="literal" xmlns="">
42 <refpurpose>Template for <sgmltag>literal</sgmltag></refpurpose>
44 Template for literal template
47 <!--############################################################################# -->
49 <xsl:template match="literal" mode="latex.verbatim">
50 <xsl:text>{\verb </xsl:text>
51 <xsl:apply-templates mode="latex.verbatim"/>
52 <xsl:text>}</xsl:text>
59 <!--############################################################################# -->
60 <!-- DOCUMENTATION -->
61 <doc:template name="verbatim.apply.templates" xmlns="">
62 <refpurpose> Auxiliary template to output verbatim LaTeX code in verbatim mode </refpurpose>
64 <para> Takes into account whether the user is using fancyvrb or not. It allows
65 veratim line numbering and other fancy stuff. </para>
66 <para> In order to use a small or large font, you may also wanto to use
67 the <literal>role</literal> attribute : </para>
69 <programlisting role="small">
71 <programlisting role="large">
76 <!--############################################################################# -->
78 <xsl:template name="verbatim.apply.templates">
80 <xsl:when test="ancestor::entry">
81 <xsl:message>Problem with <xsl:value-of select="local-name(.)"/> inside table entries.</xsl:message>
82 <xsl:text>\texttt{</xsl:text>
83 <xsl:apply-templates mode="latex.verbatim"/>
84 <xsl:text>}</xsl:text>
86 <xsl:when test="$latex.use.fancyvrb='1'">
87 <xsl:variable name="not_monospaced" select="local-name(.)='literallayout' and @format!='monospaced'"/>
88 <xsl:text> \begin{Verbatim}[</xsl:text>
89 <xsl:if test="@linenumbering='numbered'">
90 <xsl:text>,numbers=left</xsl:text>
92 <xsl:if test="$not_monospaced">
93 <xsl:text>,fontfamily=default</xsl:text>
97 <xsl:when test="@role='small'">
98 <xsl:text>,fontsize=\small</xsl:text>
100 <xsl:when test="@role='large'">
101 <xsl:text>,fontsize=\large</xsl:text>
105 <xsl:text>] </xsl:text>
107 <xsl:when test="$not_monospaced">
108 <!-- Needs to be changed to cope with regular characterset! -->
109 <xsl:apply-templates mode="latex.verbatim"/>
112 <xsl:apply-templates mode="latex.verbatim"/>
115 <xsl:text> \end{Verbatim} </xsl:text>
118 <xsl:text> \begin{verbatim} </xsl:text>
119 <xsl:apply-templates mode="latex.verbatim"/>
120 <xsl:text> \end{verbatim} </xsl:text>
127 <xsl:template match="address">
128 <xsl:call-template name="verbatim.apply.templates"/>
131 <doc:template name="verbatim" match="screen|programlisting|literallayout" xmlns="">
132 <refpurpose>Environments in which whitespace is significant</refpurpose>
135 <title>Known Bugs</title>
136 <listitem><simpara>Templates are not applied within programlistings.</simpara></listitem>
140 <xsl:template match="screen|programlisting|literallayout">
141 <xsl:call-template name="verbatim.apply.templates"/>