Skip to content

compiler: text accents \c \v \u \H \r \k \d \b compose their dfu characters (#243) (rebase of #304) - #392

Merged
GoKubar merged 9 commits into
mainfrom
agent/linux-integration/text-accents-rebase
Sep 14, 2026
Merged

GoKubar merged 9 commits into
mainfrom
agent/linux-integration/text-accents-rebase

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Rebase of #304 onto main after #317, #320, #322, #331 and #339 landed in the same generated artefacts. #304 is closed in favour of this one.

Four conflicts, all in generated output: docs/user/compiler.md, crates/compiler/supported/supported-latex.json, crates/compiler/supported/coverage.md and the bundled Mac copy. Resolved by regenerating with crates/compiler/scripts/render_supported_latex.sh followed by apps/mac/scripts/sync-supported-latex.sh, never by hand-merging.

Every compiler source file merged without conflict. I checked the one place that worried me — this branch's \allowdisplaybreaks arm and #322's \pagestyle/\thispagestyle/\pagenumbering arms sit in the same preamble-or-body match group — and all four arms are present after the merge.

Verified locally: cargo test --release --no-fail-fast in crates/compiler, 0 failed; apps/mac/scripts/sync-supported-latex.sh --check green.

One note on file lists: GitHub showed #304 as touching a dozen Swift files under apps/mac/, which is an artefact of the merge commits on that branch. The real merge-base diff (git diff origin/main...) has no Swift — the only apps/ file is the generated Resources/supported-latex.json that CI requires to stay byte-identical to the compiler's copy. That is also true of this PR.

Original #304 description follows.


Text accents \c \v \u \H \r \k \d \b compose their decomposed-form-unified characters, plus \( ... \) as inline math and \allowdisplaybreaks as a preamble no-op. A document's own \v/\b definitions still win over the builtins.

jay3332 and others added 8 commits September 13, 2026 22:03
… 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
…acters

GH#243. Every letter-named text accent reported "\X is not supported by
this compiler version"; only the control-symbol accents composed, and
those only in render-pipeline's adapter. The issue named \c and \v, but
\u \H \r \k \d \b failed the same way on main.

One parser arm reads the argument the way TeX does: a braced single
letter, \i, \j or nothing, or unbraced, the next letter only (so
`\v sice` accents the s). It emits one text inline, spanning the command
and its argument, holding the character tex-text-encoding's
UNICODE_DECLARATIONS (inverted *.dfu) declares for `\<accent> <base>`.
This is LaTeX's own table rather than a hand list. Two quirks of that
table are handled: U+01F0 is spelled `\v\j` without the space, and the
no-space spelling is tried only for control-sequence bases, since `\dh`
is eth, not `\d h`.

Recovery paths:
- no declared character (`\b{a}`, `\c{x}`): the bare letter plus a
  warning. The \accent overlay is not drawn.
- `\k` in OT1: LaTeX's "unavailable in encoding" error, then the letter.
- a group that is not one letter: a warning, and the group is typeset.

Inventory regenerated: kernel coverage 163 -> 171 of 410. The Mac copy
of supported-latex.json is synced as the CI check requires.

Known, pre-existing, not changed here: the v1 Times layout does not kern
across inline boundaries, so `x\c{c}y` loses the x-c kern exactly as
`x\o{}y` already does. The tests compare each accent in isolation.

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
No behaviour change. rustfmt cannot split the diagnostic format! strings,
so the surrounding code lines are wrapped by hand. Crate-wide fmt --check
and clippy -D warnings already fail on the base in files this lane does
not touch (color.rs, expansion.rs, date.rs, ...); none of those findings
are in the lines added here.

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
Math-heavy documents often \renewcommand{\v}[1]{\mathbf{#1}} or
\def\b{...}. Making the accent letters host built-ins must not shadow
those definitions; this test pins that the user's macro is expanded, not the
caron.

Gate evidence (no commit): with this lane's parser.rs and text_builtins.rs
applied locally to render-pipeline/vendor/compiler and then reverted,
`flashtex check fixtures/real-world/unicode-accents/main.tex` went from
2 errors to 0 errors, 22 warnings (CJK/glyph coverage). In the v2 display
list, fa\c{c}ade and Ko\v{s}ice are 32.847 bp and 33.506 bp wide, the same
as the precomposed façade and Košice on the line above.

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
…rtefacts

main (#343's batch) moved the generated inventory. All four conflicts were
generated files: docs/user/compiler.md, crates/compiler/supported/
{supported-latex.json,coverage.md}, and the Mac bundled copy. Regenerated
them with crates/compiler/scripts/render_supported_latex.sh and copied the
Mac copy byte-for-byte (CompletionTests.testBundledInventoryMatchesTheCompiler).
Counts: 253 text, 542 math, 48 environments, 14 packages.

cargo test --no-fail-fast -p compiler: every binary ok except
robustness::deeply_nested_input_does_not_blow_the_stack (debug-build stack
overflow), which fails the same way on main 8f83ab5.

Picked up after daniel-vpclaude's handoff. Commit-Executor: daniel-parent (Claude Code, mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… the supported-LaTeX artefacts after #380 and sync the Mac copy

Conflicts were generated files only; regenerated with render_supported_latex.sh
and copied the Mac bundled inventory byte-for-byte.

Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
) and \pagestyle family (#322) parser arms

parser.rs conflict: #322 added the pagestyle/thispagestyle/pagenumbering arms
where this branch (carrying #276's commit) added allowdisplaybreaks; kept both.
Regenerated supported-LaTeX artefacts and synced the Mac copy.

Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…acters (#243)

Rebase of #304 onto main after #317, #320, #322, #331 and #339 landed in the
same generated artefacts.

Four conflicts, all in generated output: `docs/user/compiler.md`,
`crates/compiler/supported/supported-latex.json`,
`crates/compiler/supported/coverage.md` and the bundled Mac copy. Resolved
by regenerating with `crates/compiler/scripts/render_supported_latex.sh`
followed by `apps/mac/scripts/sync-supported-latex.sh`, never by
hand-merging. Every compiler source file merged without conflict; the
`\allowdisplaybreaks` arm and #322's `\pagestyle`/`\thispagestyle`/
`\pagenumbering` arms are both present, verified after the merge.

Verified on this branch: `cargo test --release --no-fail-fast` in
crates/compiler, 0 failed; `apps/mac/scripts/sync-supported-latex.sh --check`
green.

Implementation-Agent: Claude Opus 5 (lane linux-integration, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

daniel-parent (carrying daniel-vpclaude's #304): confirmed. This branch is built on my merge commits, including a329302a, which resolved the one non-generated conflict: parser.rs, where #322's \pagestyle/\thispagestyle/\pagenumbering arms met #276's \allowdisplaybreaks arm. All four arms are present exactly once. The full crates/compiler suite on this head (--no-fail-fast) gives 47 binaries ok, 0 failed. OK to queue in place of #304; it also lands #276's \( … \) inline-math commit.

…st with #390's uline/underline/sout, regenerate the artefacts

Implementation-Agent: Claude Opus 5 (lane linux-integration, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
@GoKubar
GoKubar merged commit 02415f2 into main Sep 14, 2026
20 checks passed
@GoKubar
GoKubar deleted the agent/linux-integration/text-accents-rebase branch September 14, 2026 15:17
GoKubar added a commit that referenced this pull request Sep 14, 2026
…st with #392's allowdisplaybreaks, regenerate the artefacts

Implementation-Agent: Claude Opus 5 (lane linux-integration, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
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