Skip to main content

Description

Tex2im is a simple tool that converts LaTeX formulas into high resolution pixmap graphics for inclusion in text processors or presentations. The original script written by Andreas Reigber in bash, and his official releases are still available at http://www.nought.de/tex2im.php.

Version 2.0 was a complete rewrite in Python. While the Python script shares the same interface (it accepts mostly the same command line options), it does not share any code, other than the convert command that is ran to generate the final image.

Examples:

These examples were written by Andreas Reigber for his original script, and they still work with version 2.

Let's play around in the examples directory. Just type:

> tex2im examples/example1.tex

And you'll get a nice formula in a file named "example1.png" If you need color, look at example 2:

> tex2im -b yellow -t blue examples/example2.tex

This time, the result is a color formula.

> tex2im "\sum_{i=0}^5 x_i^2"

generates a file named 'out.png', containing the formula

> tex2im *.tex

this is how multiple files can be processed.

Note that example4.tex needs the '-n' (no-formula) option when processed.

You can place additional preamble lines in the file '~/.tex2im_preamble'. These will be appended to the preamble that gets generated before running latex.

The transparency implementation of imagemagic has some problems in combination with antialiasing. Therefore, by default, antialiasing is off in transparent mode. If you switch it on via the -a flag you can expect pixels with something between background and text color around the letters. This can look good if the background used in tex2im and the one of your document are identical, but also very bad if this is not the case. True antialising with transparency seems not to be possible. Just play around a bit to find the optimal settings.

Installation:

To use tex2im, you need pdflatex and convert (part of image magic) installed. For color support, also the latex color style is needed. You can install tex2im with pip

> pip3 install tex2im

or just copy the tex2im file in this repository to a directory in your PATH.

> cp tex2im/tex2im /path/of/your/choice
> chmod 755 /path/of/your/choice/tex2im

Release files for tex2im 2.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tex2im 2.5.1
File Size Uploaded
tex2im-2.5.1.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tex2im 2.5.1
File Interpreter ABI Platform
tex2im-2.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / tex2im-2.5.1.tar.gz

Download URL tex2im-2.5.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96f48551fe19809d1c48774dbbabce526a1e65623398b07748e07e5045cae86d
BLAKE2b-256 checksum
How to use checksums
92890889ee9bdc0ac88995c477bc0da47a9c75747c32de9f2e62e9c58638b42c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Release files / tex2im-2.5.1-py3-none-any.whl

Download URL tex2im-2.5.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
326c05acf15e69d4492bbad911c73f0ee82838687d921e7f30753306715586d6
BLAKE2b-256 checksum
How to use checksums
79eee725841aedec574d49218b4ce3c773d0d4ed7f08cf41e5e5ca1b9397fbfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.10

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 release files

2.5.0

2 release files

2.4

1 release file

2.3

1 release file

2.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page