# 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:
```py
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`.
Raw data
{
"_id": null,
"home_page": null,
"name": "texpatch",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "cli, katex, latex, markdown, mathjax, obsidian, quarto, tex",
"author": "Pak Kin Lau",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/6e/9d/6b2decca14a257c880a158a6678631c1d3760bb51e9a9c8259e645e9b107/texpatch-0.1.1.tar.gz",
"platform": null,
"description": "# TeXPatch (Python)\n\nTeXPatch fixes small TeX/LaTeX quirks in Markdown so it renders cleanly in KaTeX/MathJax.\n\nThis is a minimal Python port with a safe, local transform and a CLI.\n\n## Install\n\n```\npip install texpatch\n```\n\n## Usage\n\nAPI:\n\n```py\nfrom texpatch import convert\nprint(convert('f(x)=|x|')) # f(x)=\\lvert x\\rvert\n```\n\nCLI:\n\n```\necho \"f(x)=|x|\" | python -m texpatch\n```\n\nNotes:\n- Guardrails: does not modify fenced or inline code.\n- For fuller rule coverage see the JavaScript library `texpatch`.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fix TeX/LaTeX quirks in Markdown for KaTeX/MathJax (Python minimal).",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/pakkinlau/TeXPatch",
"Issues": "https://github.com/pakkinlau/TeXPatch/issues",
"Source": "https://github.com/pakkinlau/TeXPatch"
},
"split_keywords": [
"cli",
" katex",
" latex",
" markdown",
" mathjax",
" obsidian",
" quarto",
" tex"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9825d0913db04a46c52d2be20067da83cfbdc70da2e2d6b8da8982402fa722a7",
"md5": "b3846f74a5fbf5ed2cb259ee1091b9d1",
"sha256": "cfbec6ad0579d16f28217ea3cb10d41ff0da0b3c89db4e789a922c8aa5270dc5"
},
"downloads": -1,
"filename": "texpatch-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b3846f74a5fbf5ed2cb259ee1091b9d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1580,
"upload_time": "2025-10-21T12:54:50",
"upload_time_iso_8601": "2025-10-21T12:54:50.461699Z",
"url": "https://files.pythonhosted.org/packages/98/25/d0913db04a46c52d2be20067da83cfbdc70da2e2d6b8da8982402fa722a7/texpatch-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6e9d6b2decca14a257c880a158a6678631c1d3760bb51e9a9c8259e645e9b107",
"md5": "06f8fe52f6f8437f2f50a02bc0e2e6d2",
"sha256": "efa067eeab8a02e365d79016d5baa6224794adf48b244b3db91ade5a527c5db6"
},
"downloads": -1,
"filename": "texpatch-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "06f8fe52f6f8437f2f50a02bc0e2e6d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1939,
"upload_time": "2025-10-21T12:54:53",
"upload_time_iso_8601": "2025-10-21T12:54:53.436347Z",
"url": "https://files.pythonhosted.org/packages/6e/9d/6b2decca14a257c880a158a6678631c1d3760bb51e9a9c8259e645e9b107/texpatch-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-21 12:54:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pakkinlau",
"github_project": "TeXPatch",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "texpatch"
}