Skip to main content

tikra: TikZ to SVG and PNG, no TeX install

tikra

TikZ and pgfplots figures to SVG and PNG, without a TeX install: no LaTeX, no fonts on the system, no external processes. It reimplements TikZ, pgf and pgfplots, and labels are set by mathra in Latin Modern, TeX's own Computer Modern. Try it in the browser · See the gallery.

pip install tikra

Wheels for Linux, macOS and Windows, for Python 3.9 and later; nothing else to install.

Usage

import tikra

svg = tikra.tikz_to_svg(r"""
\begin{tikzpicture}
  \draw[->] (0,0) -- (2,1) node[right] {$\vec v$};
\end{tikzpicture}
""")
open("v.svg", "w", encoding="utf-8").write(svg)
open("v.png", "wb").write(tikra.png(svg, dpi=300))

r = tikra.render(r"\tikz \draw (0,0) circle (1);")
r["warnings"]      # [] — what tikra skips or approximates is listed here, and the rest is drawn
tikz_to_svg(code) The SVG as a string.
render(code) A dict: svg and warnings (a list of strings).
png(svg, *, dpi=300, background=True) PNG bytes; background=False keeps it transparent instead of white.

code is a full standalone document, a bare tikzpicture, an inline \tikz, an axis environment or loose TikZ statements. Errors (no figure in the input, an invalid dpi, a PNG past 100 megapixels) are ValueError. Types are included (py.typed).

What it draws

Every image below is an SVG written by tikra from a figure in the repository's corpus, on a white card; the gallery has all 227. Of the 2502 figures of the TikZ and pgfplots manuals, tikra draws 93.1% as TeX does (95.4% of the ones a converter can reproduce): docs/conformance.md.

The Lorenz attractor, colored by height
The Lorenz attractor, colored by height
Nightingale's rose of the causes of mortality
Nightingale's rose of the causes of mortality
The bell curve and the 68–95–99.7 rule
The bell curve and the 68–95–99.7 rule
The Petersen graph
The Petersen graph
A Feynman diagram, with decorations
A Feynman diagram, with decorations
The golden spiral
The golden spiral
The periodic table, by family
The periodic table, by family
A pgfplots surface and its colorbar
A pgfplots surface and its colorbar

Paths, nodes and every shape library, matrices, trees, graphs, mind maps, automata, circuits, arrow tips, shadings, fadings, patterns, decorations, pgfplots in 2D and 3D (polar, ternary, Smith charts, fill between, colormaps) and data visualization. What tikra does not understand becomes a warning, never a failure: the full subset is in spec/subset.md.

Also for JavaScript, Rust and the terminal

The same core is an npm package (@mathlabs/tikra), a Rust crate and a command-line tool: github.com/matheusmota-dev-br/tikra.

License

The code is MIT or Apache-2.0; the fonts embedded through mathra are Latin Modern Math, under the GUST Font License, and STIX Two Math, under the SIL Open Font License 1.1.

Metadata

Release files for tikra 1.1.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 tikra 1.1.1
File Size Uploaded Provenance
tikra-1.1.1.tar.gz 643.5 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tikra 1.1.1
File
tikra-1.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
tikra-1.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
tikra-1.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
tikra-1.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
tikra-1.1.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 24.6 MB

Release files / tikra-1.1.1.tar.gz

Download URL tikra-1.1.1.tar.gz
Size 643.5 kB
Tags Source
SHA-256 checksum
How to use checksums
692a4a0b451ba4882a34c97c81af1f003808789ca77caecdc635167aa3c0c77b
BLAKE2b-256 checksum
How to use checksums
1719b6a7be7d5bf75d36fdae79b5151d479838e0104a2d206b7ffccfbda263eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / tikra-1.1.1-cp39-abi3-win_amd64.whl

Download URL tikra-1.1.1-cp39-abi3-win_amd64.whl
Size 4.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
371a3061622a302ca55d8eb13a22e0e9c6686058d5cd96176d7ba3cae2873f21
BLAKE2b-256 checksum
How to use checksums
828570aa07cea48fc774705c4977f67ec3b6757adc7abb49d0414be37c5bf991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / tikra-1.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tikra-1.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
2b57133943c67f6bfce0abaca9404efe9b7c7bc2b1ef244ae9ce29f4b9743607
BLAKE2b-256 checksum
How to use checksums
b9826880f8b3644519d1be1415d3001453acdf6197e0535b97d4ae8497e51299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / tikra-1.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tikra-1.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 4.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3462c4e1cbd19a6d416da8f34dfe20e99ae14edaf1f7eee905e18398f791acdd
BLAKE2b-256 checksum
How to use checksums
fc70929227dba5453582d3e2b426a4ada58163a8dd752e8ec125fc3032997ea0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / tikra-1.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL tikra-1.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 4.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
65cff7b817fc8c39853e7495980ca33150254f66c24d0456c7e0bfb72d6a861f
BLAKE2b-256 checksum
How to use checksums
0818fde1ec8be6be56d7cb1bbfc6bf025f6493601f330c219b9b5d345fafa520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / tikra-1.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL tikra-1.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 4.8 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bc89ed01a097afeb83de33baca5250c0458fa8cbb4c6422e20991a0c5f52eb11
BLAKE2b-256 checksum
How to use checksums
424984a4bfca8bee483e3a4b2d896c3d13983d447b2df72f3cbd00c48bdca976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for tikra 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for tikra-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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