Skip to main content

MatpLaTeX

MatpLaTeX lets you save a matplotlib Figure as a combination of a pdf file containing the graphics and a LaTeX file containing the text. With this, text in the figure will automatically use the typeface, size and other settings of the surrounding text.

Installation

MatpLaTeX is on PyPI, simply

pip install matplatex

Python requirements:

  • python >= 3.10 (If someone asks I may add support for earlier versions.)
  • matplotlib >= 3.5
  • beartype

LaTeX requirements:

  • tikz
  • graphicx

Basic Usage

To save a figure, simply use

matplatex.save(fig, "myfig")

this will create two files named myfig.pdf and myfig.pdf_tex.

In your LaTeX preamble, add the following

\newlength{\figurewidth}
\newlength{\matplatextmp}

and include the figure as such:

\setlength{\figurewidth}{<your desired width>}
\input{myfig.pdf_tex}

LaTeX commands such as \small and \textbf{} will affect the text in the expected way.

Options

See the docstring of matplatex.save() for information on optional arguments. A proper documentation is coming eventually.

Metadata

Release files for matplatex 0.10.2

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

Source distribution (sdist)

Source distribution for matplatex 0.10.2
File Size Uploaded Provenance Actions
matplatex-0.10.2.tar.gz 23.8 kB With provenance Details for matplatex-0.10.2.tar.gz

Built distribution (wheel)

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

Total release size: 48.6 kB

Release files / matplatex-0.10.2.tar.gz

Download URL matplatex-0.10.2.tar.gz
Size 23.8 kB
Tags Source
SHA-256 checksum
How to use checksums
98097939a87515ae4b73578192753d2584e1d61ebdc2de9e53a01448c8fd349f
BLAKE2b-256 checksum
How to use checksums
ff27ac78cc82f86ad60ca95a46076e73119e44f49f86ed4ee53f1419fcfd3d50
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 Nov 23, 2026.

Transparency log

Release files / matplatex-0.10.2-py3-none-any.whl

Download URL matplatex-0.10.2-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2b1322a1488b1ab04025a6b9139b7d62e33c12f01d26544d952aaca9470cc5a
BLAKE2b-256 checksum
How to use checksums
02c7eb9e499d1c42896ef26dc9d45c0e645b6d137a85eb9050db330d31368672
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 Nov 23, 2026.

Transparency log

Security for matplatex 0.10.2

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for matplatex-0.10.2.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 Nov 23, 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