Created
December 5, 2012 20:06
-
-
Save matsen/4219028 to your computer and use it in GitHub Desktop.
SConstruct (http://scons.org) I use for building latex documents, featuring continuous build and auto SVG -> PDF conversion via inkscape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from SCons.Script import VariantDir, Environment, \ | |
Builder, Depends, Flatten | |
import os | |
VariantDir('_build', src_dir='.') | |
env = Environment(ENV=os.environ) | |
inkscape = Builder(action = 'inkscape --without-gui --export-pdf=$TARGET $SOURCE') | |
env['BUILDERS']['Inkscape'] = inkscape | |
env['BUILDERS']['Latexdiff'] = Builder(action = 'latexdiff $SOURCES > $TARGET') | |
svgs = [ ] | |
pdfs = [env.Inkscape(target="_build/" + os.path.basename(svg).replace('.svg','.pdf'), source=svg) | |
for svg in svgs] | |
lcfittex, = env.PDF(target='_build/lcfittex.pdf',source='lcfittex.tex') | |
#lcfittex_supp, = env.PDF(target='_build/lcfittex_supp.pdf', source='lcfittex_supp.tex') | |
Default([lcfittex]) | |
#env.Latexdiff(target='diff.tex',source=['stored_lcfittex.tex','lcfittex.tex']) | |
#diff = env.PDF(target='diff.pdf',source='diff.tex') | |
Depends(Flatten([lcfittex]), | |
Flatten([pdfs, 'lcfittex.bib', 'alphaplainnat.bst', 'defs.tex'])) | |
#Depends(lcfittex, lcfittex_supp) | |
cont_build = env.Command('.continuous', ['lcfittex.bib', 'lcfittex.tex', 'alphaplainnat.bst'], | |
'while :; do inotifywait -e modify $SOURCES; scons -Q; done') | |
Alias('continuous', cont_build) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment