A lightweight Python wrapper for TinyTeX - blazing-fast install, compile, and auto-manage packages
Project description
jettex
A lightweight Python wrapper for TinyTeX, providing easy LaTeX installation, compilation, and automatic package management.
Features
- Easy Installation: Install TinyTeX with a single function call
- LaTeX Compilation: Compile documents with pdflatex, xelatex, or lualatex
- Automatic Package Installation: Automatically detect and install missing LaTeX packages (like R's tinytex)
- Package Management: Full tlmgr wrapper for installing, removing, and updating packages
- Cross-Platform: Works on Windows, macOS, and Linux
Installation
pip install jettex
Quick Start
import jettex
# Install TinyTeX (only needed once)
jettex.install_tinytex()
# Compile a document with automatic package installation
result = jettex.compile_tex("document.tex")
if result.success:
print(f"PDF created: {result.output_file}")
Usage
Installing TinyTeX
import jettex
# Install default version (~90 packages)
jettex.install_tinytex()
# Install minimal version (no packages)
jettex.install_tinytex(version=0)
# Install extended version (more packages)
jettex.install_tinytex(version=2)
# Force reinstall
jettex.install_tinytex(force=True)
# Check if installed
if jettex.is_tinytex_installed():
print(f"TinyTeX is at: {jettex.tinytex_root()}")
Compiling Documents
import jettex
# Compile with auto-install (recommended)
# Automatically installs missing packages
result = jettex.compile_tex("document.tex")
# Use a specific engine
result = jettex.compile_tex("document.tex", engine="xelatex")
result = jettex.compile_tex("document.tex", engine="lualatex")
# Compile without auto-install
result = jettex.pdflatex("document.tex")
result = jettex.xelatex("document.tex")
result = jettex.lualatex("document.tex")
# Use latexmk for complex documents
result = jettex.latexmk("document.tex", engine="pdflatex")
# Check result
if result.success:
print(f"Output: {result.output_file}")
else:
print(f"Failed: {result.stderr}")
Package Management
import jettex
# Install packages
jettex.tlmgr_install(["geometry", "amsmath", "hyperref"])
# Remove packages
jettex.tlmgr_remove(["unused-package"])
# Update all packages
jettex.tlmgr_update(all_packages=True)
# Update tlmgr itself
jettex.tlmgr_update(self_update=True)
# List installed packages
packages = jettex.tlmgr_list()
# Search for a package
results = jettex.tlmgr_search("tikz")
# Find which package provides a file
package = jettex.find_package_for_file("geometry.sty")
Command Line Interface
jettex also provides a CLI:
# Install TinyTeX
jettex install
# Compile a document
jettex compile document.tex
# Compile with specific engine
jettex compile document.tex --engine xelatex
# Install packages
jettex install-pkg geometry amsmath
# Search for packages
jettex search tikz
# List installed packages
jettex list
# Update all packages
jettex update --all
# Show TinyTeX info
jettex info
TinyTeX Versions
| Version | Description | Size |
|---|---|---|
| 0 | Infraonly (minimal, no packages) | ~1 MB |
| 1 | Default (~90 common packages) | ~100 MB |
| 2 | Extended (more packages) | ~200+ MB |
Comparison with R's tinytex
This package aims to provide feature parity with R's tinytex:
| Feature | R tinytex | jettex |
|---|---|---|
| Install TinyTeX | ✅ | ✅ |
| Compile LaTeX | ✅ | ✅ |
| Auto-install packages | ✅ | ✅ |
| tlmgr wrapper | ✅ | ✅ |
| Cross-platform | ✅ | ✅ |
Requirements
- Python 3.8+
requestslibrary (for downloading TinyTeX)
License
MIT License
TinyTeX itself is licensed under GPL-2.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jettex-0.0.1.tar.gz.
File metadata
- Download URL: jettex-0.0.1.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3f044597c93a9af32c2857fcc4f1f690862c14189e7db10faab421ba5292b3a
|
|
| MD5 |
5aadfa8258a591822a11aacb9af137d2
|
|
| BLAKE2b-256 |
c0482cc74c6ad254267dc7e7a21f7b2e2aa35d82430790db1d31bd6fa94527d6
|
Provenance
The following attestation bundles were made for jettex-0.0.1.tar.gz:
Publisher:
ci.yml on gauranshkumar/jettex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jettex-0.0.1.tar.gz -
Subject digest:
e3f044597c93a9af32c2857fcc4f1f690862c14189e7db10faab421ba5292b3a - Sigstore transparency entry: 775744317
- Sigstore integration time:
-
Permalink:
gauranshkumar/jettex@20c9c8decc8aaedaa4dd9e92ff642c0d1fc3521d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/gauranshkumar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@20c9c8decc8aaedaa4dd9e92ff642c0d1fc3521d -
Trigger Event:
push
-
Statement type:
File details
Details for the file jettex-0.0.1-py3-none-any.whl.
File metadata
- Download URL: jettex-0.0.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb4e9d718edc8daefa92b1d4ebca8e79b4ba264e76ee240299e943773e785863
|
|
| MD5 |
aeeaafd94ac02b7e85d1c0051685a9d5
|
|
| BLAKE2b-256 |
2aee34779038dff702f25382d18534639e73af96ceb692725f9f7573442fdcae
|
Provenance
The following attestation bundles were made for jettex-0.0.1-py3-none-any.whl:
Publisher:
ci.yml on gauranshkumar/jettex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jettex-0.0.1-py3-none-any.whl -
Subject digest:
fb4e9d718edc8daefa92b1d4ebca8e79b4ba264e76ee240299e943773e785863 - Sigstore transparency entry: 775744319
- Sigstore integration time:
-
Permalink:
gauranshkumar/jettex@20c9c8decc8aaedaa4dd9e92ff642c0d1fc3521d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/gauranshkumar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@20c9c8decc8aaedaa4dd9e92ff642c0d1fc3521d -
Trigger Event:
push
-
Statement type: