4 # Gather together all the .py files into a Latex document.
5 # If you are reading this in the source printout, I hope you're enjoying
6 # the self-referential madness. I know I am.
8 # invoke in source directory as: ./gather.py > output.tex
13 \documentclass{article}
15 \usepackage[left=1.0in,right=1.0in,top=1.0in,bottom=1.0in,nohead]{geometry}
20 filenames
= glob
.glob("*.py") + glob
.glob("src/*.c") + glob
.glob("src/*.h") + ["Makefile"]
22 filenames
= [x
for x
in filenames
if "_" not in x
]
24 for i
, filename
in enumerate(filenames
):
28 # print "\n%scenter{%s}\n" % ('\\', filename.replace('_', r'\_'))
29 print "\n%ssection{%s}\n" % ('\\', filename
.replace('_', r
'\_'))
34 """ % ('verbatim', file(filename
, 'rU').read().replace('\t', ' '), 'verbatim')
36 print r
"\end{document}"