Process LaTeX files from python