allow file instances as paramter of the writeXXXfile methods
[PyX/mjg.git] / examples / text / texrunner.py
blobf3411d62581c667f684c7963d10bc65e00a8e77c
1 from pyx import *
3 # Set properties of the defaulttexrunner, e.g. switch to LaTeX.
4 text.set(mode="latex")
6 c = canvas.canvas()
7 # The canvas, by default, uses the defaulttexrunner from the text module.
8 # This can be changed by the canvas method settexrunner.
9 c.text(0, 0, r"This is \LaTeX.")
11 # If you want to use another texrunner temporarily, you can just insert
12 # a text box manually
13 plaintex = text.texrunner() # plain TeX instance
14 c.insert(plaintex.text(0, -1, r"This is plain \TeX."))
16 c.writeEPSfile("texrunner")
17 c.writePDFfile("texrunner")