*** empty log message ***
[PyX/mjg.git] / examples / examples.py
blob078c66c93376cec1a606371ef906b713f583c688
1 #!/usr/bin/env python
3 import sys; sys.path[:0]=[".."]
4 import pyx
6 tex = open("examples.tex", "w")
7 tex.write(r"""
8 \documentclass[abstracton]{scrreprt}
9 \usepackage{pyx,graphicx,scrpage,listings}
10 \lstloadlanguages{Python}
11 \lstset{language=Python}
12 \begin{document}
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>}}
17 \maketitle
18 \begin{abstract}
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.
23 \end{abstract}
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")