Package: dblatex
Version: 0.2.9-3
Consider the following example:
<?xml version="1.0" encoding="us-ascii" standalone="no"?>
<!DOCTYPE article
PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<article xml:lang="en" lang="en">
<screen>
<prompt>$ </prompt><userinput>find /etc/ \
-type f \
\( -name \*tab -or -name \*conf \)</userinput>
<computeroutput>/etc/sysctl.conf
/etc/fstab
/etc/mke2fs.conf
…</computeroutput>
<prompt>$ </prompt>
</screen>
</article>
Here, I wanted to represent a kind of ``screenshot'', while
decorating certain parts of it (in particular, the part which is
up to user to type in) with a suitable mark-up, namely:
`userinput'.
Much to my surprise, wrapping the text into an `userinput'
element made it insensitive to newlines. The fragment gets
transformed to the following LaTeX code:
\begin{lstlisting}[firstnumber=1,escapeinside={<:}{:>},]
$ <:\textbf{find /etc/ \textbackslash{}
-{}type f \textbackslash{}
\textbackslash{}( -{}name \textbackslash{}*tab -{}or -{}name
\textbackslash{}*conf \textbackslash{})}:>
/etc/sysctl.conf
/etc/fstab
/etc/mke2fs.conf
<:\ldots{}:>
$
\end{lstlisting}
Apparently, the text inside of the <:, :> escape sequence is
insensitive to newlines, so these should either be made explicit
by the XSLT code, perhaps with something along the lines of:
--cut: inlined.xsl --
<xsl:template match="userinput" mode="latex.programlisting">
<xsl:param name="co-tagin" select="'<:'"/>
<xsl:param name="rnode" select="/"/>
<xsl:value-of select="$co-tagin"/>
- <xsl:call-template name="inline.boldseq"/>
+ <xsl:variable name="fragment">
+ <xsl:call-template name="inline.boldseq" />
+ </xsl:variable>
+ <xsl:call-template name="string-replace">
+ <xsl:with-param name="string" select="$fragment" />
+ <xsl:with-param name="from" select=" " />
+ <xsl:with-param name="to" select="\\ " />
+ </xsl:call-template>
<xsl:value-of select="$co.tagout"/>
</xsl:template>
--cut: inlined.xsl --
Or `co-tagin' could be passed to the code above with an appended
TeX-code to honor the linebreaks within the escape.
--
FSF associate member #7257
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]