3 import sys
; sys
.path
[:0]=[".."]
6 tex
= open("examples.tex", "w")
8 \documentclass[abstracton,a4paper]{scrreprt}
10 \usepackage{pyx,graphicx,scrpage,listings,color}
11 \usepackage[latin1]{inputenc}
12 \lstloadlanguages{Python}
13 \lstset{language=Python,commentstyle={\itshape\lstset{columns=fullflexible}},extendedchars=true}
15 \subject{\texttt{http://pyx.sourceforge.net/}}
16 \title{\PyX{} %s\\Examples}
17 \author{J\"org Lehmann
\texttt
{<joergl
@users.sourceforge
.net
>}\and
18 Andr
\'e Wobst
\texttt
{<wobsta
@users.sourceforge
.net
>}}
21 This
is an automatically generated document
from the \PyX
{} examples directory
. For
22 each \PyX
{} example
file its name
, source code
and the corresponding postscript output are
23 shown
. Please pay attention to source code comments within the examples
for
26 """ % pyx.__version__)
27 for file in sys.argv[1:]:
28 tex.write("\\deftripstyle{mypagestyle}{}{%s}{}{}{\\pagemark}{}\n" % file)
29 tex.write("\\pagestyle{mypagestyle}{}\n")
30 tex.write("\\section*{%s}\n" % file)
31 tex.write("\\lstinputlisting{%s.py}\n" % file)
32 tex.write("\\vspace{1cm}\n")
33 tex.write("\\centerline{\\includegraphics{%s}}\n\\clearpage\n" % file)
34 tex.write("\\end{document}\n")