\cref and \Cref were unsupported, so documents using cleveref leaked the
command. The reference pass now scans both commands, splits the comma-separated
keys, looks each up in the existing label and kind tables, and joins them as
"Section 1 and Figure 1"; \Cref capitalises each kind and unknown keys become
"??".
A preview test labels a section and a figure and checks both forms with no
warnings.
\SI/\qty, \SIrange, \num and \si were unsupported, so numbers and units leaked
as command text. A body pass now reads their braced arguments, normalizes the
number (dropping thin spaces and grouping braces) and maps common unit macros to
short symbols: metre/meter to m, second to s, kilogram to kg, per to /, squared
and cubed to superscripts, and the kilo/milli/micro/nano/centi prefixes.
A preview test renders "3.5 m", "2 km/s", "1000" and a bare "m" with no
warnings.
The appendices environment was reported as unsupported, so appendix sections
kept main-matter numbering. A body pass now replaces \begin{appendices} with a
blank-line-padded \appendix (so it becomes its own block and the sectioning pass
sees it) and drops \end{appendices}; the environment name counts as supported.
A preview test puts a section inside appendices and checks "1 Main" and
"A Extra" render with no warnings.
parse_image_length only recognized \textwidth, \linewidth, \hsize, \textheight
and \vsize, so width=\columnwidth (common in two-column templates) produced no
size. The list now also accepts \columnwidth and \paperwidth as widths and
\paperheight as a height, each scaling the configured measure.
The graphics sizing test gains a width=0.5\columnwidth case matching the
\textwidth result.
\usefont{encoding}{family}{series}{shape} was unsupported, so a class using the
low-level font selection left its arguments in the text. The inline NFSS parser
now recognizes the four braced groups, maps the family code through the same
cmss/lmss/phv/pcr/cmtt table as \fontfamily, and sets bold/italic/slanted/small
caps from the series and shape.
The existing nfss test gains an assertion that
\usefont{T1}{cmss}{b}{n} selects SansBold.
\tag{B} stored the bare text and the renderer painted "B", while LaTeX draws
"(B)"; \tag* is the bare form. Tag extraction now wraps the non-starred argument
in parentheses and leaves the starred form alone, for both equation rows and
whole equations.
The existing tag tests expect "(B)"/"(C)", and a new preview test checks the
parentheses glyphs around "A" with no warnings.
\tag* was not parsed: the tag extraction only looked for \tag, so the starred
form stayed in the formula. Both the row pass and the block pass now try
\tag*{...} before \tag{...}, so the tag text is removed from the math and used
as the equation tag.
A preview test tags an equation with \tag*{A} and checks the glyph appears with
no warnings and no leaked command.
\autoref{...} pointing at an equation fell through to "??" because equation
labels are resolved during the equation numbering pass and never reached the
section-reference kind table. That pass now also rewrites \autoref to
"Equation <n>" in both a math block and its equation rows.
A preview test labels an equation and checks "See Equation 1." with no
warnings.
\nameref fell back to the number for float labels because only headings fed the
title table. The float numbering pass now records each label with its raw
caption text, and that table is merged into the same title map nameref reads, so
\nameref{fig:a} returns "A plot" while \autoref keeps "Figure 1".
A preview test labels a figure with \caption{A plot} and checks
"See A plot and Figure 1." with no warnings.
\arabic, \roman, \Roman, \alph, \Alph and \value with a counter name were
unsupported and leaked into the text. The body pass now reads the braced counter
name and replaces the command with its stored value in the requested form,
using the same counter table that \setcounter/\stepcounter fill.
A preview test sets section to 4 and checks "4 iv D 4." with no warnings.
\stepcounter and \refstepcounter were unsupported, so a document that advanced a
counter before its next heading kept the old number. The geometry pass consumes
both commands and bumps the named counter in the stored counter table (creating
it at one when it was absent); page counters keep their dedicated
\addtocounter page handling.
A unit test steps section before \section{Introduction} and checks the heading
renders as "2 Introduction".
The amsmath extensible arrows were unknown, so their labels fell back to plain
text. The math parser now reads \xrightarrow/\xleftarrow, an optional [below]
label, and the above label, and builds nested Stack atoms around the arrow
symbol: above stacks upward, an optional below label stacks downward.
The math test compares the bare arrow with the labeled form (width/height grow)
and with the two-label form (total height plus depth grows).
\boldsymbol and \bm were unknown math commands, so a bold symbol fell back to
the default layout. Both names now select the same bold alphabet as \mathbf;
symbol-heavy arguments still use the regular symbol metrics, which is the
existing alphabet approximation.
A math test compares \boldsymbol{x} with \mathbf{x} for equal width and height.
A section's optional [short] title already replaced the long title in the table
of contents, but the running heads kept the long title. When recording heading
units, the document now prefers heading_short (with its number) and falls back
to the rendered heading text, so headings/myheadings and the fancy \rightmark
fallback show the short form.
A headings-style test with \section[Short]{A long title} checks the header says
"1 SHORT" and not the long title.
\pagestyle{myheadings} behaved exactly like headings, so it filled the left
header with the current numbered heading. The geometry now records myheadings
separately; in that style the left header shows the explicit \markboth/\markright
text when present and stays empty otherwise, while headings keeps using the
current heading title. The page number behavior is unchanged.
A two-page test sets myheadings and \markright{Custom mark}, then checks the
header shows "CUSTOM MARK" and not "1 INTRODUCTION".
A \label on its own paragraph after a heading resolved \ref and \autoref, but
\nameref fell back to the number because the label-to-title table only recorded
labels taken from heading text. Section numbering now tracks the latest heading
title and records it for label-only paragraphs (and ordinary paragraphs that
carry a label), so \nameref returns the title for those labels too.
A preview test puts \label on its own line after \section, then checks
"Introduction and Section 1" with no warnings.
A \resizebox or \scalebox around a tabular left the wrapper in the body and the
tabular capture swallowed the caption and \end{table}, so scaled tables were
lost. A source pass now removes such wrappers when their content contains a
table, longtable or table environment (and clears a leading % comment), leaving
the tabular at top level where the existing capture sees it; wrappers around
ordinary text stay for the later text pass.
A preview test wraps a two-row tabular in \resizebox inside a table and checks
"Table 1: Resized" plus the cell text with no warnings.
The corpus guard only checked that each document produced at least one page.
It now asserts the exact counts (hello 1, boxes 1, compat 1, arXiv template 2)
alongside the empty warnings array, so a layout regression that drops or adds a
page fails the server test even when no warning is emitted.
The status document's verification paragraph mentions the exact-count check.
\scalebox, \resizebox, \rotatebox and \raisebox were unsupported, so a wrapped
graphic or table could leak its command text. A body pass now parses each
wrapper's numeric/optional arguments and replaces the whole construct with its
content, leaving the content at natural size and position because the engine
has no display-list transform.
A test wraps four fragments in the four commands and checks the visible text
concatenates with no warnings and no leaked command names.
An explicit \par inside a block stayed in the paragraph text and could leak as
an unsupported command. The final body pass now turns a standalone \par token
(not a \par... command prefix) into a blank line, so the block splitter starts a
new paragraph at that point.
A unit test feeds "First line.\par Second line." through geometry_and_body and
checks it splits into two paragraphs.
The line-start forms of \markboth and \markright were handled, but an inline
"Body \markright{Short title} text." leaked the command. A body pass now finds
either command anywhere, records the left/right marks for the running heads,
and removes the command from the text (malformed brackets are left untouched).
A fancy-header test puts \markright inside a paragraph and checks the header
shows "Short title" with no warnings and no leaked command.
\autoref always wrote "Section <number>", even for figure, table or theorem
labels. The reference passes now record a kind alongside each label: sections
use "Section", floats use their caption prefix (Figure/Table), and theorems use
their display name; resolve_section_refs builds \autoref from that kind, falling
back to "Section" for unknown labels.
A preview test labels a figure, refers to it with \autoref, and checks "Figure 1"
with no warnings.
A proof environment stopped at its last body line, without the boxed QED mark
LaTeX's amsthm draws. Proof bodies now get a trailing "□" (an explicit
\qedhere is consumed first), so the rendered result matches the usual proof
ending.
A preview test wraps "Because it follows." in a proof and checks the text ends
with the symbol and no warnings are reported.
Running heads expanded \leftmark/\rightmark only from explicit
\markboth/\markright, so a fancy header using \rightmark stayed empty when the
document never set a mark. Document now exposes the per-page heading list from
the previous increment, and running_head_text falls back to the current numbered
heading (uppercased) when no explicit left/right mark is configured.
A two-page test with \rhead{\rightmark} and a section checks "1 INTRODUCTION"
appears in the header with no warnings.
The headings page style only painted the page number. Document now records its
heading units (unit index and title) during layout, and a page_headings helper
carries the latest heading from page to page through the page sources. The
running-head pass uses that list in headings style: the numbered heading title
is uppercased at the left of the header and the page number stays right-aligned,
with the first page still plain.
The headings test gains a section and checks "1 INTRODUCTION" sits at the left
of the header baseline.
The heading-label fix and the title table interact: a label directly under
\section (no blank line) must still resolve \nameref to the heading title and
\autoref to "Section <n>". A preview test now pins that combination, rendering
"Introduction and Section 1" with no warnings and no "??".
No production code changed in this increment.
\pagestyle{headings} and {myheadings} were ignored, leaving the number in the
footer. The parser now records the headings styles; the running-head pass paints
a right-aligned 9pt page number at the head baseline on pages after the first
(LaTeX's plain first page), and the footer number is skipped for those styles.
Section titles in the header are still not modelled.
A two-page preview test checks "2" sits above the body on page 2, right-aligned
past x=400, with no warnings.
The optional label of \bibitem[Label]{key} was parsed and thrown away, so the
list and citations always used the running number. The extractor now carries the
label in the entry (behind a private marker) and the bibliography list prints
[Label]; citation resolution uses the same label for that key, while unlabeled
entries keep their positional number.
A preview test gives the first entry a label and leaves the second plain,
then checks the list markers and the two citation markers with no warnings.
An optional note on \cite, \citep or \citet was parsed and discarded. The
citation pass now remembers the first bracket note and appends it inside the
resolved bracket, so \citep[p.~3]{alpha} prints "[1, p. 3]" instead of "[1]"
(the tilde still becomes a space later in the text pipeline).
The existing citation test now asserts the note form; the rest of the unit
suite is unchanged.
\footnotemark[n] and \footnotetext[n]{...} left the bracket text in the line
and ignored the requested number. The footnote pass now reads an optional
bracketed integer: \footnotemark[n] emits that marker (and advances the counter
to it), while \footnotetext[n] attaches its body to the pending note with that
number, creating the entry when the mark appeared elsewhere in the paragraph.
A test uses mark and text with [7], checks "(7)" and the deferred body render
with no warnings, and that no "[7]" text leaks.
A \label on the line after \section without a blank line was discarded with the
rest of the text after the heading's closing brace, so \ref printed "??".
heading_command now keeps any immediately following \label groups (allowing
whitespace/newlines) in the heading text, which lets the numbering pass attach
them to that heading; other trailing text is still ignored as before.
A preview test puts \label{sec:intro} directly under \section{Introduction},
refers to it, and checks "See 1." with no warnings and no "??".
The acks, acknowledgments and acknowledgements environments were reported as
unsupported. A body pass now rewrites their \begin into an unnumbered
"Acknowledgments" \section* and drops the matching \end, and the environment
names count as supported so the preview warning stays empty.
A test wraps "Thanks." in \begin{acks}, then checks the heading and body text
render with no warnings and no leaked environment names.
\cleardoublepage was unsupported and \onecolumn/\twocolumn leaked into the
text. The block splitter now treats \cleardoublepage like \newpage/\clearpage
(it sets the pending page break) and consumes the two column switches, since
the engine lays documents out in a single column.
A test alternates the three commands around First/Second/Third, checks at least
two pages, all three texts present, and no leaked commands or warnings.
\markboth/\markright and the \leftmark/\rightmark placeholders were
unsupported. The page-geometry pass now consumes those mark assignments and
records the last left/right mark; the running-head text expands \leftmark and
\rightmark from that record (document-wide, not per page) before scrubbing, so
a fancy header or footer can carry the current short title.
A test sets \pagestyle{fancy}, \fancyhead[R]{\rightmark} and
\markboth{Left title}{Right title}, then checks the header text is
"Right title" with no warnings and no leaked \rightmark.
Section numbering now also records the heading title for each label: a
number_sections_with_titles variant fills a titles table (the existing
number_sections wrapper keeps its signature for tests), and
resolve_section_refs takes that table. \nameref{label} becomes the heading
title, falling back to the number when no title was recorded, while \autoref
keeps producing "Section <number>"; unresolved forms become "??".
A preview test labels a heading inside its braces and renders \ref, \autoref
and \nameref together as "1 and Section 1 and Introduction" with no warnings.
\autoref was unsupported and leaked. The section-reference pass now rewrites
\autoref{label} to "Section <number>" using the same label table as \ref, and
unresolved autorefs become "??" with the other reference commands.
A preview test labels a heading inside its braces
(\section{Introduction\label{sec:intro}}), shows \ref and \autoref side by
side, and checks "1 and Section 1" with no warnings.
\captionsetup, \numberwithin and \DeclareCaption were unsupported and could
leak into the body. The page-geometry pass now consumes those declaration lines
(the caption styling and equation-number scoping are not modelled), in the
preamble and in the body alike.
A preview test declares \captionsetup (plain and with [figure]) and
\numberwithin before and inside the document, then checks "Text." renders with
no warnings and no leaked declarations.
Text-mode \phantom and \hphantom were unsupported. A text-stage pass measures
the scrubbed argument with the Roman metrics and replaces the command with
\hspace of that width, so the glyphs are omitted but the line keeps their
footprint; \vphantom contributes no horizontal material.
A test renders "A\phantom{wide}B and \vphantom{XX}C and \hphantom{QQ}D." and
checks "AB and C and D." with no warnings and none of the hidden text.
\hyperref[label]{text}, \hyperlink{name}{text} and \hypertarget{name}{text}
were unsupported and leaked as text. A text-stage pass now drops the link
machinery and keeps the visible label, accepting the optional [label] argument
of \hyperref and the braced target of the other two; internal PDF destinations
are not modelled.
A preview test uses all three forms and checks "the intro", "linked" and
"anchor" with no warnings and no leaked command names.
\footnotemark and \footnotetext were unsupported, so deferring a note body was
impossible. The footnote numbering pass now selects among \footnote,
\footnotemark and \footnotetext (longest name first so the prefix cannot win):
\footnotemark advances the counter, emits the numbered reference and records an
empty note for the number; \footnotetext fills that pending note with its body
and leaves no text in the line; the remaining text is appended once.
A test pairs a mark and its text in one paragraph, checks the page carries
"(1)" and "Deferred note." with no warnings, and that neither command leaks.
\protect was just a no-op token, so \edef\b{\protect\a} expanded \a at
definition time. In an edef-style pass the expander now copies \protect and the
following token unchanged (so the stored body keeps the protected command); in
the ordinary document pass it drops \protect and lets the token expand as
LaTeX does when the text is typeset.
A test defines a=A, \edef b={\protect\a}, redefines a=C, and checks both \b and
a literal \protect\a print C with no warnings.
\csname foo\endcsname stopped after looking up a zero-argument macro; a
parameterised target was left unresolved. After the zero-argument fast path,
build a synthetic command from the resolved name plus the text following
\endcsname and run the normal macro lookup, so arguments/defaults/delimited
parameter text are consumed exactly as for a literal \foo, and only the bytes
belonging to the csname construct are charged to the caller.
A test defines \foo#1{[#1]} and prints both \csname foo\endcsname{x} and
\csname foo\endcsname{y} as "[x] and [y]" with no warnings.
A group-local \def stayed visible after a later \gdef of the same name because
scoped lookup preferred the newest scope entry, and an inline \global\def was
unsupported. Route \gdef/\xdef and \global\def/\global\let/\global\chardef
through an upsert that removes same-name entries from every live scope before
updating the global table, so the global meaning wins inside the group and
after it.
A test defines a group-local L, replaces it with G via \gdef inside the group,
and checks the group prints G and the following \a prints G; an
inline \global\def also expands.
\unexpanded passed its text straight through, so \edef\b{\unexpanded{\a}}
expanded \a at definition time. Split the expander into an inner pass with a
freeze flag: the edef-style wrapper protects each backslash in \unexpanded's
argument with the existing no-expand marker, which the pass restores on the way
out, while the normal document pass still writes the text through so it expands
at use time.
A test defines a=A, \edef b={\unexpanded{\a}}, redefines a=C, and checks \b
prints C with no warnings; the earlier \expanded/\unexpanded/\detokenize test
still passes.
Three expansion primitives class files use were unsupported. \expanded{...}
runs the argument through the current macro table and scopes immediately;
\unexpanded{...} passes the text through unchanged (normal typesetting
semantics; the edef freeze is not modelled); \detokenize{...} prints the text
literally through the same private-use escaping as \string.
A preview test expands \a, passes \a through unexpanded and detokenizes it,
checking "Hi and Hi and \\a." with no warnings.
The warning-free corpus sweep was only a manual check. Add a server test that
previews examples/hello.tex, boxes.tex, compat.tex and the arXiv template
through /api/route-d/preview and asserts each returns 200, at least one page
and an empty warnings array, so the corpus guard runs with the normal suite.
Inline math in a 12pt paragraph kept 10pt glyphs because paint_math advances
with 10pt metrics. Paint the math atom into a temporary display list at the
10pt baseline and scale that list as a unit (text sizes and positions, rule
widths/heights, line endpoints) to the paragraph size before translating it to
the baseline. The box no longer pins its size, so a scaled math glyph now
reports font-size 12.000 in a 12pt paragraph.
The twelve-point test now also asserts that an italic math glyph is rendered at
the paragraph size; the sized-paragraph test still expects a math box and no
literal dollars.
Inline math returned None whenever the paragraph base size was not 10pt, so a
12pt or \large paragraph printed its dollar delimiters literally. Keep the math
segment at every size: the box width still scales with the paragraph, while the
math glyphs are pinned to the 10pt metric baseline by setting the box's size
field, so paint positions and glyph sizes stay consistent (slightly smaller
than the surrounding text, which is documented).
The old sized-paragraph test now expects a math box and no literal dollars; a
new 12pt preview test checks italic math glyphs and no "$" with no warnings.
The last three corpus warnings: \parbox becomes an \mbox so the existing box
handling keeps its content (width wrapping is not modelled); \orcidlink{id}
becomes a hyperlink labelled ORCID; and a standalone \hrule becomes the same
here-float rule block as \rule, with the width left unset so the page builder
uses the current line width and a 0.4pt height.
The corpus sweep now reports 0 warnings for examples/hello.tex, boxes.tex,
compat.tex and the arXiv template.
A test previews parbox content, the ORCID link label and a bare hrule with no
warnings and no leaked commands.