nantex
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 to PDF and exit (no preview)
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
nantex --version # print the installed version
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 to PDF and exit; no preview server or browser |
--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 |
--version |
— | Print the installed version and exit |
One-shot builds
--once compiles to PDF and exits. It starts no preview server, opens no browser and needs no free port, so it fits scripts, pre-commit hooks and CI:
nantex resume.tex --once --output dist/resume.pdf
It exits 0 when the PDF is written and 1 on a lint error, compile error or missing --snippet target, so a failed build fails the job. --share is ignored with --once.
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(content, compiler, api_url)compiles once and returnssuccess,pdf_path(a temp file),errorsandmessage. It never raises and never starts a preview.get_compile_status()returns the result of the last compile.
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.
Development
uv sync
uv run pytest
Every merge to main publishes a patch release to PyPI (.github/workflows/publish.yml); site-only changes don't.
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.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nantex-0.1.7.tar.gz | 14.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nantex-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / nantex-0.1.7.tar.gz
| Download URL | nantex-0.1.7.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2980ff3c0279e4f95bc7bcc9ed7d1c211e6f6fa69ec2f3be27a05696d6e855f
|
|
BLAKE2b-256 checksum How to use checksums |
e1dd7350b9a220306643372595480bc4ab45fe472aded674e67f13be9abfceb4
|
| 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.7-py3-none-any.whl
| Download URL | nantex-0.1.7-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
881128ae9833aa804913e8f0f103a0b216a3b1cb5432ec043d154d382fbc3c36
|
|
BLAKE2b-256 checksum How to use checksums |
217990b72deaf2efc7e357d0124e1e822c7124d3b80afb894c6f8f7e4b9b63b9
|
| 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}
|