[Scons-users] LaTeX documentation

Carnë Draug carandraug+dev at gmail.com
Thu Jan 31 14:47:54 EST 2013


On 31 January 2013 16:29, Managan, Rob <managan1 at llnl.gov> wrote:

> On 1/31/13 6:36 AM, "Carnë Draug" <carandraug+dev at gmail.com> wrote:

>>I'm trying to use scons to build my thesis. SCons claims to have

>>built-in support for building LaTeX documents but I can't find it the

>>manual. Could anyone point me to some documentation?

>

> The support is built in as you say. The manual just treats latex as one

> other type of thing you can build. The DVI and PDF builders can take latex

> files as input. The DVI builder uses latex (then you can use the PDF

> builder on the output of the DVI builderŠ), the PDF builder uses pdflatex.

> There are several file name extensions that are supported. Obviously .tex,

> but .ltx and .latex force use of latex or pdflatex.

>

> If you have one main latex file then you can use something like this for

> your SConstruct:

>

> env = Environment()

> env.PDF(Glob('Figures/*.eps'))

> env.PDF('PhysicsManual.tex')

>

> In this case PhysicsManual.tex is actually a short file that uses \input

> for each chapterŠ

>

>

> The second line is to convert any eps figures into pdf form since the PDF

> builder uses pdflatex which does not accept eps figures. You probably

> don't need that line.

>

> To give more help we would need more details, such as what system are you

> on, what is your file structure, what special packages do you useŠ


Thank you Rob. That's a great help. I do have separate a directory
full of eps figures so that example is perfect for me.

But I'm also looking for something a bit more complex. Most of the
tables and figures are generated from perl scripts and use data
downloaded from online databases that keep changing. My idea is to use
scons as a simple build tool to write papers and reports that can be
always up to date. I apologise if some of my questions are weird but
I'm only familiar with scripting languages and the examples on the
manual make little sense to me. I only had very small experience with
build tools before (autoconf and GNU make).

I would like to have something like "scons getdata" and "scons
buildfigures" that would make part of the build. I think this is what
is explained on the chapter "Command-Line Targets"[1] but I'm not
sure.

Also, I have read the "Multi-Platform Configuration (Autoconf
Functionality)" chapter[2] of the manual. I would like scons to check
for the existence of some perl modules, latex packages and octave
versions. Is there something like CheckCXXHeader for this? I'd imagine
I could do as the example in "Adding Your Own Custom Checks"[3] with a
small text that only tries to load a package. Is there something like
the following for latex?

mylib_test_source_file = """
\documentclass{book}
\usepackage{siunitx}
\begin{document}
\end{document}
"""

def CheckMyLibrary(context):
context.Message('Checking for siunitx package...')
result = context.TryLink(mylib_test_source_file, '.tex')
context.Result(result)
return result

Thanks,
Carnë

[1] http://www.scons.org/doc/production/HTML/scons-user/x2810.html
[2] http://www.scons.org/doc/production/HTML/scons-user/c4241.html
[3] http://www.scons.org/doc/production/HTML/scons-user/x4307.html


More information about the Scons-users mailing list