next up previous [pdf]

Next: Templates Up: Papers Previous: Tex files

Paper SConstructs

One of Madagascar's aims is to make TeX files as layout-agnostic as possible. To do so, Madagascar automatically adds the TeX document preamble (including the LATEXdocument class information), the LATEXpackage inclusions, and end of document information at runtime. This allows you to generate multiple documents from a single TeX file by simply changing the SConstruct, instead of the TeX file.

Note: the paper SConstruct is only used to build papers. It contains no other information, and cannot be used to process data in the same SConstruct. This is why the paper SConstruct must exist in a separate directory from any processing SConstructs.

The paper SConstruct is very simple compared to most processing SConstructs, in that it contains only a few lines as shown below (in an example for an EAGE abstract):
3#2

The first section, from rsf.tex import * tells Madagascar to import Python packages for processing TeX files instead of the usual processing packages. Next, we call a Paper object, which takes the following parameters:

Paper(name,lclass,options,use)
name - name of the root tex file to build.
lclass - name of the LaTeX class file to use.
options - document options for LaTeX class file.
use - names of LaTeX packages to import during compilation.
All of the parameters are passed as strings to the Paper object. Parameters with more that one possible value (e.g. options and use) accept comma delimited strings as shown above.

To generate different types of documents, you simply change the lclass and options sent to the Paper object in the SConstruct for the respective document type. Since the documents that we are creating use custom LATEXdocument classes that require additional TeX commands to function properly, it is easier for us to provide you with a template instead of discussing the details of each document class. The templates for the documents can be found in the following directory: $RSFSRC/book/tutorial/authors.


next up previous [pdf]

Next: Templates Up: Papers Previous: Tex files

2011-11-03