On Wednesday 26 March 2008 09:50, Rich Shepard wrote:
> What I intend to do is use the Python free-form comment delimiter ("""
> ... """) to write the preamble and other multiline code, and the rest as
> embedded strings. Using open(), write(), and close() I'll get a .tex file
> on disk, then spawn a shell to execute a script to run
> latex->dvips->ps2pdf.
Why not put the preamble and other multiline code in one or more separate text
files. Those things are data, not code. That way you or your assistant can
change the preamble without changing the Python program and its indentation.
Once again, I'd recommend placing the entire template for the report in a LyX
or LaTeX or TeX file, and within that template have placeholders which the
Python program will replace with strings derived from data content. It would
be quick, easy, clean, and very modifiable.
SteveT
Steve Litt
Books written in LyX:
Troubleshooting Techniques of the Successful Technologist
Twenty Eight Tales of Troubleshooting
Troubleshooting: Just the Facts