Hi all,
I finally took the trouble to track down a sporadic problem I was
having with pyx.text.preamble. See attached file. It turns out that a
TeX error is triggered if the argument to preamble has any blank
lines. This includes the case of an initial newline, as in
r"""
\usepackage{foo}
\someothercommand
"""
which is what had been biting me. Is it possible to fix this? The
problem seems to be with \PyXInput managing to grab its second
argument. If not fixable, I think it should be at least mentioned in
the docs.
Cheers
Will
--
Dr William Henney, Centro de Radioastronomía y Astrofísica,
Universidad Nacional Autónoma de México, Campus Morelia
import pyx
pyx.text.set(mode="latex", errordebug=2, texdebug="pyxdebug")
# Version 1 - multiline call to preamble - THIS WORKS
preamb1 = r"""\usepackage{color}
\newcommand\B[1]{\colorbox{yellow}{#1}}
"""
# Version 2 - leading newline - THIS FAILS!
preamb2 = r"""
\usepackage{color}
\newcommand\B[1]{\colorbox{yellow}{#1}}
"""
# Version 3 - embedded newline - THIS FAILS!
preamb3 = r"""\usepackage{color}
\newcommand\B[1]{\colorbox{yellow}{#1}}
"""
pyx.text.preamble(preamb2)
c = pyx.canvas.canvas()
c.text(0, 0, r"\B{Hello world!}")
c.writePDFfile("pyx-preamble-test")
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user