-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.py
33 lines (26 loc) · 1.02 KB
/
build.py
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
import os, sys, glob
pdfs = " ".join(sorted(list(glob.glob('./*/*.pdf'))))
d = os.environ['HOME']
if len(sys.argv) == 1:
cmd = "pdfunite %s " + d + "/Downloads/tser.pdf"
os.system(cmd % pdfs)
exit()
elif sys.argv[1] == 'all':
for a in sorted(glob.glob("tser_*")):
os.chdir(a)
os.system("pdflatex -shell-escape %s" % a)
os.chdir("..")
elif sys.argv[1] == 'clean':
os.system("find . -name '_region_*' | xargs rm -rf")
os.system("find . -name '_minted-*' | xargs rm -rf")
os.system("find . -name '*.log' | xargs rm -rf")
os.system("find . -name '*.aux' | xargs rm -rf")
os.system("find . -name '*.out' | xargs rm -rf")
elif sys.argv[1] == 'tex':
file = glob.glob('tser_*.tex')
os.system("pdflatex -shell-escape %s" % file[0])
elif sys.argv[1] == 'md':
sys.path.append("../.."); import util
file = glob.glob('*.tex')
ftex = file[0]; path = os.getcwd()
util.tex_mathjax_html(path + "/" + ftex, path + "/" + "out.html","adkasdf")