Instances of the class texrunner are responsible for executing and controling a TEX/LATEX instance.
| mode="tex", lfs="10pt", docclass="article", docopt=None, usefiles=[], fontmaps=config.get("text", "fontmaps", "psfonts.map"), waitfortex=config.getint("text", "waitfortex", 60), showwaitfortex=config.getint("text", "showwaitfortex", 5), texipc=config.getboolean("text", "texipc", 0), texdebug=None, dvidebug=0, errordebug=1, pyxgraphics=1, texmessagesstart=[], texmessagesdocclass=[], texmessagesbegindoc=[], texmessagesend=[], texmessagesdefaultpreamble=[], texmessagesdefaultrun=[]) |
None and mode equals "tex" a list of installed
lfs files is shown.
docclass is the document class to be used in LATEX mode and docopt are the options to be passed to the document class.
usefiles is a list of TEX/LATEX jobname files. PyX will take care of the creation and storing of the corresponding temporary files. A typical use-case would be usefiles=["spam.aux"], but you can also use it to access TEXs log and dvi file.
fontmaps is a string containing whitespace separated names of font mapping files. waitfortex is a number of seconds PyX should wait for TEX/LATEX to process a request. While waiting for TEX/LATEX a PyX process might seem to do not perform any work anymore. To give some feedback to the user, a messages is issued each waitfortex seconds. The texipc flag indicates whether PyX should use the -ipc option of TEX/LATEX for immediate dvi file access to increase the execution speed of certain operations. See the output of tex -help whether the option is available at your TEX installation.
texdebug can be set to a filename to store the commands passed
to TEX/LATEX for debugging. The flag dvidebug enables
debugging output in the dvi parser similar to dvitype.
errordebug controls the amount of information returned, when
an texmessage parser raises an error. Valid values are 0,
1, and 2.
pyxgraphics allows use LATEXs graphics package without further configuration of pyx.def.
The TEX message parsers verify whether TEX/LATEX could
properly process its input. By the parameters
texmessagesstart, texmessagesdocclass,
texmessagesbegindoc, and texmessagesend you can set
TEX message parsers to be used then TEX/LATEX is started,
when the documentclass command is issued (LATEX only),
when the \begin{document} is sent, and
when the TEX/LATEX is stopped, respectively. The lists of
TEX message parsers are merged with the following defaults:
[texmessage.start] for texmessagesstart,
[texmessage.load] for texmessagesdocclass,
[texmessage.load, texmessage.noaux] for
texmessagesbegindoc, and [texmessage.texend,
texmessage.fontwarning] for texmessagesend.
Similarily texmessagesdefaultpreamble and
texmessagesdefaultrun take TEX message parser to be merged
to the TEX message parsers given in the preamble() and
text() methods. The texmessagesdefaultpreamble and
texmessagesdefaultrun are merged with [texmessage.load]
and [texmessage.loaddef, texmessage.graphicsload,
texmessage.fontwarning, texmessage.boxwarning], respectively.
texrunner instances provides several methods to be called by the user:
| **kwargs) |
defaulttexrunner which is created
at the time of loading of the text module.
The set method fails, when a modification cannot be applied
anymore (e.g. TEX/LATEX has already been started).
| expr, texmessages=[]) |
texmessages are TEX message parsers to handle the output of TEX/LATEX. They are merged with the default TEX message parsers for the preamble() method. See the constructur description for details on the default TEX message parsers.
| x, y, expr, textattrs=[], texmessages=[]) |
textattrs is a list of TEX/LATEX settings as described below, PyX transformations, and PyX fill styles (like colors).
texmessages are TEX message parsers to handle the output of TEX/LATEX. They are merged with the default TEX message parsers for the text() method. See the constructur description for details on the default TEX message parsers.
The text() method returns a textbox instance, which is a special canvas instance. It has the methods width(), height(), and depth() to access the size of the text. Additionally the marker() method, which takes a string s, returns a position in the text, where the expression \PyXMarker{s} is contained in expr. You should not use @ within your strings s to prevent prevent name clashes with PyX internal macros (although we don't the marker feature internally right now).
Note that for the outout generation and the marker access the TEX/LATEX instance must be terminated except when texipc is turned on. However, after such a termination a new TEX/LATEX instance is started when the text() method is called again.
| reinit=0) |