tags:

views:

13

answers:

1

I have scons set up to run pdflatex nicely on my latex documents and stick the results in an output folder for me.

However, I haven't been able to determine whether or not I can get it to use latex2rtf on my documents at the same time as well.

Is there any way to have scons do this automatically? Or is it going to have to be something I do manually after everything else is compiled?

+1  A: 

As long as latex2rtf command is predictable (and I don't know any reason why it wouldn't be), you can get scons to run it.

Here's a simple example of creating a Builder for running latex2rtf on .tex to generate .rtf:

env = Environment()

LATEX2RTF = '/usr/local/bin/latex2rtf'
latex2rtf_bld = Builder(action='%s $SOURCE -o $TARGET' % (LATEX2RTF),
                        suffix='.rtf', src_suffix='.tex')

env.Append(BUILDERS={'RTF': latex2rtf_bld})

env.RTF('chap1.rtf', 'chap1.tex')
env.RTF('chap2.rtf', 'chap2.tex')
env.Alias('gen-rtf', [ 'chap1.rtf', 'chap2.rtf' ])

You may need to modify the latex2rtf action to suit your setup.

Dave Bacher