Skip to content

Installing TinyTeX

This guide covers all aspects of installing and managing your TinyTeX installation.

Basic Installation

import jettex

# Install with default settings
jettex.install_tinytex()

Installation Options

Version Selection

TinyTeX comes in three versions:

# Minimal - no packages, smallest size (~1 MB)
jettex.install_tinytex(version=0)

# Default - ~90 common packages (~100 MB)
jettex.install_tinytex(version=1)

# Extended - more packages (~200+ MB)
jettex.install_tinytex(version=2)

Custom Installation Directory

from pathlib import Path

# Install to a custom location
jettex.install_tinytex(install_dir=Path("/opt/tinytex"))

Force Reinstall

# Remove existing installation and reinstall
jettex.install_tinytex(force=True)

Progress Callback

Track download and installation progress:

def progress(stage, downloaded, total):
    if stage == "downloading":
        pct = (downloaded / total) * 100 if total > 0 else 0
        print(f"Downloading: {pct:.1f}%")
    elif stage == "extracting":
        print("Extracting...")
    elif stage == "installing":
        print("Installing...")
    elif stage == "complete":
        print("Done!")

jettex.install_tinytex(progress_callback=progress)

Checking Installation Status

import jettex

# Check if TinyTeX is installed
if jettex.is_tinytex_installed():
    print("TinyTeX is installed")

    # Get installation directory
    print(f"Location: {jettex.tinytex_root()}")

    # Get version information
    print(f"Version: {jettex.tinytex_version()}")
else:
    print("TinyTeX is not installed")

Uninstalling TinyTeX

# Remove TinyTeX completely
success = jettex.uninstall_tinytex()

if success:
    print("TinyTeX has been uninstalled")

PATH Management

TinyTeX binaries are automatically added to PATH when you use jettex functions. You can also manage this manually:

# Ensure TinyTeX is in PATH
jettex.ensure_tinytex_in_path()

# Get the bin directory
bin_dir = jettex.get_bin_dir()
print(f"Binaries are at: {bin_dir}")

# Get path to a specific executable
pdflatex = jettex.get_executable("pdflatex")
print(f"pdflatex is at: {pdflatex}")

Using tlmgr path

You can also use tlmgr to manage PATH persistently:

# Add TinyTeX to system PATH
jettex.tlmgr_path("add")

# Remove from system PATH
jettex.tlmgr_path("remove")

CLI Installation

Install TinyTeX from the command line:

# Install default version
jettex install

# Install specific version
jettex install --version 0

# Install to custom directory
jettex install --dir /opt/tinytex

# Force reinstall
jettex install --force

Troubleshooting

Download Failures

If download fails, check your internet connection and try again:

jettex.install_tinytex(force=True)

Disk Space

Ensure you have enough disk space:

  • Version 0: ~5 MB
  • Version 1: ~300 MB (compressed: ~100 MB)
  • Version 2: ~600 MB (compressed: ~200 MB)

Permissions

TinyTeX doesn't require admin privileges. If you get permission errors, check that you have write access to the installation directory.