Repository navigation
compiler: \maketitle without \author warns like LaTeX; unsupported text commands stop blaming math mode (#244) - #305
Merged
Conversation
…xt commands stop blaming math mode GH#244, both parts. A. latex.ltx defines `\def\@author{\@latex@warning@no@line{No \noexpand\author given}}`, so a missing \author is a warning and the title block is still set. This compiler refused to produce any block and raised an error instead. - A missing \author now gives the warning "No \author given" and the title block, with no author line. - `\author{}`, or only blank \and slots, is an author that is given but empty. pdfLaTeX sets it silently, so there is no diagnostic. The issue asked for a warning in the \author{} case; the pdflatex oracle says there is none. pdflatex 1.40.29 oracle, `\the\pagetotal` after \maketitle: \author{A} 116.86673pt, no warning \author{} 115.33337pt, no warning no \author 116.86673pt, "LaTeX Warning: No \author given." The v1 layout still advances the author line in both empty cases. The 1.53 pt that pdfLaTeX gives back for \author{} is recorded, not modelled. B. Parser::unsupported is the text-mode fallback, but every message it emitted ended with "; unrestricted TeX math mode is not implemented". The message is now "\X is not supported by this compiler version". tests/acceptance.rs' "math ... reported" assertion was satisfied only by that misleading suffix on \tikz ($x^2$ has been implemented for a long time); it now asserts that nothing mentions math mode. Regenerated with their own ignored generators: RECOVERY.md and UNSUPPORTED.md. UNSUPPORTED.md also picks up an \includegraphics message that had changed earlier without a regen. Product path (parser.rs applied to render-pipeline/vendor/compiler locally, then reverted): fixtures/real-world/math-sheet goes from 1 error to 0 errors, 7 warnings, 2 pages (the reference has 2). HW1 stays at 3 pages / 0 errors / 7 warnings and HW2 at 3 / 0 / 8. Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan) Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback) Co-authored-by: d-q222 <[email protected]> Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan) Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback) Co-authored-by: d-q222 <[email protected]> Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
This was referenced Sep 14, 2026
d-q222
added a commit
that referenced
this pull request
Sep 14, 2026
PR #305 (agent/daniel-vpclaude/maketitle-no-author @ 2c09f78) changes Parser::unsupported message text and maketitle-without-author. Merge it before rewriting those diagnostics with help, as the issue coordination requires. Control on unmodified compiler (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 299 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test diagnostic_codes: test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test recovery: test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out - --test supported_latex: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Skipped deeply_nested_input_does_not_blow_the_stack (not in these targets). Next: Diagnostic optional labels/notes/help fields and JSON omit-when-empty. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222)
d-q222
added a commit
that referenced
this pull request
Sep 14, 2026
Compiler Diagnostic gains labels, notes, and help (empty by default). JSON emits them only when set; unset diagnostics stay byte-identical. Incremental mapping shifts label and replacement spans. Merged #305 first so Parser::unsupported text is the post-maketitle wording. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 300 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test diagnostic_codes: test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test recovery: test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out - --test supported_latex: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: rewrite the first ~20 highest-frequency messages with a real help. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]>
d-q222
added a commit
that referenced
this pull request
Sep 14, 2026
Attach optional help (and a primary label where it captions the span) without changing message text. Unsupported commands name package or math mode; packages/environments say what to do; missing $ / } / ] and script markers / \frac get wrap-or-close advice; undefined \ref offers the nearest \label by edit distance; missing includes name the paths tried. Built on the #305 Parser::unsupported wording. No recovery.rs message strings changed. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 300 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test diagnostic_codes: test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test recovery: test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out - --test supported_latex: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test maketitle: test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: none in this lane unless daniel-parent asks; pipeline/CLI/Mac still need a re-pin and part (4). Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]>
d-q222
added a commit
that referenced
this pull request
Sep 14, 2026
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
…th a replacement edit (#277 parts 1+3) (rebase of #346) (#389) * compiler: \maketitle without \author warns like LaTeX; unsupported text commands stop blaming math mode GH#244, both parts. A. latex.ltx defines `\def\@author{\@latex@warning@no@line{No \noexpand\author given}}`, so a missing \author is a warning and the title block is still set. This compiler refused to produce any block and raised an error instead. - A missing \author now gives the warning "No \author given" and the title block, with no author line. - `\author{}`, or only blank \and slots, is an author that is given but empty. pdfLaTeX sets it silently, so there is no diagnostic. The issue asked for a warning in the \author{} case; the pdflatex oracle says there is none. pdflatex 1.40.29 oracle, `\the\pagetotal` after \maketitle: \author{A} 116.86673pt, no warning \author{} 115.33337pt, no warning no \author 116.86673pt, "LaTeX Warning: No \author given." The v1 layout still advances the author line in both empty cases. The 1.53 pt that pdfLaTeX gives back for \author{} is recorded, not modelled. B. Parser::unsupported is the text-mode fallback, but every message it emitted ended with "; unrestricted TeX math mode is not implemented". The message is now "\X is not supported by this compiler version". tests/acceptance.rs' "math ... reported" assertion was satisfied only by that misleading suffix on \tikz ($x^2$ has been implemented for a long time); it now asserts that nothing mentions math mode. Regenerated with their own ignored generators: RECOVERY.md and UNSUPPORTED.md. UNSUPPORTED.md also picks up an \includegraphics message that had changed earlier without a regen. Product path (parser.rs applied to render-pipeline/vendor/compiler locally, then reverted): fixtures/real-world/math-sheet goes from 1 error to 0 errors, 7 warnings, 2 pages (the reference has 2). HW1 stays at 3 pages / 0 errors / 7 warnings and HW2 at 3 / 0 / 8. Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan) Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback) Co-authored-by: d-q222 <[email protected]> Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ * compiler: rustfmt the new maketitle tests Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan) Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback) Co-authored-by: d-q222 <[email protected]> Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ * wip(#277): additive runtime-v1 proposal for diagnostic labels/notes/help Add protocol/proposals/runtime-v1-structured-diagnostics.md only. Optional labels (runtime-v1 source spans + text + primary), notes[], and help {message, replacement?: {start_byte,end_byte,text}} on each diagnostic. message stays one line without recovery; omitted fields keep JSON byte-identical. Frozen contracts and schema are untouched. Ran: none (docs-only checkpoint). Next: merge origin/agent/daniel-vpclaude/maketitle-no-author if it still touches Parser::unsupported, then Diagnostic fields, then the first ~20 helps. Open questions: render-pipeline from_compiler does not forward these fields (or code); CLI #303 and the Mac pipeline path need a later re-pin, out of this lane. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): optional Diagnostic labels/notes/help, JSON omit-when-empty Compiler Diagnostic gains labels, notes, and help (empty by default). JSON emits them only when set; unset diagnostics stay byte-identical. Incremental mapping shifts label and replacement spans. Merged #305 first so Parser::unsupported text is the post-maketitle wording. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 300 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test diagnostic_codes: test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test recovery: test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out - --test supported_latex: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: rewrite the first ~20 highest-frequency messages with a real help. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): real help on the highest-frequency compiler diagnostics Attach optional help (and a primary label where it captions the span) without changing message text. Unsupported commands name package or math mode; packages/environments say what to do; missing $ / } / ] and script markers / \frac get wrap-or-close advice; undefined \ref offers the nearest \label by edit distance; missing includes name the paths tried. Built on the #305 Parser::unsupported wording. No recovery.rs message strings changed. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 300 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test diagnostic_codes: test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test recovery: test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out - --test supported_latex: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - --test maketitle: test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: none in this lane unless daniel-parent asks; pipeline/CLI/Mac still need a re-pin and part (4). Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): revert whitespace-only Diagnostic constructor reflow Restore original `push(Diagnostic::...)` line shape and hang `.with_help` / `.with_label` on the next line, instead of re-indenting the constructor arguments by four spaces. Restore the `rejected entry_path` struct literal to its original indent (only the three new fields added). crates/compiler/src vs merge-base origin/main: - git diff: 347 insertions(+), 59 deletions(-) - git diff -w: 346 insertions(+), 58 deletions(-) Previously 526+/186- vs 422+/82-. Remaining 1-line gap is expansion.rs include-not-found, which changed skip() to Diagnostic::error (not whitespace). Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib: test result: ok. 300 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: emit help.replacement as {source, text} via source_json. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): emit help.replacement as {source, text} via source_json Replacement uses the same source object as labels[].source (path, start_byte, end_byte) plus text, so it can target a different document than the diagnostic (e.g. an included file). Proposal records why; the JSON test asserts the new shape. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib diagnostics:: : test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 297 filtered out Next: drop help that restates the message; real help or none. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): drop help that restates the diagnostic message `\foo is not supported in math mode` no longer gets `\foo is not implemented in math mode`. Known text commands get a mode hint (`\foo is a text command; use it outside math or inside \text{...}`); otherwise no help. command_help/environment_help now return Option: package or did-you-mean or spelling hints stay; generic "recognised but unimplemented" restatements are omitted. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - cargo test --manifest-path crates/compiler/Cargo.toml --lib vocabulary:: : test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 297 filtered out - --test diagnostic_codes: test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: undefined \ref wording should point at \ref{near}, not \label{near}. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): undefined \ref help points at \ref{near}, not \label{near} The user must change the \ref key. When a nearby label exists, help is "a label `near` exists; did you mean \ref{near}?". The no-near fallback is unchanged. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - --test diagnostic_codes undefined_ref: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out Next: unknown_command did-you-mean help.replacement on the command span. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): unknown_command did-you-mean help.replacement on the command span `\alpah` keeps suggestion `\alpha` and now also help "did you mean \alpha?" with replacement {source, text:"\alpha"} covering the exact command span. with_optional_help does not overwrite that replacement. JSON test covers the protocol compile_result object. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - --lib diagnostics:: : test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 298 filtered out - --test diagnostic_codes: test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: incremental test that label and help.replacement spans shift. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#277): incremental test for label and help.replacement spans shift_diagnostics maps label and replacement when an edit is before the span, and returns None (invalidate) when the edit overlaps. Session edits of `\alpah` keep both spans on the command bytes and match a clean build; parser diagnostics still force today's full recompile. Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-structdiag): - --lib incremental::tests::shift_diagnostics: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 304 filtered out - --lib incremental::tests::edit_before_a_labelled: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 304 filtered out - --lib incremental::tests::edit_inside_a_labelled: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 304 filtered out Next: full compiler gates (--lib, diagnostic_codes, recovery, supported_latex, maketitle, then cargo test -p compiler). Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: d-q222 <[email protected]> Co-authored-by: Cursor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #244. Lane
daniel-vpclaude(Claude Pro, mac-m5pro-dq222), allocated by the Commander on #2 at 04:23Z. Based on main9bd4b025, independent of #276/#304. It adds no inventory rows.A.
\maketitlewithout an author follows LaTeXlatex.ltx has
\def\@author{\@latex@warning@no@line{No \noexpand\author given}}. Before, the compiler produced no title block and raised an error.\authorNo \author given, block without an author line\pagetotal116.86673pt\author{}/ blank\andslots\pagetotal115.33337pt\author{A}The issue asked for a warning on
\author{}, but pdflatex gives none, so this follows pdflatex.Recorded, not modelled: pdfLaTeX's empty
\author{}box is 1.53 pt shorter than a missing author. The v1 layout advances the author line in both cases.\titlemissing is still an error, as in LaTeX, and the\and/\thankscases are unchanged.B.
Parser::unsupportedno longer blames math modeEvery unsupported text command ended in "; unrestricted TeX math mode is not implemented". It now reads
\X is not supported by this compiler version.A decorative check:
tests/acceptance.rs::math_and_unsupported_commands_are_reported_never_silentasserted a "math mode is not implemented" message fortext $x^2$ and \tikz{a}. It passed only because of that suffix on\tikz;$x^2$itself has long been implemented. It now asserts that no message mentions math mode.Evidence
cargo test --no-fail-fastfor the compiler crate: everything green after regeneratingRECOVERY.md(the only stale pin).tests/maketitle.rs: 14 pass. Three tests replace the old "error, not a placeholder" test.RECOVERY.mdandUNSUPPORTED.md. The latter also picks up an earlier\includegraphicsmessage change that was never regenerated.parser.rstorender-pipeline/vendor/compiler, rebuiltflashtex check, then reverted.math-sheetHW1HW2math-sheet/reference.pdf. This machine has pdflatex but no PDF text extractor (pdftotext), and I didn't add a dependency for it.crates/compiler/fixtures/recovered.{legacy,negotiated}.jsonstill contain the old message. No test reads them, and their hashes are cited in handoff audits.docs/evidence/*snapshots.apps/mac/Sourcesparses it.render-pipeline/vendor/compilerre-pin, as with compiler: text accents \c \v \u \H \r \k \d \b compose their dfu characters (#243) #304.🤖 Generated with Claude Code
https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ