Repository navigation
compiler: accept \text and \boxed in text mode (#834) - #844
Merged
Merged
Conversation
amstext defines \text as \ifmmode...\else\mbox\fi, so pdflatex accepts it
outside math. FlashTeX raised error[unsupported_feature] with the help
"wrap this in math mode" -- advice the user cannot act on, since they are
already in text mode. It fired in all 20 documents of a real-user corpus.
Text-mode \text{...} is now \mbox{...} with no diagnostic. The old path also
swallowed single-word arguments (Before\text{ after}After. lost "after");
those now survive, matching the oracle.
Text-mode \boxed{...} now draws its frame, reusing the frame-environment path.
Measured against /Library/TeX/texbin/pdflatex (pdfTeX 1.40.29, TeX Live 2026)
with \documentclass[11pt]{article} + \usepackage{amsmath,amssymb}; the log
confirms amsmath.sty and amstext.sty actually loaded.
Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: daniel-parent
Co-authored-by: muse-spark-1.3-contributor <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
Two CI failures, same cause for all three of these PRs. The branch predated the TAB catcode merge, so its diff against current main deleted crates/tex-expansion/src/catcode.rs's new lines and the whole of crates/compiler/tests/tab_whitespace.rs -- merging it would have silently reverted that fix. Merged origin/main in. `bundled inventory matches the compiler` failed because the lane regenerated crates/compiler/supported/supported-latex.json but could not touch apps/**, which is outside Muse's editable scope, leaving the Mac app's copy stale. The two must be byte-identical: Completion.Vocabulary decodes the bundled copy and the editor's completion vocabulary is generated from it, never hand-written. Ran apps/mac/scripts/sync-supported-latex.sh; --check now passes. Commit-Executor: daniel-parent Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
d-q222
added a commit
that referenced
this pull request
Sep 18, 2026
…facts #844 (\text/\boxed) and #845 (list) landed on main while this branch was open, and both touch crates/compiler/src/parser.rs next to this branch's work. Two genuine source conflicts, resolved structurally rather than by side: 1. The text-mode dispatch arms. This branch adds `"strut"`, main adds `"text"` and `"boxed"`. All three belong; kept all three. 2. `fn inline_sets_a_box` (this branch, #843) against `fn inline_text` (main, #845). A naive keep-both does NOT work here: this branch's side ends mid-body and is closed by the `}` that follows the conflict block, so concatenating the two sides produced an unclosed delimiter. Closed inline_sets_a_box explicitly and let inline_text take the trailing brace. Verified `cargo check` reports 0 errors and all three of inline_sets_a_box / inline_text / plain_inline_text are present exactly once. Generated artifacts (supported-latex.json x2, coverage.md, docs/user/compiler.md) regenerated with render_supported_latex.sh from the resolved source rather than taking either side, since neither side's counts are correct after the merge. apps/mac sync --check passes. Commit-Executor: daniel-parent Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
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.
Fixes #834, a false error firing in all 20 documents of a real-user corpus.
amstext.stydefines\textas\ifmmode…\else\mbox\fi, so pdflatex accepts it outside math. FlashTeX raisederror[unsupported_feature]with the help "wrap this in math mode" — advice the user cannot act on, because they are already in text mode. The rendered output was already correct (pdftotextmatched,pdffontsconfirmed\Largewas honoured), so this was a red error on correct output.\text{...}is now\mbox{...}with no diagnostic.Before\text{ after}After.lost "after". Those now survive, matching the oracle.\boxed{...}now draws its frame, reusing theframe-environment path.Tests:
crates/compiler1,058 passed / 0 failed. Newtext_mode_commandssuite: 8 passed, covering math-mode\textstill clean, empty/leading/trailing argument edges, both\boxedcases, and absence of the bad help string.Oracle:
/Library/TeX/texbin/pdflatex(pdfTeX 1.40.29, TeX Live 2026 — not the shipped 2024 logs), preamble\documentclass[11pt]{article}+\usepackage{amsmath,amssymb}; the log confirmsamsmath.styandamstext.styactually loaded, exit 0, zero!lines.crates/compiler, so it does not reach users until the vendor re-pin.Implemented by a sandboxed Muse lane; committed and published by the Commander after verification.
🤖 Generated with Claude Code