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 it\refdefined by the kernel, latex.ltx\refchanged by hyperref.sty\usepackage{hyperref}loaded in line 4\csname builds, and their meanings\csname r@sec:intro\endcsnamethe label\r@sec:intro → {1}{2}section 1, page 2\ref{sec:intro} → 1after one more run\twice{ab}where branches you never compiled breakthe category code of each character in \a@b{$x^2$}what package options change\usepackage[colorlinks]{hyperref}read by hyperref\ifHy@colorlinks → \iftruelinks in color\@pdfborder → 0 0 0no boxes.aux, and how many runs you needrun 1writes \newlabel{sec:intro}run 2\ref{sec:intro} → 12 runsrun 3 changes nothing
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}

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.
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.
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.
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.
Try it in spacing.tex →

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



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.
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.
Try it in hello.tex →



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.
Try it in clones.tex →

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



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.
Try it in colors.tex →

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.
Try it in spacing.tex →

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.
Try it in units.tex →

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.
Try it in thesis.tex →

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.
Try it in proofs.tex →

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.
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.
\documentclass{article}
\newcommand{\twice}[1]{#1#1}
\begin{document}
\twice{ab}
\end{document} \documentclass{article}
\usepackage{amsmath}S002
\usepackage{listings}S039
\usepackage{tikz}
\usepackage{makeidx}
\usepackage{glossaries}
\makeindex
\makenoidxglossaries
\newglossaryentry{tex}{name={\TeX}, sort={TeX}, description={the typesetting system by Knuth}}
\newglossaryentry{satex}{name={SaTeX}, description={a checker that reads the document the way \TeX{} does}}
\lstset{basicstyle=\ttfamily\small, columns=fullflexible}
\title{Reading \TeX{} the Way \TeX{} Does}
\author{A.\ Student}
\date{November 2026}
\begin{document}
\maketitleS039
\thispagestyle{empty}
\clearpage
\tableofcontents
\listoffigures
\listoftablesS070
\clearpage
\input{chapter}
\section{Terms}
\Gls{satex} reads the \gls{tex} source\index{source} and reports what it finds\index{finding}.
The macro\index{macro} definitions it sees are the ones \gls{tex} expands.S070
\printnoidxglossaries
\printindex
\bibliographystyle{plain}S050A001
\bibliography{refs}S055
% satex checks this on every path: the thesis stays short
%\satex@assert{\thepage < 9 and \value{section} >= 1}C044
\end{document} \documentclass{article}
\usepackage{amsmath}
\usepackage{amsmath}S031
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
See pages 10-12, e.g. the first table of the office files.S020S014
\begin{tikzpicture}
\node (a) {\TeX{} file};
\node (b) [right=of a] {findings};
\draw[->] (a) -- (b);
\end{tikzpicture}
\end{document}S062 % !TeX program = tex
\def\ckleapyear#1% check if #1 is a leap year.
{%
{%
\def\tleapy{not }% Most years fail.
\count10=#1
\count1=#1
\divide\count1 by 4
\multiply\count1 by 4
\ifnum\count1=\count10 % Worrry about 100 & 400.
\count2=#1
\divide\count2 by 100
\multiply\count2 by 100
\ifnum\count2=\count10 % Not a leap year unless 400 also divides.
\count3=#1
\divide\count3 by 400
\multiply\count3 by 400
\ifnum\count3=\count10
\def\tleapy{}% Special leap year.
\fi
\else
\def\tleapy{}% This gets regular leap years.
\fi
\fi
The year #1 is \tleapy a leap year.\par
}%
}
\ckleapyear{1900}
\ckleapyear{1990}
\ckleapyear{1996}
\ckleapyear{2000}
\ckleapyear{2004}
% satex reads settings and properties written as comments.
% Here the clock is unknown, so \year may be any year:
%\satex@configure{clock=unknown}
\ckleapyear{\the\year}
% Here the clock is now again, so \year is this year:
%\satex@configure{clock=now}
\ckleapyear{\the\year}
\bye 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 \note@ii is defined at line 1 and used at line 2, with its body and arguments.\cs_new:Npn \my_show:n #1 { … }
\cs_generate_variant:Nn \my_show:n { V }
\my_show:V \l_tmpa_tl \my_show:V appears nowhere as a definition, which is a known blind spot of surface analysis.\l_tmpa_tl and calls \my_show:n.\catcode`\|=\ifdraft 14 \else 12 \fi
a | b \gdef\Maybe{} | is a character. \Maybe is defined.| starts a comment and \Maybe is never defined: both paths are kept.Comparison
Each of these tools is good at its job. The others read the text. SaTeX runs the code.
| SaTeX | explcheck | TeXLab | digestif | ChkTeX | |
|---|---|---|---|---|---|
| Source of its knowledge | executing the code (abstract interpretation) | the text, expl3 naming conventions, flow analysis | the text and a command database | package sources and hand-written tag files | regular expressions |
Names made at run time\csname, variants, keys | seen as the run makes them | not seen1 | not seen | not seen | not seen |
| Languages | expl3, LaTeX2e and plain TeX in one run, on pdfTeX, XeTeX or LuaTeX (with its Lua). ConTeXt and Texinfo are experimental | expl3 | LaTeX | LaTeX, ConTeXt, plain TeX, Texinfo | LaTeX |
| Valuescatcodes, registers, lengths, token lists | tracked, unknown ones as typed ranges | — | — | — | — |
| Conditionals it cannot decide | follows both arms and joins them | marks edges as maybe | — | — | — |
Reruns.aux, .toc, .bbl | repeats the runs like latexmk, in memory | — | reads the files a build left | — | — |
| Interfaces | CLI, LSP, VS Code, Neovim, IntelliJ (in part), a desktop app (satex gui), browser playground | CLI, CI | LSP | LSP | CLI, used by editors |
| Style and convention checks | over 100 lint rules, expl3 conventions confirmed by the run | a coded catalog of expl3 warnings and errors | — | — | many typographic checks |
| Build and PDF | builds with latexmk and explains the log | — | build, forward and inverse search | — | — |
| Fixes | quick 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) | — | — |
| Scope | the files a document loads | all of TeX Live, with a public report | any file | any file | any file |
| Speed | seconds per document with warm caches, a long thesis can take minutes | fast: reads the text, runs nothing | as you type: reads the text | as you type: reads the text | milliseconds: line by line |
- 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.
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
Setup →eagleoutice.satexfrom the Marketplace. - JetBrains IDEsfull LSP
Through LSP4IJ. The plugin installs from disk for now.
Setup → - Neovimfull LSP
Setup →vim.lsp.configorlspconfig, a few lines. - Any LSP clientfull LSP
Start
Setup →satex lspon standard input and output. - TeXstudiofindings in the log
Setup →satex lint --format texlogafter each build. - Command linelint, explain, trace
Commands →satex lint -f main.texin a terminal or in CI. - Browsereverything, no install
The playground runs SaTeX in the page.
Open → satex guieverything, on your filesThe 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.