remove question and answer
[PyX/mjg.git] / examples / examples.py
blob5f451ca01a3d77240c44977a4ed5ea2e1ad3aef8
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,a4paper]{scrreprt}
9 \areaset{17cm}{24cm}
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}
14 \begin{document}
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>}}
19 \maketitle
20 \begin{abstract}
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
24 further information.
25 \end{abstract}
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")