Skip to content

compiler: \( … \) is inline math; \allowdisplaybreaks is a preamble no-op - #276

Closed
jay3332 wants to merge 1 commit into
mainfrom
agent/mac-compiler/paren-inline-math
Closed

jay3332 wants to merge 1 commit into
mainfrom
agent/mac-compiler/paren-inline-math

Conversation

@jay3332

@jay3332 jay3332 commented Sep 14, 2026

Copy link
Copy Markdown
Member

\( and \) were lexed as the literal words ( and ), so every LaTeX-style inline formula was typeset as text (\(x_t\) → "(x" + math script marker used outside math mode; \(\alpha\) → \alpha is not supported). The owner's 158-line notes document, written entirely with \( \), came back with 129 errors.

  • Lexer: InlineMathOpen/InlineMathClose beside \[/\]; expansion converter, math-mode delimiter arm, \text literal table and siunitx raw scan updated.
  • Parser: paren_math = bracket_math with display=false → identical content, layout and recovery to $…$ (unterminated ends with its paragraph; stray \) reported and dropped).
  • \allowdisplaybreaks[0-4] (amsmath): preamble no-op instead of an error; inventory + bundled JSON regenerated (+1 kernel command).

Gates: compiler cargo test --release --no-fail-fast 473 passed / 0 failed (4 new in tests/paren_inline_math.rs); inventory drift gates green; sync-supported-latex.sh run. Through the pipeline with this compiler patched into the vendor mirror locally: notes document 129 → 24 errors, 4 pages like the pdflatex reference (remaining: \uline ×19 (ulem), \odot ×2 (kernel cmsy slot unmapped), \maketitle without \author (#244), \boxed frame).

Integrator: vendor mirror not touched — re-pin crates/render-pipeline/vendor/compiler from main after this lands (VENDORING.md) so the app/CLI get it. Touches supported.rs/inventory, so it conflicts with #230/#247 on those generated files: land it first or regenerate on rebase.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn

… no-op

`\(` and `\)` fell through the lexer's control-symbol branch and became the
literal words "(" and ")", so every LaTeX-style inline formula was typeset
as text: `\(x_t\)` printed "(x" with "math script marker used outside math
mode", `\(\alpha\)` reported \alpha as unsupported, and a 158-line notes
document written entirely with \( \) came back with 129 errors.

Lexer: `\(`/`\)` are `InlineMathOpen`/`InlineMathClose` beside the `\[`/`\]`
pair; the expansion converter, the math-mode "unexpected delimiter" arm, the
\text-argument literal table and siunitx's raw-text scan learn the two new
kinds. Parser: `paren_math` is `bracket_math` with display = false, so the
content, layout and recovery are exactly `$...$`'s (an unterminated `\(`
ends with its paragraph; a stray `\)` is reported and dropped).

`\allowdisplaybreaks[<0-4>]` (amsmath) only permits page breaks inside
displays; it is now a preamble no-op instead of an error, registered in
BUILT_INS, TEXT_COMMANDS and the vocabulary; inventory artifacts and the
bundled supported-latex.json regenerated (kernel command count +1).

Tests: tests/paren_inline_math.rs — same typeset items as `$`, inside a list
and through a \newcommand, the unterminated and stray cases. Compiler suite
473 passed / 0 failed. Through the render pipeline with this compiler
patched into the vendor mirror: the notes document 129 → 24 errors, 4 pages
like its pdflatex reference; the rest are \uline (ulem), \odot (kernel cmsy
slot not yet mapped), \maketitle without \author (#244) and \boxed's frame.

The render-pipeline vendor mirror is not touched here; re-pin it from main
(`git archive`, VENDORING.md) after this lands so the app and CLI pick it up.

Implementation-Agent: Claude Code (mac-claude-a)
Commit-Executor: git via Claude Code
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

daniel-parent: this PR's commit (c55b0e04: \( … \) is inline math; \allowdisplaybreaks is a preamble no-op) landed on main inside #392, the integration lane's squash of daniel-vpclaude's #304, which was stacked on this branch. Main now has the "allowdisplaybreaks" parser arm. This PR can be closed as included. (Its owner mac-claude-a was on the stopped mac-m1max-a, so I'm leaving the close to the Commander/integration lane.)

@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Closing: this landed on main. The ( … ) inline-math tests from this PR — paren_math_inside_a_list_and_a_macro, stray_paren_close_is_reported_and_dropped, unterminated_paren_math_ends_with_its_paragraph — are on main (carried by #392, commit 02415f2, and the #451 vendor re-pin, 19754f9), and \allowdisplaybreaks is handled as a preamble no-op at crates/compiler/src/parser.rs:2898. Branch tip is not an ancestor of main only because the content was re-landed, not merged from this branch.

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the agent/mac-compiler/paren-inline-math branch September 16, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants