[Twisted-Python] Lore question/ latex output question

stephen at thorne.id.au stephen at thorne.id.au
Wed May 26 20:07:54 EDT 2004

On Wed, 26 May 2004 15:33:59 -0400, "Schneider, Michael" <michael.l.schneider at ugsplm.com> wrote:
> Hello All,
> I have been using lore for a project that I have been working
> on, and it is a great tool.
> I have a quick question.  Does anyone know how
> to get the <pre>...</pre> tags to appear as shaded
> on the latex/pdf output?
> The generated latex looks like
> \\begin{verbatim}   is being output at the start of the pre
> and=20
> \\end{verbatim} is being output at the end of the pre.
> I am trying to get the same output format as html output.

I hacked up the latex spitter to allow me to change the latex, I recommend
reading the 'extending lore' part of the howtos if this doesn't provide you
enough context. What this following code (that I use) does is puts a box
around the verbatim text:

in my spitters.py:

class LivewiresLatexSpitter(latex.ChapterLatexSpitter):
    def visitNode_pre(self, node):
        buf = StringIO()
        latex.getLatexText(node, buf.write)
        s = buf.getvalue()

in my book.tex:


    { \begin{lrbox}{\fmbox}\begin{minipage}{\fmwidth}}

I'll be happy to tarball up my documentation tree and send it to you off-list
if you want a working example.


More information about the Twisted-Python mailing list