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. Math in labels is typeset by mathra. Try it in the browser.

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.

Triangle with an angle arc and a height
Triangle with an angle arc and a height
Unit circle with polar points
Unit circle with polar points
pgfplots: expressions, marks and a legend
pgfplots: expressions, marks and a legend
Flowchart with positioning
Flowchart with positioning
zigzag, snake and random steps
zigzag, snake and random steps
Bar chart from a foreach
Bar chart from a foreach

Paths, nodes and shapes, positioning and calc, \foreach, scopes and styles, xcolor, arrow tips, patterns, decorations and pgfplots basics. 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.0

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.0
File Size Uploaded Provenance
tikra-1.1.0.tar.gz 641.8 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tikra 1.1.0
File
tikra-1.1.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
tikra-1.1.0-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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
tikra-1.1.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
tikra-1.1.0-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.0.tar.gz

Download URL tikra-1.1.0.tar.gz
Size 641.8 kB
Tags Source
SHA-256 checksum
How to use checksums
74596588681b0a2656a178f4230e86a300711fa78e1e65cccbdf43580b9e63d4
BLAKE2b-256 checksum
How to use checksums
b46fedbe1677f8e16c30debf3524115c28d61408d7aa253f1d9e94c1fce0af83
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.0-cp39-abi3-win_amd64.whl

Download URL tikra-1.1.0-cp39-abi3-win_amd64.whl
Size 4.8 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
97ee91323c38111cebbdc57c416f7a4a18c7d8667630c94c42ffa80d9aa2e925
BLAKE2b-256 checksum
How to use checksums
51b65389d11a0cf95c4629df6029b09695bfea74ef53f9ba8c55d5e554380e46
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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tikra-1.1.0-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
767ff4efd589ae2786dfde67a83ae9cd812170261adb5aff0ef4822746400482
BLAKE2b-256 checksum
How to use checksums
191c4f967b0a704d7ccd0da3ca92a6423e89a1c8c5dfd38fb0e4b793de53ee0a
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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tikra-1.1.0-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
447e15fc522f701b080e19e89a29441bf2411ed3e13c3416fc5ac36f16009244
BLAKE2b-256 checksum
How to use checksums
b3b995979ab93ed792f739a74f1c85e851c2ea7f8652abe6773e83271c73ef55
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.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL tikra-1.1.0-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
a63ad27feb991fe27b5b9908dfffa7237aa96951ad59102d7c9fdf7a6baeb656
BLAKE2b-256 checksum
How to use checksums
4453117871b1709a404c37fa387d90f054ec54d647fedb403b327394d4cd65f9
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.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL tikra-1.1.0-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
98d87e09b4b3d612379b716c340cd6f0dbab4646d43b1859634d8ff8cb4b8a2c
BLAKE2b-256 checksum
How to use checksums
9ca3b40d99e8d127e68881156243d0250851bde6cd275a0965c07350cbca2367
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.0

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.0.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