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. The TeX interpreter is automatically re-run as often as necessary, and an exception is thrown in case the output fails to stabilize soon enough. The TeX interpreter is always run in batch mode, so it won’t ever get in your way by stopping your application when there are issues with your TeX source. Instead, an exception is thrown that contains all information of the TeX log.

This enables you to debug TeX related issues directly within your application or within an interactive Python interpreter session.

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.

Source Distribution

tex-1.7.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tex-1.7-py2.5.egg (8.9 kB view details)

Uploaded Egg

File details

Details for the file tex-1.7.tar.gz.

File metadata

  • Download URL: tex-1.7.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tex-1.7.tar.gz
Algorithm Hash digest
SHA256 1ad7500183519e151b6fa086bb8591bcf99ab0cf9d414b88edd37716b3601a04
MD5 9dd04b9178ebdec97aaad9748f124cb3
BLAKE2b-256 d74e4dc81e8fe95ab9d81aec7f481df1a9d8a11c054ccf322a74000bf86c4003

See more details on using hashes here.

File details

Details for the file tex-1.7-py2.5.egg.

File metadata

  • Download URL: tex-1.7-py2.5.egg
  • Upload date:
  • Size: 8.9 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tex-1.7-py2.5.egg
Algorithm Hash digest
SHA256 62c3ef9da74e6e36c2a9a1a28dd0fb785877e2b713d673f7aaba46bced052d13
MD5 13263ea16b0ed467aed5adfbb5a7dbd2
BLAKE2b-256 fe7c62af35c48e5a5524f19da7eeba1f039e3c77ff9feb8a2a9cf23f73542f30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page