Skip to main content

nantex

PyPI version Python License: MIT

LaTeX-to-PDF live preview in your browser — no local LaTeX install needed.

Write .tex, save, see the result. That's it.

Website: nantex.nandish.online

How it works

nantex watches your .tex file, compiles it via the latex-on-http public API, and serves the PDF through a local HTTP server with automatic browser refresh via Server-Sent Events. No Overleaf switching. No Skim install. Just your editor and a browser.

Install

# via uv (recommended)
uv tool install nantex

# zero-install run
uvx nantex main.tex

# via pip
pip install nantex

Usage

nantex main.tex                       # watch mode, opens http://localhost:7474
nantex main.tex --once                # compile once and exit
nantex main.tex --port 8080           # custom port
nantex main.tex --compiler xelatex   # use xelatex instead of pdflatex
nantex main.tex --output ~/out.pdf   # custom output path
nantex main.tex --api https://...    # self-hosted latex-on-http instance
nantex main.tex --share              # print LAN URL for collaborators
nantex main.tex --snippet fig:label  # preview a single figure or line range
nantex --mcp                         # run as MCP server for AI agents

Flags

Flag Default Description
--compiler pdflatex LaTeX compiler: pdflatex, xelatex, lualatex
--api https://latex.ytotech.com/builds/sync Compile API endpoint
--output <file>.pdf Output PDF path
--port 7474 Preview server port
--once off Compile once and exit
--share off Print local network URL for live collaboration
--snippet off Compile a label (fig:x) or line range (10-25) in isolation
--mcp off Run as an MCP server for AI agent integration

Project config

Add a .nantex.toml in your project directory to persist settings:

compiler = "xelatex"
port     = 7475

CLI flags always override the config file.

Multi-file projects

nantex automatically detects \input{} and \include{} directives, watches all discovered files, and bundles them in the API call. No extra configuration needed.

Collaboration

nantex main.tex --share
# Preview: http://localhost:7474
# Share:   http://192.168.0.113:7474  ← anyone on your network can open this

MCP server

Run nantex as an MCP server so AI agents (Claude, etc.) can compile LaTeX autonomously:

nantex --mcp

Exposes two tools: compile_latex and get_compile_status.

To wire it into Claude Code, add to .mcp.json:

{
  "mcpServers": {
    "nantex": {
      "command": "uvx",
      "args": ["nantex", "--mcp"]
    }
  }
}

Examples

Ready-to-run examples are in the examples/ folder:

nantex examples/01-hello-world.tex   # minimal quickstart
nantex examples/02-math.tex          # equations, Maxwell's laws, matrices
nantex examples/03-resume.tex        # CV / resume template
nantex examples/04-report.tex        # report with table of contents + tables

Privacy

Your .tex file content is sent to the configured API on every compile. For sensitive documents, run a self-hosted latex-on-http instance and point --api at it.

Website

site/ is the static page at nantex.nandish.online: plain HTML, CSS and JS with no build step. Preview it with uv run python -m http.server -d site 7476. tests/test_site.py fails when a CLI flag, MCP tool or example is missing from the page. .github/workflows/site.yml deploys it on merge and posts a preview URL on pull requests.

License

MIT

Metadata

Release files for nantex 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nantex 0.1.6
File Size Uploaded
nantex-0.1.6.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nantex 0.1.6
File Interpreter ABI Platform
nantex-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / nantex-0.1.6.tar.gz

Download URL nantex-0.1.6.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
60b8efa3e71fdb461b96b8abe9b8778a55e66af0127ef3e6327627ed767bd878
BLAKE2b-256 checksum
How to use checksums
81b76ab429008f3a5afe28f8047aa9d1fc2e6054cefd7e0086f87d712b40554d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nantex-0.1.6-py3-none-any.whl

Download URL nantex-0.1.6-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e832fcf5dab1632d7b7a5a55e7f85aa78cd9fdde0838d993e049cf070573f65
BLAKE2b-256 checksum
How to use checksums
7342865c42fba2ddec7a76bbbd0b364d7ac2f45352798d7abff1dfd2f174e9d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page