Skip to content

Commit

Permalink
README and SConstruct-noinkscape
Browse files Browse the repository at this point in the history
  • Loading branch information
matsen committed Oct 4, 2019
1 parent 97870e9 commit 9975b42
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

## Writing

[Erick's notes on writing](https://github.com/matsengrp/wiki/wiki/writing_with_erick)


## Compilation

Type `scons --sconstruct SConstruct-noinkscape` in the command line if you don't have Inkscape all set up to work on the command line.
If you do, `scons` should work.
Use `scons continuous` to have continuous building after installing inotify.

27 changes: 27 additions & 0 deletions SConstruct-noinkscape
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import glob
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')
env['BUILDERS']['Copier'] = Builder(action = Copy('$TARGET', '$SOURCE'))

pdfs = [env.Copier(target = '_build/' + os.path.basename(pdf), source = pdf)
for pdf in glob.glob('figures/*.pdf')]

main=env.PDF(target='_build/main.pdf',source='main.tex')

Depends(Flatten([main]),
Flatten([pdfs, 'main.bib']))

cont_build = env.Command('.continuous', ['main.bib', 'main.tex'],
'while :; do inotifywait -e modify $SOURCES; scons -Q; done')
Alias('continuous', cont_build)

Default(main)

env.Latexdiff(target='diff.tex',source=['versions/main.v1.tex','main.tex'])
diff = env.PDF(target='diff.pdf',source='diff.tex')

0 comments on commit 9975b42

Please sign in to comment.