generate LaTeX/TeX syntax highlighted code

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Jul 6 10:44:07 EDT 2004


>>>>> "Brian" == Brian Gough <bjg at network-theory.co.uk> writes:

    Brian> John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:
    >> Are there any tools that can be used to process python code and
    >> generate LaTeX/TeX output with syntax highlighted code?

    Brian> Try lgrind.

Just did a little googling and found this in the lgrind FAQ

My source code doesn't seem to align properly. What am I doing wrong?

    LGrind uses by default a proportional font for its output. That's part
    of the beauty. However, aligning with spaces doesn't work, since they
    are relative horizontal motions. When using tabs, everything is fine. If
    the standard tab width of 8 is too big for you, fiddle around with your
    editor to save the file with tabwidth 4, say, and then use '-t 4' as an
    option to LGrind.

Should I be worried?  Will I need to preprocess my python and convert
spaces to tabs?

Also, I did some searching on google groups - it appears you need to
specify the syntax for python.  I found this post from 1998

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=m3ithlxp2s.fsf%40tern.geology.ubc.ca&rnum=2&prev=/groups%3Fq%3Dlgrind%2520python%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DN%26tab%3Dwg

Do you have something more recent, or is this what you use?

Thanks!
John Hunter



More information about the Python-list mailing list