3 import sys
; sys
.path
[:0]=[".."]
7 tex
= open("examples.tex", "w")
9 \documentclass[abstracton,a4paper]{scrreprt}
11 \usepackage{pyx,graphicx,scrpage,listings,color}
12 \usepackage[latin1]{inputenc}
13 \lstloadlanguages{Python}
14 \lstset{language=Python,commentstyle={\itshape\lstset{columns=fullflexible}},extendedchars=true}
16 \subject{\texttt{http://pyx.sourceforge.net/}}
17 \title{\PyX{} %s\\Examples}
18 \author{J\"org Lehmann
\texttt
{<joergl
@users.sourceforge
.net
>}\and
19 Andr
\'e Wobst
\texttt
{<wobsta
@users.sourceforge
.net
>}}
21 """ % pyx.__version__)
22 for file in sys.argv[1:]:
23 dir = os.path.dirname(file)
24 tex.write("\\deftripstyle{mypagestyle}{}{%s}{}{}{\\pagemark}{}\n" % file)
25 tex.write("\\pagestyle{mypagestyle}{}\n")
26 tex.write("\\section*{%s}\n" % file)
27 tex.write("\\lstinputlisting{%s.py}\n" % file)
28 tex.write("\\vspace{1cm}\n")
29 tex.write("\\centerline{\\includegraphics{%s}}\n\\clearpage\n" % file)
30 tex.write("\\end{document}\n")