Since you are using Python, I suggest using the string.Template class
for this purpose. I think the only thing that you would have to be
careful about is with the $: You would have to replace the normal $'s
of your LaTeX template by $$, since this class uses $ for marking
placeholders. Here's the link to the documentation

http://docs.python.org/lib/node40.html


On 10/10/07, Rich Shepard <[EMAIL PROTECTED]> wrote:
> On Wed, 10 Oct 2007, Todd Denniston wrote:
>
> > I have done such a beast, therefore it can be done. :)
>
>    Thank you, Todd!
>
> > I had to be careful in my C program to properly escape LaTeX special chars
> > before it wrote the data to MyVariableData.tex, i.e., at least "_", "*"
> > and "\" become "\_", "{*}" and "\textbackslash{}". There are probably
> > others you need to look out for like "%" & "@".
>
>    This should not be an issue in our model. The data are extracted from the
> database to a Python list (or a list of tuples; analogous to a
> two-dimensional array), and I can use indices to extract the strings and
> numbers I want.
>
>    There will be plots (created, no doubt, with PSTricks), to be included in
> the audit log report of each run. So I expect the templates to be as
> inclusive as your example.
>
> > in MyVariableData.tex there are lines of the form:
> > \def\MyFirstVar{{*}Data{*} for Var\_1}
>
>    I do need to better learn programming in LaTeX; this project needs that
> increased knowledge.
>
> > Hope this helps.
>
>    Yes, it does.
>
> Rich
>
> --
> Richard B. Shepard, Ph.D.               |    The Environmental Permitting
> Applied Ecosystem Services, Inc.        |         Accelerators(TM)
> <http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
>


-- 
Ernesto Posse
Modelling, Simulation and Design Lab - School of Computer Science
McGill University - Montreal, Quebec, Canada
url: http://moncs.cs.mcgill.ca/people/eposse

Reply via email to