Skip to content
Python wrapper around pdflatex
Python TeX
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin relative imports Oct 15, 2015
pydflatex stop using string module Oct 21, 2015
test missing fls file used in tests Mar 25, 2016
.gitignore ignoring pdf files Feb 8, 2010 add license Aug 24, 2013 install section in readme Feb 24, 2016
requirements.txt remove nose as requirement Feb 24, 2016
screenshot.png update screenshot Sep 17, 2011 fix encoding Feb 24, 2016

pydflatex: a simple LaTeX wrapper

pydflatex is a wrapper around pdflatex which produces a short, readable, coloured output. Specifically, pydflatex

  • runs pdflatex/xelatex blazingly fast using the -batchmode option
  • prints out a coloured, short summary of the warnings and errors
  • hides the temporary files in various ways
  • opens the pdf file if needed



pydflatex file.tex

Some useful options:

  • -x: run xelatex instead of pdflatex
  • -k: keep compiling on error
  • -o: open the pdf in a pdf viewer
  • -l: only parse existing log

A full list of options is available by running pydflatex --help.


You can install pydflatex by running

pip install -e "git+"
pip install blessings

Using as a Library

pydflatex is a collection of several independent modules to typeset the file, analyze its log, hiding the auxilliary files, etc. It is easy to write a simple python script that calls either one of those modules and does exactly what you want in your project.

For instance, to run a given file with xelatex you can call:

from pydflatex import Typesetter
t = Typesetter(options={'xetex'=True})

In order to just print the summary of the log:

from pydflatex import LogProcessor
l = LogProcessor()

Feel free to check out the other modules inside the pydflatex folder.


  • blessings (optional but strongly advised): to display results in colour
You can’t perform that action at this time.