Skip to main content

Convert LaTeX or TeX source to PDF or DVI, and escape strings for LaTeX.

Project description

This is a convenient interface to the TeX command line tools that handles all kinds of errors without much fuzz. Temporary files are always cleaned up. Whenever there are issues with the TeX source, an exception that contains all information of the TeX log will be thrown.

Example:

>>> from tex import latex2pdf
>>> document = ur"""
... \documentclass{article}
... \begin{document}
... Hello, World!
... \end{document}
... """
>>> pdf = latex2pdf(document)
>>> type(pdf)
<type 'str'>
>>> print "PDF size: %.1f KB" % (len(pdf) / 1024.0)
PDF size: 5.6 KB
>>> pdf[:5]
'%PDF-'
>>> pdf[-6:]
'%%EOF\n'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tex, version 1.6
Filename, size File type Python version Upload date Hashes
Filename, size tex-1.6.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View
Filename, size tex-1.6-py2.5.egg (8.3 kB) File type Egg Python version 2.5 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page