3 import sys
; sys
.path
[:0]=[".."]
6 tex
= open("examples.tex", "w")
8 \documentclass[abstracton]{scrreprt}
9 \usepackage{pyx,graphicx,scrpage,listings}
10 \lstloadlanguages{Python}
11 \lstset{language=Python}
13 \subject{\texttt{http://pyx.sourceforge.net/}}
14 \title{\PyX{} %s\\Examples}
15 \author{J\"org Lehmann
\texttt
{<joergl
@users.sourceforge
.net
>}\and
16 Andr
\'e Wobst
\texttt
{<wobsta
@users.sourceforge
.net
>}}
19 This
is an automatic generated document
from the \PyX
{} examples directory
.
20 For each \PyX
{} example
file therein
, its name
, the source code
and the
21 postscript output
is shown
. Please refere to source code comments within
22 the examples
for further informations about the subject of each example
.
24 """ % pyx.__version__)
25 for file in sys.argv[1:]:
26 tex.write("\\deftripstyle{mypagestyle}{}{%s}{}{}{\\pagemark}{}\n" % file)
27 tex.write("\\pagestyle{mypagestyle}{}\n")
28 tex.write("\\section*{%s}\n" % file)
29 tex.write("\\lstinputlisting{%s.py}\n" % file)
30 # tex.write("\\begin{lstlisting}\n")
31 # tex.writelines(open("%s.py" % file, "r").readlines())
32 # tex.write("\\end{lstlisting}\n")
33 tex.write("\\centerline{\\includegraphics{%s}}\n\\clearpage\n" % file)
34 tex.write("\\end{document}\n")