plasTeX 3.0 — A Python Framework for Processing LaTeX Documents

C.2 Using the python debugger

For more drastic debugging, the debugplastex package also provides the command settrace to drop into the python debugger while parsing. You can also use \usepackage[post_parse_trace]{debugplastex} to ask plasTeXto drop into the python debugger after parsing the full LaTeX input. You can also use the --debug command line option for a similar result without changing the source file.

When using Jinja2 templates with a renderer extending PageTemplate, you can also use {{ debug() }} in a template in order to drop into the python debugger while rendering the template. In particular this allows to inspect obj which contains the node being rendered and config which contains the current plasTeX configuration.