[Scons-users] LaTeX documentation

Managan, Rob managan1 at llnl.gov
Thu Jan 31 15:47:05 EST 2013


For your question on partial builds, e.g. only figures, the approach I use
is to use an alias. That defines a target that forces a list of nodes to
be built. Nodes are the result of a builder or a specify file. See
http://www.scons.org/doc/production/HTML/scons-user/c4457.html for more
details.


MyFig1 = env.PDF(target='myFigure1',source="file1.eps")
MyFig2 = env.PDF(target='myFigure2',source="file2.eps")


Alias('buildFigures', [MyFig1, MyFig2])


Then
"scons buildFigures" should build both figures.

As far as configuring packages go this is what I use (this is all pretty
old so there may be a more modern way to do it):

#----------------
# 'lmodern' package for LaTeX available?

lmodern_test_text = r"""
\documentclass{article}
\usepackage{lmodern}
\title{Cartesian closed categories and the price of eggs}
\author{Jane Doe}
\date{September 1994}
\begin{document}
\maketitle
Hello world!
\end{document}
"""

def CheckLModern(context):
context.Message("Checking for lmodern...")
try:
b = context.env.DVI
except AttributeError:
return False
is_ok = context.TryBuild(b,lmodern_test_text,'.tex')
context.Result(is_ok)
return is_ok

conf = Configure(env, { "CheckLModern":CheckLModern
},config_dir,config_log)

# Example of how to check for Latex packages
ret = conf.CheckLModern()
# modify the environment based on the returned value



I think you will find that you need to slowly add to your Sconstruct and
Sconscripts adding one functionality at a time. They may get fairly
complex over time so go at it slowly and comment everything!




*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Rob Managan email managan at llnl.gov
LLNL phone: 925-423-0903
P.O. Box 808, L-095 FAX: 925-422-3389
Livermore, CA 94551-0808





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


>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

>_______________________________________________

>Scons-users mailing list

>Scons-users at scons.org

>http://four.pairlist.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list