{"id":18441418,"url":"https://github.com/jessicategner/pytinytex","last_synced_at":"2026-03-16T00:48:24.915Z","repository":{"id":57457841,"uuid":"439742433","full_name":"JessicaTegner/PyTinyTeX","owner":"JessicaTegner","description":"Thin wrapper for \"TinyTeX\" (MIT)","archived":false,"fork":false,"pushed_at":"2026-03-10T22:51:22.000Z","size":27861,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-10T23:24:12.147Z","etag":null,"topics":["formatting","hacktober","hacktober2022","latex","pandoc","pdf","pdflatex","pypandoc","python","pytinytex","tinytex"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JessicaTegner.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/JessicaTegner","github":"JessicaTegner"}},"created_at":"2021-12-19T00:24:12.000Z","updated_at":"2026-03-10T22:44:14.000Z","dependencies_parsed_at":"2024-05-07T08:42:36.106Z","dependency_job_id":"06126b71-77ef-4fdd-9e6a-fa1761ac405a","html_url":"https://github.com/JessicaTegner/PyTinyTeX","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":"0.43999999999999995","last_synced_commit":"f6ee5ff0052341da14abd744eab89f331798bda9"},"previous_names":["nicklastegner/pytinytex"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/JessicaTegner/PyTinyTeX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JessicaTegner%2FPyTinyTeX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JessicaTegner%2FPyTinyTeX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JessicaTegner%2FPyTinyTeX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JessicaTegner%2FPyTinyTeX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JessicaTegner","download_url":"https://codeload.github.com/JessicaTegner/PyTinyTeX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JessicaTegner%2FPyTinyTeX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30477247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T20:45:58.186Z","status":"ssl_error","status_checked_at":"2026-03-13T20:45:20.133Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["formatting","hacktober","hacktober2022","latex","pandoc","pdf","pdflatex","pypandoc","python","pytinytex","tinytex"],"created_at":"2024-11-06T06:37:28.489Z","updated_at":"2026-03-13T22:02:44.725Z","avatar_url":"https://github.com/JessicaTegner.png","language":"Python","funding_links":["https://paypal.me/JessicaTegner","https://github.com/sponsors/JessicaTegner"],"categories":[],"sub_categories":[],"readme":"# PyTinyTeX\n\n![Build Status](https://github.com/JessicaTegner/PyTinyTeX/actions/workflows/ci.yaml/badge.svg)\n[![PyPI version](https://badge.fury.io/py/pytinytex.svg)](https://pypi.python.org/pypi/PyTinyTeX/)\n[![Development Status](https://img.shields.io/pypi/status/PyTinyTeX.svg)](https://pypi.python.org/pypi/PyTinyTeX/)\n[![Python version](https://img.shields.io/pypi/pyversions/PyTinyTeX.svg)](https://pypi.python.org/pypi/PyTinyTeX/)\n![License](https://img.shields.io/pypi/l/PyTinyTeX.svg)\n\nThe easiest way to go from `.tex` to `.pdf` in Python. PyTinyTeX wraps [TinyTeX](https://yihui.org/tinytex) — a lightweight, cross-platform, portable LaTeX distribution based on TeX Live — and gives you compilation, package management, and diagnostics from Python or the command line.\n\n```python\nimport pytinytex\n\npytinytex.download_tinytex()\nresult = pytinytex.compile(\"paper.tex\", auto_install=True)\nprint(result.pdf_path)  # paper.pdf\n```\n\nNo system-wide TeX installation required. Missing packages are installed automatically.\n\n---\n\n## Installation\n\n```\npip install pytinytex\n```\n\nPython 3.8+ on Linux, macOS, and Windows.\n\n## Quick start\n\n### 1. Get TinyTeX\n\n```python\nimport pytinytex\n\n# Download the default variation (variation 1: ~90 common LaTeX packages)\npytinytex.download_tinytex()\n\n# Or pick a variation:\n#   0 — infrastructure only, no packages\n#   1 — common packages (default)\n#   2 — extended package set\npytinytex.download_tinytex(variation=2)\n\n# Track download progress\npytinytex.download_tinytex(progress_callback=lambda downloaded, total: print(f\"{downloaded}/{total} bytes\"))\n```\n\n### 2. Compile a document\n\n```python\nresult = pytinytex.compile(\"paper.tex\")\n\nif result.success:\n    print(\"PDF at:\", result.pdf_path)\nelse:\n    for error in result.errors:\n        print(f\"  ! {error.message} (line {error.line})\")\n```\n\nMulti-pass compilation for cross-references and TOC:\n\n```python\nresult = pytinytex.compile(\"paper.tex\", num_runs=2)\n```\n\nChoose your engine:\n\n```python\nresult = pytinytex.compile(\"paper.tex\", engine=\"xelatex\")\nresult = pytinytex.compile(\"paper.tex\", engine=\"lualatex\")\n```\n\n### 3. Auto-install missing packages\n\nThe killer feature: if your document needs a package you don't have, PyTinyTeX can find it, install it, and retry — all in one call:\n\n```python\nresult = pytinytex.compile(\"paper.tex\", auto_install=True)\nprint(result.installed_packages)  # e.g. ['booktabs', 'pgf']\n```\n\n## Package management\n\nFull access to the TeX Live package manager (tlmgr):\n\n```python\nimport pytinytex\n\npytinytex.install(\"booktabs\")\npytinytex.remove(\"booktabs\")\n\n# List installed packages (returns list of dicts)\nfor pkg in pytinytex.list_installed():\n    print(pkg[\"name\"])\n\n# Search for packages\npytinytex.search(\"amsmath\")\n\n# Detailed package info (returns dict)\npytinytex.info(\"booktabs\")\n\n# Update all packages\npytinytex.update()\n\n# TeX Live version\npytinytex.get_version()\n```\n\n## Engine discovery\n\nLocate LaTeX engine executables (variation 1+):\n\n```python\npytinytex.get_engine(\"pdflatex\")   # full path to the executable\npytinytex.get_engine(\"xelatex\")\npytinytex.get_engine(\"lualatex\")\n\n# Convenience shortcuts\npytinytex.get_pdflatex_engine()\npytinytex.get_xelatex_engine()\npytinytex.get_lualatex_engine()\n```\n\n## LaTeX log parser\n\nParse any LaTeX `.log` file into structured data — useful even outside PyTinyTeX:\n\n```python\nfrom pytinytex import parse_log\n\nwith open(\"paper.log\") as f:\n    parsed = parse_log(f.read())\n\nfor error in parsed.errors:\n    print(f\"{error.file}:{error.line}: {error.message}\")\n\nfor warning in parsed.warnings:\n    print(warning.message)\n\n# Missing .sty packages detected automatically\nprint(parsed.missing_packages)  # e.g. ['tikz', 'booktabs']\n```\n\n## Health check\n\nDiagnose your TinyTeX installation:\n\n```python\nresult = pytinytex.doctor()\nfor check in result.checks:\n    status = \"PASS\" if check.passed else \"FAIL\"\n    print(f\"  [{status}] {check.name}: {check.message}\")\n```\n\nChecks: TinyTeX installed, PATH configured, tlmgr functional, engine availability.\n\n## Command-line interface\n\nEvery feature is also available from the terminal:\n\n```bash\n# Download TinyTeX\npytinytex download\npytinytex download --variation 2\n\n# Compile a document\npytinytex compile paper.tex\npytinytex compile paper.tex --engine xelatex --runs 2 --auto-install\n\n# Package management\npytinytex install booktabs\npytinytex remove booktabs\npytinytex list\npytinytex search amsmath\npytinytex info booktabs\npytinytex update\n\n# Diagnostics\npytinytex doctor\npytinytex version\n\n# Also works as a Python module\npython -m pytinytex doctor\n```\n\n## Integrating with pypandoc\n\nPyTinyTeX pairs naturally with [pypandoc](https://pypi.org/project/pypandoc/) for converting Markdown, HTML, and other formats to PDF:\n\n```python\nimport pytinytex\nimport pypandoc\n\npdflatex_path = pytinytex.get_pdflatex_engine()\npypandoc.convert_file(\"input.md\", \"pdf\", outputfile=\"output.pdf\",\n                      extra_args=[\"--pdf-engine\", pdflatex_path])\n```\n\n## Uninstalling TinyTeX\n\n```python\npytinytex.uninstall()  # removes the TinyTeX directory\n```\n\nOr from the CLI:\n\n```bash\npytinytex uninstall\n```\n\n## Contributing\n\nContributions are welcome. When opening a PR, please keep the following guidelines in mind:\n\n1. Before implementing, please open an issue for discussion.\n2. Make sure you have tests for the new logic.\n3. Add yourself to contributors in this README unless you are already there.\n\n## Contributors\n\n* [Jessica Tegner](https://github.com/JessicaTegner) — Maintainer and original creator of PyTinyTeX\n\n## License\n\nPyTinyTeX is available under the MIT license. See [LICENSE](https://raw.githubusercontent.com/JessicaTegner/PyTinyTeX/master/LICENSE) for more details. TinyTeX itself is available under the GPL-2 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessicategner%2Fpytinytex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjessicategner%2Fpytinytex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjessicategner%2Fpytinytex/lists"}