Repository navigation
Conversation
…them
`\paragraph` and `\subparagraph` raised `\paragraph is not supported by
this compiler version`. That diagnostic is stale: they are `\@startsection`
with a *negative* after-skip (article.cls 406-414), and `\@xsect`'s
negative branch never sets the head as a block of its own — it arms
`\everypar`, throws away the following paragraph's `\parindent` box and
sets the head into that paragraph's first line instead. The render pipeline
lays them out correctly from the source, so the error was reporting a gap
that no longer exists.
The right thing for this layer is therefore to take the star and the
optional short title and then get out of the way: the braced title falls
through to the main token loop as ordinary body text, which is exactly the
material LaTeX runs into the following paragraph, in the right place and
with the right spans. `flush_paragraph` is deliberately not called, for the
same reason — a run-in head does not start a new paragraph.
**No geometry changes.** Measured on the 22-document real-world corpus with
the vendored compiler patched to this change (local only; never committed):
dx 85.17%, dy 65.74%, both 59.46%, 14002 aligned words, page counts 20/22 —
identical to the same build without it, to the last word. What changes is
that `fixtures/real-world/ps-calculus` no longer reports four
`unsupported_feature` errors, and a probe of all three forms reports none.
`\paragraph*[short]{...}` is left alone: `\@startsection`'s starred form
takes no optional argument, and pdflatex itself typesets the brackets there
(`[Short]Solution.`), so there is no oracle behaviour to match.
Inventory: both commands move out of `KNOWN_UNIMPLEMENTED_COMMANDS` into
`BUILT_INS` and the supported-LaTeX inventory; the generated artefacts
(`docs/user/compiler.md`, `supported/supported-latex.json`,
`supported/coverage.md`) are regenerated with
`crates/compiler/scripts/render_supported_latex.sh`.
**A vendor re-pin is required** for the rendered corpus to see this:
`crates/render-pipeline/vendor/compiler` is a frozen snapshot (`e44d5917`)
and is deliberately not touched here. The pipeline side of this feature is
a separate PR and needs no re-pin — it reads the command back from the
source, so it works against the existing pin either way.
`cargo test --release --no-fail-fast` on crates/compiler: 583 passed, 0
failed, 4 ignored (was 577; the new `run_in_headings_are_accepted_...`
test plus the two doc/inventory gates).
Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
|
Rebased onto current Still no geometry effect, which is the whole point of it: it retires a stale |
ac2f332 to
0c25485
Compare
|
Confirming the re-pin point, since you asked: it is already in the PR body under "Vendor re-pin required", and it still holds on the rebased branch.
The only place I touched a vendored file was to measure — I patched For the record, the merge order is free: #404 reads the command back from the source, so it renders |
|
Superseded by #474, this branch rebased onto current main with two fixes.
On the title's re-pin note: still accurate. Measured on the compiler route, main vs #474: the error goes away, and the star and optional short title stop being typeset ( Branch |
Rebase of #407 onto current main, with two fixes it needed. 1. #407 regenerated `crates/compiler/supported/{supported-latex.json, coverage.md}` and `docs/user/compiler.md` but not the Mac app's bundled copy, so its "bundled inventory matches the compiler" CI check failed and merging it as-is would have turned that gate red on main. All four artefacts are regenerated here with `crates/compiler/scripts/render_supported_latex.sh`, which since #408 also runs `apps/mac/scripts/sync-supported-latex.sh`. 2. The new test carried a duplicated `#[test]` attribute, which rustc accepts with a `duplicate_macro_attributes` warning and then runs the test twice. Removed. Measured effect on the direct compiler route (`flashtex-compiler`, and `crates/bridge`, both of which build against `crates/compiler` rather than the vendor), main vs this branch: \paragraph{Solution.} Body text. main: recovered, 'Solution.Bodytext.', error/unsupported_feature: \paragraph is not supported by this compiler version this: ok, 'Solution.Bodytext.', no diagnostics \paragraph*{Solution.} Body text. main: recovered, '*Solution.Bodytext.' <- the star was typeset this: ok, 'Solution.Bodytext.' \paragraph[Short]{Solution.} Body text. main: recovered, '[Short]Solution.Bodytext.' <- the short title was typeset this: ok, 'Solution.Bodytext.' So the title already fell through as body text before this change; what changes is that the spurious error is retired and the star and the optional short title are consumed as the command parameters they are instead of being set on the page. `\section` is unaffected. The vendor re-pin note in #407's title is still accurate: `crates/render-pipeline/vendor/compiler/PIN` is `faa7d484`, which predates this change, so the render pipeline keeps erroring on `\paragraph` until a separate re-pin PR. The pipeline side is already in place on main — `adapter.rs::run_in_heading_at` and `apply_run_in_heading` read the command back from the source and give the head its weight, indent and `\hskip 1em`. This change is the compiler-side prerequisite for that. Verified on this Linux worktree with the font environment set (FLASHTEX_FONT_DIRS + FLASHTEX_TFM_DIRS, without which ~110 tests silently skip and report as passes): crates/compiler 644 passed, 0 failed, 5 ignored (main: 643/0/5) crates/bridge 170 passed, 0 failed, 2 ignored (unchanged) Implementation-Agent: nixos-gfxsec lane (original PR #407) Rebased-By: linux-primary integration lane (Claude Code agent af761de6) Commit-Executor: Claude Code agent af761de6 on linux-primary (direct Git, Cursor usage limit fallback per AGENTS.md) Co-authored-by: GoKubar <[email protected]>
… (rebase of #407, + inventory sync and duplicate-attribute fixes) (#474) * compiler: accept `\paragraph`/`\subparagraph` instead of erroring on them `\paragraph` and `\subparagraph` raised `\paragraph is not supported by this compiler version`. That diagnostic is stale: they are `\@startsection` with a *negative* after-skip (article.cls 406-414), and `\@xsect`'s negative branch never sets the head as a block of its own — it arms `\everypar`, throws away the following paragraph's `\parindent` box and sets the head into that paragraph's first line instead. The render pipeline lays them out correctly from the source, so the error was reporting a gap that no longer exists. The right thing for this layer is therefore to take the star and the optional short title and then get out of the way: the braced title falls through to the main token loop as ordinary body text, which is exactly the material LaTeX runs into the following paragraph, in the right place and with the right spans. `flush_paragraph` is deliberately not called, for the same reason — a run-in head does not start a new paragraph. **No geometry changes.** Measured on the 22-document real-world corpus with the vendored compiler patched to this change (local only; never committed): dx 85.17%, dy 65.74%, both 59.46%, 14002 aligned words, page counts 20/22 — identical to the same build without it, to the last word. What changes is that `fixtures/real-world/ps-calculus` no longer reports four `unsupported_feature` errors, and a probe of all three forms reports none. `\paragraph*[short]{...}` is left alone: `\@startsection`'s starred form takes no optional argument, and pdflatex itself typesets the brackets there (`[Short]Solution.`), so there is no oracle behaviour to match. Inventory: both commands move out of `KNOWN_UNIMPLEMENTED_COMMANDS` into `BUILT_INS` and the supported-LaTeX inventory; the generated artefacts (`docs/user/compiler.md`, `supported/supported-latex.json`, `supported/coverage.md`) are regenerated with `crates/compiler/scripts/render_supported_latex.sh`. **A vendor re-pin is required** for the rendered corpus to see this: `crates/render-pipeline/vendor/compiler` is a frozen snapshot (`e44d5917`) and is deliberately not touched here. The pipeline side of this feature is a separate PR and needs no re-pin — it reads the command back from the source, so it works against the existing pin either way. `cargo test --release --no-fail-fast` on crates/compiler: 583 passed, 0 failed, 4 ignored (was 577; the new `run_in_headings_are_accepted_...` test plus the two doc/inventory gates). Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary) Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit) * compiler: preamble \setlength, \addtolength and TeX length assignments (rebase of #432 onto current main) (#473) * compiler: preamble \setlength, \addtolength and TeX length assignments The compiler half of lane #258, split from agent/daniel-parent/preamble-lengths @ 695dfaa (20 reviewed WIP commits). The render-pipeline half is its own PR. - \setlength and \addtolength are accepted in the preamble, along with direct TeX assignments (\parindent=10pt) to the page and paragraph lengths; plus/minus glue is parsed. - Units use TeX's scan_dimen factors: bp is 1.00375pt (it was treated as pt), plus dd, cc and sp; ex uses the cmr x-height. - An unresolved length reference, including a page length such as \setlength{\textwidth}{\paperwidth}, warns instead of being silently dropped. - The inventory is regenerated; both supported-latex.json copies are byte-identical. What was run (CARGO_TARGET_DIR=target-prelen): cargo test --manifest-path crates/compiler/Cargo.toml test result: ok. 327 passed; 0 failed; 0 ignored (lib) test result: ok. 10 passed; 0 failed; 0 ignored (preamble_lengths) All other test binaries ok, 0 failed. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa) Commit-Executor: daniel-parent (split into compiler and pipeline PRs) Lane-Owner: daniel-parent (mac-m5pro-dq222) Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz * wip(#432): keep user-defined skip registers out of parser addtolength HOST_PRELUDE no longer undefines \setlength/\addtolength. When the target is already defined (\newlength skip), the kernel assignment/\advance runs so \the can read it back. Undefined preamble lengths still pass through as host commands mapped back to \setlength/\addtolength with the full csname. \parindent TeX assignment and \addtolength are silent in the preamble; \setlength{\parindent}{nonzero} still warns. Ran: cargo test --manifest-path crates/compiler/Cargo.toml --test kernel_untested_a addtolength before: FAILED 0 passed; 1 failed (Missing number; \addtolength{\\}) after: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 20 filtered out cargo test --test preamble_lengths test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out Next: full compiler crate tests and render-pipeline --lib. Open questions: none. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent (direct git commit) Lane-Owner: daniel-parent (mac-m5pro-dq222) Co-authored-by: Cursor <[email protected]> * wip(#432): full compiler crate and render-pipeline lib green ASCII-only wording in the HOST_PRELUDE comment. No behaviour change. Ran: CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen cargo test --manifest-path crates/compiler/Cargo.toml every test result: ok (lib: 331 passed; 0 failed; kernel_untested_a: 20 passed; 0 failed; 1 ignored) cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib test result: ok. 121 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out Next: push this lane branch. No remaining acceptance gaps. Open questions: none. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast Commit-Executor: cursor-agent (direct git commit) 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]> --------- Co-authored-by: d-q222 <[email protected]> Co-authored-by: Cursor <[email protected]>
What
\paragraphand\subparagraphraised\paragraph is not supported by this compiler version. That diagnostic is stale: they are\@startsectionwith a negative after-skip (article.cls 406-414), and\@xsect's negative branch never sets the head as a block of its own — it arms\everypar, throws away the following paragraph's\parindentbox and sets the head into that paragraph's first line instead. The render pipeline lays them out correctly from the source (#404), so the error reports a gap that no longer exists.The right thing for this layer is to take the star and the optional short title and then get out of the way: the braced title falls through to the main token loop as ordinary body text, which is exactly the material LaTeX runs into the following paragraph, in the right place and with the right spans.
flush_paragraphis deliberately not called, for the same reason — a run-in head does not start a new paragraph.No geometry changes
Measured on the 22-document real-world corpus with the vendored compiler patched to this change (local only, never committed), against the same build without it:
Identical to the last word. What changes is that
fixtures/real-world/ps-calculusno longer reports fourunsupported_featureerrors, and a probe of all three forms reports none at all.Vendor re-pin required
crates/render-pipeline/vendor/compileris a frozen snapshot (e44d5917) and is deliberately not touched here —git diff --name-only -- crates/render-pipeline/vendoris empty. For the rendered corpus and the Mac shell's Problems panel to see this,vendor/compilermust be re-pinned to amainthat contains it, in its own PR.The pipeline side (#404) needs no re-pin and does not depend on this one: it reads the command back from the source, so it produces correct geometry against the existing pin either way. The two can merge in either order — verified by building the merge of both branches with the vendored compiler patched: no diagnostics, and all 36 words of the three-form probe within 0.01 bp of pdflatex.
Scope note
\paragraph*[short]{...}is left alone.\@startsection's starred form takes no optional argument, and pdflatex itself typesets the brackets there — it sets[Short]Solution.— so there is no oracle behaviour to match. The test says so explicitly rather than pinning our own guess.Inventory
Both commands move out of
KNOWN_UNIMPLEMENTED_COMMANDSintoBUILT_INSand the supported-LaTeX inventory. Generated artefacts regenerated withcrates/compiler/scripts/render_supported_latex.sh:docs/user/compiler.mdcrates/compiler/supported/supported-latex.jsoncrates/compiler/supported/coverage.mdGates
cargo test --release --no-fail-fastoncrates/compiler: 583 passed, 0 failed, 4 ignored (was 577 — the newrun_in_headings_are_accepted_and_keep_their_title_as_body_texttest plus the two doc/inventory drift gates).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu