"Superior" LaTeX text processing using a "Low Level Font Command" input file in texmanager.py & backend_ps.py

""Randewijk" == "Randewijk P-J <pjrandew@...841...>" <pjrandew@...841...> writes:

    > Dear All, I have hacked a bit at texmanager.py and
    > backend_ps.py in order to generate "superior" text
    > output using LaTeX.

Thanks for the changes!

    > It involves "including" a user specific "low level
    > font command" input file useing some "new" rcParams
    > and the savefig command with the PS backend in you
    > main "pylab" script:

    > ... rcParams['font.latex.inputfile']='True'
    > rcParams['font.latex.inputfile.filename']='mypresentation.llfc'

I don't think you need both. I think you could just do

    rcParams['font.latex.filename'] = 'mypresentation.llfc'
    rcParams['font.latex.filename'] = None

    > savefig('myeps.eps') ...

    > The "low level font command" input file has the
    > following included:

I think it would be much easier for us to deal with this if you submit
it as a proper patch against CVS and upload it to the sf site. Could
I trouble you to do that?

    > ... def get_tex_command(self, tex, fname): fh =
    > file(fname, 'w') if rcParams['text.tex.engine'] ==
    > 'latex': print >>fh, r"""\documentclass{article}
    > \usepackage{%s} \setlength{\paperwidth}{72in}
    > \setlength{\paperheight}{72in} \pagestyle{empty}
    > \begin{document}""" % (rcParams['font.latex.package'])
    > if rcParams['font.latex.inputfile']: inputfile =
    > rcParams['font.latex.inputfile.filename'] if
    > os.path.exists(inputfile): print >>fh, r"\input{%s}" %
    > inputfile print >>fh, r"""%s \end{document}""" % tex

I worry that this is starting to get hairy -- perhaps we should look
into separating the latex from the code more cleanly.