Skip to main content

Documentation can be found at https://pythonhosted.org/latex .

Allows calling LaTeX from Python without leaving a mess. Similar to the (officially obsolete) tex package, whose successor is not PyPi-installable:

min_latex = (r"\documentclass{article}"
             r"\begin{document}"
             r"Hello, world!"
             r"\end{document}")

from latex import build_pdf

# this builds a pdf-file inside a temporary directory
pdf = build_pdf(min_latex)

# look at the first few bytes of the header
print bytes(pdf)[:10]

Also comes with support for using Jinja2 templates to generate LaTeX files.

make_env can be used to create an Environment that plays well with LaTex:

Variables can be used in a LaTeX friendly way: Hello, \VAR{name|e}.

Note that autoescaping is off. Blocks are creating using the block macro:

\BLOCK{if weather is 'good'}
Hooray.
\BLOCK{endif}

\#{comments are supported as well}
%# and so are line comments

To keep things short, line statements can be used:

%- if weather is good
Yay.
%- endif

Download files

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

Source Distribution

latex-0.5.5.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file latex-0.5.5.tar.gz.

File metadata

  • Download URL: latex-0.5.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for latex-0.5.5.tar.gz
Algorithm Hash digest
SHA256 c2f6145e885a17037fe91a6ce6718d821db8fba71ffa102349387401ec9d9f20
MD5 fa35dc3130ccddbbbd6db33d42ba46b1
BLAKE2b-256 267ccdecd7dd795eb27bd4e57d428c261d5f06b354e101dbcd23f5f6eb7c2012

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.0

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

This release

0.5.5 This release

1 file

0.5.4

1 file

0.5.3

1 file

0.5.2

1 file

0.5

1 file

0.4

1 file

0.3

1 file

0.1dev

Supported by

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