Created
September 21, 2010 18:00
-
-
Save tkf/590140 to your computer and use it in GitHub Desktop.
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
| build/* | |
| waf-* | |
| .waf* | |
| .lock-wafbuild |
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
| % -*- mode: tex -*- | |
| \documentclass[10pt]{article} | |
| \usepackage{graphicx} | |
| \begin{document} | |
| \LaTeX document with generated figures. | |
| \includegraphics[width=90mm]{sin.pdf} | |
| \end{document} |
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
| import sys | |
| import pylab | |
| import numpy | |
| figpath = sys.argv[1] | |
| x = numpy.linspace(0, 10, num=200) | |
| y = numpy.sin(x) | |
| pylab.plot(x, y) | |
| pylab.savefig(figpath) |
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
| # -*- sh -*- | |
| waf=waf-1.6.1 | |
| if [ ! -e $waf ] | |
| then | |
| wget http://waf.googlecode.com/files/$waf | |
| fi | |
| python $waf "$@" |
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
| top = '.' | |
| out = 'build' | |
| def configure(conf): | |
| ## http://alan.lamielle.net/2009/09/29/using-waf-to-build-latex-documents | |
| conf.check_tool('tex') ## not conf.load! | |
| if not conf.env.PDFLATEX: | |
| conf.fatal('could not find the program pdflatex') | |
| def build(bld): | |
| bld(rule='python ${SRC} ${TGT}', | |
| target='sin.pdf', | |
| source='sin.py', | |
| before='pdflatex', | |
| ) | |
| figs = 'sin.pdf' | |
| bld(name = 'main', | |
| features = 'tex', | |
| source = 'main.tex', | |
| ## after = figs, | |
| deps = figs, | |
| outs = 'pdf', | |
| prompt = 0, ## 1 to see output of pdflatex | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment