Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
12 lines (7 sloc) 257 Bytes
import glob
chapters = open("chapters.txt").readlines()
template = open("template.tex").read()
for i, title in enumerate(chapters):
out = template % {'number': i, 'title': title.strip()}
with open("ex%d.tex" % i, "w") as f:
f.write(out)
Something went wrong with that request. Please try again.