SaTeX v0.2.7

SaTeX interprets TeX abstractly, on every path at once. Without compiling, it tells youwhich \macros exist at each line, on every pathwhere each command is defined, and who changed itwhich dash a range like 10-12 needsthe names \csname builds, and their meaningseach expansion step of \twice{ab}where branches you never compiled breakthe category code of each character in \a@b{$x^2$&#1}what package options changethe text of every paragraph, ligatures includedwhat lands in the .aux, and how many runs you needthe macro behind a symbol you sketchwhy it compiled yesterday and not today 🙃that it is open source under the MIT licensethat the author of TikZpingus approves 🐧

Try it in the browser Install Comparison Guide

Click a table, a figure, a color or a length and edit it in place. SaTeX writes the change back as plain LaTeX.

\documentclass{article}
\begin{document}
\section{Results}
Runs took 10-12 s when warm.S020
\vspace{12pt}
\begin{figure}[ht]
  \centering
  \rule{0.6\linewidth}{2cm}
  \caption{The warm cache.}
\end{figure}
\end{document}

A recording. Trying it loads 10 MB, once.

Try it here

Edit this document. Hover a length or the [ht] to see what they mean. The typeset text on the right follows as you type.

The full playground →
Images: Crop, rotate and tint a figure with the mouse. The \includegraphics options change with it.

Images

Crop, rotate and tint a figure with the mouse. The \includegraphics options change with it.

Try it in figure.tex →
TikZ drawings: Drag nodes on a grid, give them properties and styles, or paste a Mermaid flowchart. The TikZ code changes with it.

TikZ drawings

Drag nodes on a grid, give them properties and styles, or paste a Mermaid flowchart. The TikZ code changes with it.

Try it in spacing.tex →
Tables: Edit a table like a spreadsheet. Booktabs rules are one click away, and the package is loaded when needed.

Tables

Edit a table like a spreadsheet. Booktabs rules are one click away, and the package is loaded when needed.

Try it in paper.tex →
Compile and view the PDF: Compile with your own TeX. The PDF opens next to the source with findings and boxes drawn on the page, and a click on the page jumps to its line.

Compile and view the PDF

Compile with your own TeX. The PDF opens next to the source with findings and boxes drawn on the page, and a click on the page jumps to its line.

Try it in spacing.tex →
Debugger: See each expansion step of a macro and every name it reads.

Debugger

See each expansion step of a macro and every name it reads.

Try it in expand.tex →
Before
After
Refactorings: Right-click a table to switch it to booktabs or to align its numbers with siunitx.

Refactorings

Right-click a table to switch it to booktabs or to align its numbers with siunitx.

Try it in paper.tex →
Scratch and merge back: Slice a few lines into a scratch document, edit them there, and merge the change back as one undo step.

Scratch and merge back

Slice a few lines into a scratch document, edit them there, and merge the change back as one undo step.

Try it in hello.tex →
Fix an error: A \textbf whose brace never closes stops pdflatex at the end of the file. The fix in the hover card closes it, and the PDF builds.

Fix an error

A \textbf whose brace never closes stops pdflatex at the end of the file. The fix in the hover card closes it, and the PDF builds.

Try it in hello.tex →
pdflatex
SaTeX
Where an error starts: pdflatex only says the file ended. SaTeX shows line 5, where the brace of \textbf is never closed.

Where an error starts

pdflatex only says the file ended. SaTeX shows line 5, where the brace of \textbf is never closed.

Try it in runaway.tex →
Lint rules: Rules find what compiles but goes wrong: repeated blocks, wrong dashes, hand-written references. Each finding names its rule and how to fix it.

Lint rules

Rules find what compiles but goes wrong: repeated blocks, wrong dashes, hand-written references. Each finding names its rule and how to fix it.

Try it in clones.tex →
Page layout: Margins, paper and header to scale, as the run computed them. Works with geometry and typearea.

Page layout

Margins, paper and header to scale, as the run computed them. Works with geometry and typearea.

Try it in spacing.tex →
Before
After
Quick fixes: Wrote “Section 1” by hand? The fix writes \Cref to the label, loads cleveref if needed, and the number stays right.

Quick fixes

Wrote “Section 1” by hand? The fix writes \Cref to the label, loads cleveref if needed, and the number stays right.

Try it in proofs.tex →
Colors: See every color your document defines, in every model xcolor knows.

Colors

See every color your document defines, in every model xcolor knows.

Try it in colors.tex →
Typeset view: Read what each paragraph sets, math included, without compiling.

Typeset view

Read what each paragraph sets, math included, without compiling.

Try it in spacing.tex →
Findings: Every finding names its rule, tells you why it matters and cites its sources.

Findings

Every finding names its rule, tells you why it matters and cites its sources.

Try it in spacing.tex →
Explanations: Where a command is defined, its arguments, and its expansion.

Explanations

Where a command is defined, its arguments, and its expansion.

Try it in colors.tex →
Lengths: Hover a length to see it in every unit and as a share of the text width.

Lengths

Hover a length to see it in every unit and as a share of the text width.

Try it in units.tex →
Float placement: Toggle each placement letter and see what LaTeX does with it.

Float placement

Toggle each placement letter and see what LaTeX does with it.

Try it in paper.tex →
Glossary, index, bibliography: Browse the entries your document defines, with their fields and every use.

Glossary, index, bibliography

Browse the entries your document defines, with their fields and every use.

Try it in thesis.tex →
Trees: Drag the branches of a forest tree into a new order. The bracket notation follows.

Trees

Drag the branches of a forest tree into a new order. The bracket notation follows.

Try it in proofs.tex →
Theorems: See every theorem kind, its counter and each use. Rename a kind and SaTeX rewrites every environment.

Theorems

See every theorem kind, its counter and each use. Rename a kind and SaTeX rewrites every environment.

Try it in proofs.tex →
Library: Search every macro your packages define, with its arguments and what it sets.

Library

Search every macro your packages define, with its arguments and what it sets.

Try it in colors.tex →
Settings: Switch rules and plugins on or off. Each setting explains itself and shows its YAML.

Settings

Switch rules and plugins on or off. Each setting explains itself and shows its YAML.

Try it in colors.tex →

Examples

Hover a command to see what it does, or an underline to see what is wrong. Next to each file is what it typesets, all from SaTeX's analysis. The last tab is yours to type in.

Click into the source to edit it.open in the playground →
\documentclass{article}
\newcommand{\twice}[1]{#1#1}
\begin{document}
\twice{ab}
\end{document}

Analyzed at build time with SaTeX 0.2.7.

Editor plugins

Every editor feature is a plugin. It reacts to what the run computed, such as a color, a length, a table or a figure, never to a command's name. Switch any of them off in satex.yaml or in the playground's settings.

Show every plugin

Why interpret the code

What a macro does depends on what is in effect when it runs: the definitions, the catcodes, the arguments it reads, the names built before it. Reading the text means guessing all that. SaTeX runs the kernel, the class and the packages, and keeps every path it cannot decide.

\expandafter\newcommand\csname note@\romannumeral 2\endcsname{…}
\csname note@ii\endcsname
From the textA name nobody wrote: unknown, so no definition, no usage, no error.
From the run\note@ii is defined at line 1 and used at line 2, with its body and arguments.

Comparison

Each of these tools is good at its job. The others read the text. SaTeX runs the code.

SaTeXexplcheckTeXLabdigestifChkTeX
Source of its knowledgeexecuting the code (abstract interpretation)the text, expl3 naming conventions, flow analysisthe text and a command databasepackage sources and hand-written tag filesregular expressions
Names made at run time\csname, variants, keysseen as the run makes themnot seen1not seennot seennot seen
Languagesexpl3, LaTeX2e and plain TeX in one run, on pdfTeX, XeTeX or LuaTeX (with its Lua). ConTeXt and Texinfo are experimentalexpl3LaTeXLaTeX, ConTeXt, plain TeX, TexinfoLaTeX
Valuescatcodes, registers, lengths, token liststracked, unknown ones as typed ranges————
Conditionals it cannot decidefollows both arms and joins themmarks edges as maybe———
Reruns.aux, .toc, .bblrepeats the runs like latexmk, in memory—reads the files a build left——
InterfacesCLI, LSP, VS Code, Neovim, IntelliJ (in part), a desktop app (satex gui), browser playgroundCLI, CILSPLSPCLI, used by editors
Style and convention checksover 100 lint rules, expl3 conventions confirmed by the runa coded catalog of expl3 warnings and errors——many typographic checks
Build and PDFbuilds with latexmk and explains the log—build, forward and inverse search——
Fixesquick fixes and refactorings (load a missing package, a macro for repeated code, \cref for typed references), widgets that edit tables, figures, colors, TikZ drawings and the page layout and write back only what changed—formatting (latexindent)——
Scopethe files a document loadsall of TeX Live, with a public reportany fileany fileany file
Speedseconds per document with warm caches, a long thesis can take minutesfast: reads the text, runs nothingas you type: reads the textas you type: reads the textmilliseconds: line by line
  1. V. Novotný: “[the analyzer] cannot detect function definitions or calls that arise only through dynamic expansion and are not obvious from the surface text of the program”, Static analysis of expl3 programs (11½). The series is a careful account of what a text-based approach can do: related work, TeX language servers.

Compiling

satex compile builds the PDF with the TeX engine. It reruns until the files rest, as latexmk does, and skips the build when nothing it read changed.

All 264 builds give the same pages and text as latexmk.

1.5 sOne-edit rebuild, 184-page thesis with figures (latexmk 2.0 s)
3.1 sOne-edit rebuild, 1002 pages (latexmk 3.4 s)
1.27×Speed vs latexmk, one-edit rebuild
0.89×Speed vs latexmk, cold build
1.94×Speed vs latexmk, nothing changed

satex compile (the PDF only) against latexmk on AMD Ryzen 9 9950X 16-Core Processor, median of 5 runs, SaTeX 0.2.5 (2026-11-21). Geometric means over the benchmark documents. Compile benchmarks has every document, toolchain and spread.

About

SaTeX is actively developed by Florian Sihler (contact me at: florian.sihler@uni-ulm.de) under the MIT License. Contributions are welcome (see CONTRIBUTING.md).

The development and initial Rust codebase is strongly assisted by Claude Code, working from architecture descriptions and TeX semantics. Its design is inspired by flowR, a static analyzer for R. SaTeX neither uses nor requires flowR. It is still work in progress. Please avoid AI-only contributions. The humans who submit code are responsible for it.

Install

One language server serves every editor that speaks LSP. TeXstudio reads the findings from its log.

  • VS Codefull LSP

    Install eagleoutice.satex from the Marketplace.

    Setup →
  • JetBrains IDEsfull LSP

    Through LSP4IJ. The plugin installs from disk for now.

    Setup →
  • Neovimfull LSP

    vim.lsp.config or lspconfig, a few lines.

    Setup →
  • Any LSP clientfull LSP

    Start satex lsp on standard input and output.

    Setup →
  • TeXstudiofindings in the log

    satex lint --format texlog after each build.

    Setup →
  • Command linelint, explain, trace

    satex lint -f main.tex in a terminal or in CI.

    Commands →
  • Browsereverything, no install

    The playground runs SaTeX in the page.

    Open →
  • satex guieverything, on your files

    The playground on your project, with your TeX. Edits are saved.

    Setup →

Binaries for Linux, macOS and Windows are on the releases page. With Rust, cargo install satex-analyzer builds it. The first run reads the LaTeX kernel and caches it, which takes a minute or two. Later runs reuse the cache.

TeX Live

SaTeX reads the TeX installation on your computer. CI runs the whole test suite on Linux with TeX Live 2025, 2022 and 2019, and part of it on macOS and Windows with the newest TeX Live. With more than one installed, texlive.root and texlive.year in satex.yaml choose the one SaTeX reads.

Shell completion, building from source, the language server

Prebuilt binaries for Linux and macOS (x86-64 and ARM64) and Windows (x86-64) are attached to every release. The changelog lists what changed. With Rust installed, cargo install satex-analyzer installs the satex command. cargo install --git https://github.com/EagleoutIce/satex-analyzer installs the latest version from the repository. To build from source:

cargo build --release
./target/release/satex --help

With Docker, ghcr.io/eagleoutice/satex holds satex and TeX Live (LaTeX with the recommended packages and fonts, latexmk). The interpreted kernel is built into the image, about 420 MB in all. Mount the project as the working directory:

docker run --rm -v "$PWD:/work" ghcr.io/eagleoutice/satex lint -f main.tex
docker run --rm -p 2087:2087 -v "$PWD:/work" ghcr.io/eagleoutice/satex lsp --host 0.0.0.0 --port 2087

The second line serves the language server over TCP. docker build -t satex . builds the image from the repository. --build-arg TEX_PACKAGES=texlive-full installs every TeX Live package, at about 5 GB more.

Shell completion: after installing, run satex completions install once. It adds the hook to the startup file of your shell (bash, zsh or fish). satex completions <shell> prints the script for bash, zsh, fish, elvish or powershell. Query names and --set keys complete from the program itself. See the command line page.

source <(satex completions bash)   # bash: add to ~/.bashrc

zsh and fish are on the command line page.

Current version: 0.2.7. satex --version also lists the plugins included in this build and the configuration in effect:

$ satex --version
satex 0.2.7
https://github.com/EagleoutIce/satex-analyzer

plugins: 48 in 11 kinds
  provider            3  texlive, miktex, tectonic
  platform            3  linux, macos, windows
  engine              4  tex, pdftex, luatex, xetex
  kernel              4  latex2e, plain, context, none
  output              4  pdf, dvi, ps, html
  build system        5  latexmk, make, tectonic, arara, l3build
  tools               7  biber, bibtex, makeindex, xindy, makeglossaries, dvips, ps2pdf
  magic comments      3  % !TeX, % !BIB, % arara:
… 17 more lines omitted

satex lsp runs a Language Server: diagnostics, hover, definitions, references, completion, document symbols and quick fixes, all backed by the commands above. Stdio by default, --port/--host for TCP. See the LSP wiki page for the protocol details and Neovim setup, and the VS Code and IntelliJ pages for those editors.

satex gui [DIR] opens the browser playground on a project of your computer: its files, the TeX packages installed there, the native language server and your TeX for the PDF. Edits are saved to the files. See the playground on your machine.