Skip to main content

TeXPatch (Python)

TeXPatch fixes small TeX/LaTeX quirks in Markdown so it renders cleanly in KaTeX/MathJax.

This is a minimal Python port with a safe, local transform and a CLI.

Install

pip install texpatch

Usage

API:

from texpatch import convert
print(convert('f(x)=|x|'))  # f(x)=\lvert x\rvert

CLI:

echo "f(x)=|x|" | python -m texpatch

Notes:

  • Guardrails: does not modify fenced or inline code.
  • For fuller rule coverage see the JavaScript library texpatch.

Metadata

Release files for texpatch 0.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 texpatch 0.1.1
File Size Uploaded
texpatch-0.1.1.tar.gz 1.9 kB Details

Built distribution (wheel)

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

Total release size: 3.5 kB

Release files / texpatch-0.1.1.tar.gz

Download URL texpatch-0.1.1.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
efa067eeab8a02e365d79016d5baa6224794adf48b244b3db91ade5a527c5db6
BLAKE2b-256 checksum
How to use checksums
6e9d6b2decca14a257c880a158a6678631c1d3760bb51e9a9c8259e645e9b107
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / texpatch-0.1.1-py3-none-any.whl

Download URL texpatch-0.1.1-py3-none-any.whl
Size 1.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cfbec6ad0579d16f28217ea3cb10d41ff0da0b3c89db4e789a922c8aa5270dc5
BLAKE2b-256 checksum
How to use checksums
9825d0913db04a46c52d2be20067da83cfbdc70da2e2d6b8da8982402fa722a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

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