-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
36 lines (27 loc) · 959 Bytes
/
Copy pathwscript
File metadata and controls
36 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
#-*- coding:utf-8 -*-
top = '.'
out = 'pdf'
def configure(conf):
conf.load('tex')
if not conf.env.PDFLATEX:
conf.fatal('Could not find pdflatex')
conf.find_program('pygmentize', var='PYGMENTIZE')
def options(opt):
opt.load('tex')
def build(bld):
# first, run pygments on all code snippets:
for suffix in ('.f90', '.pyx', '.py'):
for blob in bld.path.ant_glob('Pygsnippets/*'+suffix):
print blob.srcpath()
bld(rule='${PYGMENTIZE} -P style=default -f tex -o ${TGT} ${SRC}',
source=blob.nice_path(),
target=blob.nice_path().replace(suffix, '.tex'))
bld.add_group()
bld(
features = 'tex',
type = 'pdflatex', # pdflatex or xelatex
source = 'talk.tex', # mandatory, the source
outs = 'pdf', # 'pdf' or 'ps pdf'
prompt = 0 # 0 for the batch mode
)