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.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nantex-0.1.9.tar.gz | 14.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nantex-0.1.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.9 kB
Release files / nantex-0.1.9.tar.gz
| Download URL | nantex-0.1.9.tar.gz |
|---|---|
| Size | 14.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55a32007e99a0bd8eb7364ee42aa8513bc2713a75d1092e74682882ebb3cc4c0
|
|
BLAKE2b-256 checksum How to use checksums |
2980714bd3dc8440e973a69ec53697b8c466c0bb6c0a5ac9db87545b4b4a444e
|
| 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.9-py3-none-any.whl
| Download URL | nantex-0.1.9-py3-none-any.whl |
|---|---|
| Size | 17.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fca0930f5aee5dff012b42ad8568fab1042994cd98bf3801e6f8eb76e4c1d9ef
|
|
BLAKE2b-256 checksum How to use checksums |
f2fbf08b53336a210d3107282da867492cb667cae8ca8f0a45cfda00e0327cff
|
| 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}
|
Security for nantex 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.