Diagnostic Showcase Gallery
This gallery presents unedited, real-world terminal runs comparing standard LaTeX compilation tools (latexmk on xelatex) directly against latex_it.
Every comparison below was generated by running genuine compilations of both tools on the exact same .tex source files.
1. Unclosed Dollar Sign ($) Inversion & Pinpointing
Problem Scenario:
An unclosed $ on line 4 propagates across five lines of dense mathematical prose, inverting text and math across multiple formulas until TeX crashes far downstream.
\documentclass{article}
\begin{document}
Let $S be a finite metric space containing $n$ elements.
We consider the pairwise distance matrix $D$ with entries $d(u, v) = 0$.
Under the assumption that the doubling dimension is bounded by $k$,
the geometric embedding maintains pairwise separation throughout the domain.
Finally, we obtain that the distortion factor is strictly below $1 + \epsilon$ overall.
Next section begins here.
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): TeX halts on line 8 ($1 + \epsilon$) with! Missing $ inserted., blaming an innocent, well-formed formula for missing a dollar sign and completely concealing that math mode was opened four lines earlier on line 4. latex_itResolution: Performs candidate pair scoring across the paragraph, recognizes that downstream formulas are valid, and pinpoints the true culprit:Unclosed '$' opened on line 4 (col 5); insert closing '$'.
2. Unclosed Curly Brace Pinpointing
Problem Scenario:
A macro argument or group opened with { is left unclosed across a paragraph or EOF.
\documentclass{article}
\begin{document}
Here is an unclosed macro \textbf{that forgot
the closing brace.
\par
And here is some text that should not be in the bold.
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): Standard TeX parsers only complain when they encounter\paror EOF (Runaway argument?,! File ended while scanning use of \textbf). The terminal fills with 70+ lines of internal macro call traces and rule checks, but completely obscures where the{was actually typed. latex_itResolution: Runs an AST-aware lexical brace scanner with environment scoping that identifies the exact line (line 3), column (col 34), and enclosing environment (document) where the unclosed brace started, along with an actionable remediation hint.
3. Misplaced Alignment Tab (&) inside equation*
Problem Scenario:
The author used & to align multi-part equations, but placed it inside equation* instead of align*.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
x = 1 & y = 2
\end{equation*}
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): Standard LaTeX emits a generic! Misplaced alignment tab character &., followed by 45 lines of engine state and generic failure boilerplate. It offers zero explanation of why the ampersand is invalid or how to structure the math environment. latex_itResolution: Performs backwards AST scope resolution, detects that the tab character resides insideequation*, and delivers an immediate, tailored hint:Misplaced '&' in 'equation*'; switch to 'align*' (or use 'aligned' / 'split').
4. Macro Spelling & Typo Fuzzy Matching (\includegrahics)
Problem Scenario:
A minor typo in a common macro name (\includegrahics instead of \includegraphics).
\documentclass{article}
\begin{document}
\includegrahics{my_figure.png}
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): TeX fails on the unknown macro and attempts to recover by misinterpreting underscores (_) in filenames as text-mode subscripts, causing a cascade of misleading secondary errors (Missing $ inserted,Extra }, or forgotten $). latex_itResolution: Uses Levenshtein edit distance against standard LaTeX commands and package signatures, identifying the intended macro with:Did you mean '\includegraphics'? (requires \usepackage{graphicx}).
5. Missing Package Macro (\toprule)
Problem Scenario:
Using standard publication-quality table markup (\toprule) without importing the prerequisite package.
\documentclass{article}
\begin{document}
\begin{tabular}{cc}
\toprule
A & B \\
\end{tabular}
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): Reports! Undefined control sequence. <recently read> \toprule. Standard tools do not associate macro names with external CTAN packages, leaving the author to manually look up what package supplies the command. latex_itResolution: Looks up the command signature in its package index and reports:Command '\toprule' requires \usepackage{booktabs}.
6. Inverted \label Before \caption (Silent Reference Corruption)
Problem Scenario:
Placing \label{...} before \caption{...} inside a floating figure or table.
\documentclass{article}
\begin{document}
\section{Introduction}\label{sec:intro}
See Figure~\ref{fig:myfig}.
\begin{figure}[htbp]
\label{fig:myfig}
\caption{A sample diagram.}
\end{figure}
\end{document}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): Standard compilers are completely silent and exit with code 0. However,\captionis what increments the float counter; placing\labelbefore it causes\ref{fig:myfig}to quietly bind to Section 1 instead of Figure 1, producing corrupt citations in published papers. latex_itResolution: Inspects float structure and elevates this silent bug to the Alert diagnostic tier:6: Inverted \label{fig:myfig} before \caption in figure environment. Move \label after or inside \caption.
7. Bibliography Syntax Crash at \printbibliography (Pinpointing the Exact .bib Entry)
Problem Scenario:
An unescaped underscore (_) in a .bib database field (such as journal = {NORDIC_J_COMP}).
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}
\begin{document}
Citing a seminal paper \cite{grss95}.
\printbibliography
\end{document}
Companion refs.bib:
@article{grss95,
author = {Sariel Har-Peled},
title = {A Fast Approximation Algorithm},
journal = {NORDIC_J_COMP},
year = {1995}
}
Commentary & Diagnosis
- Standard Tool (
latexmk/xelatex): TeX crashes during\printbibliographywith! Missing $ inserted.or! Double subscript.on line 7 ofpaper.tex. It offers zero indication of which citation key failed, which.bibfile it came from, or what field caused the syntax crash, forcing authors into tedious binary-search debugging. latex_itResolution: Injects an AST hook into BibLaTeX’s entry pipeline to capture the active citation key at the instant of failure, locates the entry and line inrefs.bib, and prints an actionable companion error:refs.bib:4: [latex_it] Bibliography error in entry 'grss95'with▸ Hint: Offending token 'NORDIC_J_COMP' found on this line..