Skip to main content

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+
  • requests library (for downloading TinyTeX)

License

MIT License

TinyTeX itself is licensed under GPL-2.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jettex-0.0.2.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jettex-0.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file jettex-0.0.2.tar.gz.

File metadata

  • Download URL: jettex-0.0.2.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jettex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 07a299bcf52877d65711f8a0e5eee1dc425a66ebbd855400fcd8d9879ba1f195
MD5 6b609f64b8dbef2e32f08450165efe76
BLAKE2b-256 874b1d81926b0bb4edd0ae1bc5b568c6b86465dacf3d08afd880b7a3eb91f2dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for jettex-0.0.2.tar.gz:

Publisher: ci.yml on gauranshkumar/jettex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jettex-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: jettex-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jettex-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 291a3566e2c0ccb81959274b4989567003116d4848ad4bf476fbc800aad7f34b
MD5 a375d7c0f7fc8c0bed3bdc1395775dfe
BLAKE2b-256 60ba6f547a84deb44d84b1bbce4d77c2a6283a8111082bf1842c8fcc43541caf

See more details on using hashes here.

Provenance

The following attestation bundles were made for jettex-0.0.2-py3-none-any.whl:

Publisher: ci.yml on gauranshkumar/jettex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page