Repository navigation
compiler: \pagebreak right after \noindent, \indent or \textbf{ is horizontal (GH-PAGEBREAK-MIDPARAGRAPH; stacked on #583) - #616
Merged
Conversation
…ry and parameter nodes (#64) What changed: - New AST: Inline::Penalty {value, unskip} (\penalty, \nobreak, \allowbreak, \linebreak[n], \nolinebreak[n]), Inline::PagePenalty (\pagebreak[n] and \nopagebreak[n] inside a paragraph: \vadjust, the paragraph is not broken), Inline::Discretionary (\-, \discretionary{}{}{}), Block::Penalty {value, fil} (vertical-mode \penalty/\nobreak, \pagebreak[n<4], \nopagebreak[n], \goodbreak, \filbreak). Values are latex.ltx's \@getpen 0/51/151/301/10000. - Parsed::parameters: \tolerance, \pretolerance, \looseness, \widowpenalty, \clubpenalty, \interlinepenalty, \emergencystretch (also \setlength), \sloppy, \fussy, sloppypar, \samepage (and its environment), \raggedbottom, \flushbottom, \enlargethispage(*), each with the group end that restores it. Parsed::hyphenation: \hyphenation words. - \- is a command in the lexer and the expansion pass, so it is never typeset as a hyphen; \penalty's number and parameter values no longer leak as text. - Core 14 layout: forced penalties break lines/pages; \pagebreak in a paragraph ends the page after its line (FlowState carries the pending eject). - Inventory, vocabulary and generated supported-LaTeX artefacts regenerated. What was run: - cargo test (crates/compiler): 573 passed; 0 failed before the inventory move, then --lib: test result: ok. 347 passed; 0 failed - --test supported_latex: test result: ok. 8 passed; 0 failed - --test hw1_preamble/hw2_gate/corpus_gate/pinned_fixtures/incremental_json_identity/ local_recovery/preamble_page_commands/line_break_skip: all ok - pdflatex \showlists / \showthe oracle for every value (in the PR body). Next step: render-pipeline consumes the nodes after vendor/compiler is re-pinned. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
#64) What changed: - Inline::Penalty/PagePenalty spans now include `[n]` and `\penalty`'s number, so a consumer reading the source after a node starts past them (the pipeline decides whether LaTeX ate the blanks after the command from this). What was run: - cargo test --lib (crates/compiler): test result: ok. 347 passed; 0 failed Next step: open the compiler PR and the render-pipeline draft. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…alty, \nobreakdash (#64) What changed: - \include{file} emits latex.ltx \@include's \clearpage before the file and after it (expansion.rs: the closing one precedes the first token read once the engine has left the file). A file \includeonly skips keeps only the first; a missing file keeps both. \input is unchanged. - A vertical-mode \pagebreak (priority 4) is Block::Penalty { value: -10000 } instead of Block::PageBreak: latex.ltx has no \vfil before it, unlike \newpage, so a \flushbottom page it ends is stretched. - amsmath \nobreakdash: the following -, -- or --- as text, then Inline::Penalty 10000 (\setboxz@h{--\nobreak}\unhbox\z@). Supported-LaTeX artefacts regenerated. What was run: - cargo test --lib: test result: ok. 349 passed; 0 failed - cargo test --no-fail-fast (whole crate): every target ok after render_supported_latex.sh (supported_latex: ok. 8 passed; includeonly: ok. 10 passed) - pdflatex probes with the render pipeline (scratch export): include 3/3 pages, include-para, include-two 4, include-last 2, includeonly-excluded 2: all match. Next step: render-pipeline draft consumes the bare penalty (flushbottom) and \nobreakdash's hyphenation; vendor re-pin past #568 and this PR. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What changed: - Reverted the \include \clearpage emission in expansion.rs and the includeonly test changes from the previous commit: #578 (render pipeline, agent/daniel-parent/include-float-numbering) already clears the page before and after an \include'd file, and the coordinator moved that item there. The vertical \pagebreak penalty and \nobreakdash stay. What was run: - cargo test --lib: test result: ok. 349 passed; 0 failed - cargo test --test includeonly: test result: ok. 9 passed; 0 failed - cargo test --test supported_latex: test result: ok. 8 passed; 0 failed Next step: render-pipeline draft for \pagebreak under \flushbottom, \nobreakdash hyphenation, \enlargethispage and the \clearpage float flush. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…rizontal (GH-PAGEBREAK-MIDPARAGRAPH) What changed: - The `\pagebreak`/`\nopagebreak` arm decided the mode from whether the paragraph had collected any inline. `\noindent`, `\indent` and the text font commands (`\hmode@bgroup` = `\leavevmode\bgroup`) start the paragraph without adding one, so `\noindent\pagebreak text` was a vertical penalty before the paragraph (on an empty page it was dropped entirely). A new parser flag `paragraph_started` is set by those commands and cleared when a block is pushed or the paragraph is flushed; with it set the command is `Inline::PagePenalty` (latex.ltx `\@no@pgbk`'s `\vadjust`). - A paragraph holding only `\label`s is still vertical: `\label{a}\pagebreak text` is a `Block::Penalty` again. pdflatex (TeX Live 2026, article): `\noindent\pagebreak`, `\indent\pagebreak` and `\textbf{\pagebreak Bold}` before a two-line paragraph end page 1 after the paragraph's first line; `\label{a}\pagebreak` ends it before the paragraph. A mid-paragraph `\pagebreak` (inline, on its own line, `[1]`, `[2]`, `\nopagebreak`) was already right on this stack. What was run: - cargo test --lib -- pagebreak: test result: ok. 6 passed; 0 failed - cargo test (crates/compiler): see the PR Next step: re-pin vendor/compiler for the pipeline tests in the stacked pipeline PR. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
Contributor
Author
|
daniel-parent independent review (subagent)
All three behavioral claims and the unit tests hold with direct evidence, not just "it compiled." No issues found. |
Kept both sides of the supported.rs inventory (main's \xspace entry plus this branch's penalty-based page/paragraph-control entries) and regenerated docs/user/compiler.md, supported-latex.json, coverage.md and the Mac bundled copy via render_supported_latex.sh. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
…followups Brings in origin/main via the parent PR #568 branch's merge commit; regenerated docs/user/compiler.md and the supported-latex inventories. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
Kept main's \fnsymbol dispatch arm alongside this stack's penalty-based \linebreak/\nolinebreak arms in parser.rs; regenerated docs/user/compiler.md and the supported-latex inventories. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
Kept main's \fnsymbol dispatch arm alongside this branch's penalty-based \linebreak/\nolinebreak arms; regenerated the supported-latex artefacts. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
…wups Records the parent PR #568 branch's own origin/main merge; no tree changes. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
…ded) Clean merge, no conflicts. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
Parents #568/#583 are squashed on main; kept this branch's own mode-based horizontal-\pagebreak logic, comment and test over the squash state, and took main's #587 parser state fields (length_scopes, pending_global, latin_modern, preamble_latin_modern). Regenerated supported-latex artefacts. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
GoKubar
added a commit
that referenced
this pull request
Sep 15, 2026
/#635 grew the inventory docs/user/compiler.md (generated) conflicted again; took main's copy and regenerated via render_supported_latex.sh so \underbar and main's additions both appear, sync --check clean. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
ItsAkilesh
pushed a commit
to ItsAkilesh/flashtex
that referenced
this pull request
Sep 18, 2026
What changed: - `crates/render-pipeline/Cargo.toml` declares a new off-by-default feature `compiler-node-surface`. It carries no behaviour of its own: every arm it adds is the inert answer the pipeline already gave for a compiler node the current pin (`c95977d6`) cannot produce. - The pipeline's exhaustive matches and node constructors now cover main's compiler surface behind that feature: `parser::Block::Penalty`/`Tabbing`, `parser::Inline::ThePage`/`PageNumbering`/`TabStop`/`TabJump`/`Marginpar`/ `Penalty`/`PagePenalty`/`Discretionary`, `VSpace`/`HSpace` glue components, `math::Nucleus::TextRun`/`SideSet`/`Lap` and `math::Accent::Mathring` (compiler flash-tex#549, flash-tex#551, flash-tex#555, flash-tex#568, flash-tex#581, flash-tex#583, flash-tex#587, flash-tex#606, flash-tex#616). `adapter::vspace_block` is a new cfg'd constructor beside the existing `line_break_inline`; the one open-coded `Inline::LineBreak { .. }` left in the `\opening` lowering now goes through `line_break_inline` too. - `tabbing` is lowered to flush-left paragraphs with one `unsupported_block` limitation, the way `LetterBlock` is, so no row is dropped by the re-pin. - `docs/integration/repin-runbook.md`: the exact re-pin commands, the three vendor directories that must move (`compiler`, `tex-expansion`, and a new `bibliography`), the lockfile and `#[ignore]` edits `--locked` CI needs, the measured test deltas and the PRs the pin unblocks. No file under `vendor/` is touched: the vendor swap used to measure all of this was scratch-only and reverted. `git diff --stat origin/main...HEAD` contains zero `vendor/` paths. What was run: Whole `crates/render-pipeline` suite, CARGO_BUILD_JOBS=4, --no-fail-fast: origin/main, pinned vendor, feature off: 469 passed, 13 failed this branch, pinned vendor, feature off: 469 passed, 13 failed (same 13) this branch, vendor re-pinned, feature on: 485 passed, 0 failed The 13 red-on-main tests (letter_class_geometry x5, frame_env, underline_sout x4, uline x2, xcolor_oracle) all pass after the re-pin. Two re-pin-gated #[ignore]s also pass against the re-pinned vendor: test frame_draws_a_rule_border_around_its_content ... ok test coloneqq_decomposes_like_mathtools ... ok crates/flashtex-cli against the same re-pinned vendor: test result: ok. 58 passed; 0 failed cargo check --all-targets on this branch at the current pin: 0 errors. Next step: The integration lane applies docs/integration/repin-runbook.md section 3 -- swap the three vendor trees, move `compiler-node-surface` (and `linebreak-skip`) into `default`, refresh both Cargo.locks, drop the two `#[ignore]`s, update vendor/VENDORING.md. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent 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.
What
A
\pagebreakor\nopagebreakright after\noindent,\indentor a text font command (\textbf{,\emph{, ...) is now horizontal. The compiler emitsInline::PagePenalty(latex.ltx\@no@pgbk's\vadjust), not aBlock::Penaltybefore the paragraph. A\pagebreakafter only\label{..}stays vertical. Task GH-PAGEBREAK-MIDPARAGRAPH. Stacked on #583, which is stacked on #568.parser.rs: a newP::paragraph_startedflag.\noindent,\indentand thestyle_commandarm set it (\hmode@bgroupis\leavevmode\bgroup). It is cleared infinish_block_dependencies, which runs after every block push, and inflush_list_item.pagebreak | nopagebreakarm is horizontal when that flag is set or when the paragraph holds any inline other thanInline::Label.Why
The original report in #599/#608 was that
First. \pagebreak Second.splits the paragraph. That comes from main's pinnedvendor/compiler, not from this stack. With #583's compiler swapped into #599, a mid-paragraph\pagebreakalready matches pdflatex everywhere I probed: inline, on its own line,{},[1]to[4],\nopagebreak, and 72 positions near the page foot. The stacked pipeline PR pins that.Probing did turn up one real divergence, at the start of a paragraph. The arm decided the mode from
para.is_empty():\noindent\pagebreak <2-line par>Before.\indent\pagebreak <par>Before.\textbf{\pagebreak Bold} <par>\noindent\mbox{}\pagebreak <par>Before.\label{a}\pagebreak <par>\section{\textbf{Head}}\pagebreak,\textbf{Bold para.}+ blank +\pagebreak,\begin{center}\noindent ..\end{center}\pagebreak,\itemizewith\textbfthen\pagebreak,\noindent+ blank line +\pagebreak(flag leak checks)Lines were read with PyMuPDF from the pdflatex PDF and from our v2 display list (
flashtex-render --v2), comparing page and text per line. Baselines agree within 0.01bp.Overlap check
gh pr list --search pagebreak: compiler: page and paragraph control commands as penalty, discretionary and parameter nodes (#64) #568, render-pipeline: page and paragraph control from the compiler's penalty, discretionary and parameter nodes — needs #568 re-pin (#64) #569, compiler: vertical \pagebreak is a bare penalty, amsmath \nobreakdash (#64; stacked on #568) #583, render-pipeline: \enlargethispage, \clearpage float flush, \flushbottom after \pagebreak, \nobreakdash (#64; stacked on #569, needs #568+#583 re-pin) #584, render-pipeline: a float after a page break, \pagebreak\section under \flushbottom, \enlargethispage with floats and * squeeze (#64; stacked on #584) #599 and render-pipeline: a float on its own lines inside a paragraph does not end the paragraph (GH-FLOAT-IN-PARAGRAPH) #608 are all this lane's stack. This PR stacks on compiler: vertical \pagebreak is a bare penalty, amsmath \nobreakdash (#64; stacked on #568) #583.gh pr list --search noindent: draft compiler: diagnose the LaTeX pdflatex refuses instead of compiling it silently #365 (GoKubar, compiler: diagnose the LaTeX pdflatex refuses) adds an equivalentparagraph_forcedflag on the same\noindent/\indentarms. The two will conflict textually there. Whichever lands second should reuse the other's flag, not keep two.coord.py claims: only GH-PAGEBREAK-MIDPARAGRAPH (daniel-parent) touches page breaks.Test results
cargo test(crates/compiler, CARGO_BUILD_JOBS=4): 57test result: oklines, 680 passed, 0 failed.cargo test --lib -- pagebreak:test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 344 filtered out.crates/compiler/srcasvendor/compiler:test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out. With compiler: vertical \pagebreak is a bare penalty, amsmath \nobreakdash (#64; stacked on #568) #583's parser.rs it givesFAILED. 22 passed; 1 failed(pagebreak_right_after_a_paragraph_starts_is_horizontal).Not done
\leavevmode\pagebreakstill breaks before the paragraph.\leavevmodeis an unsupported command in this compiler (it is diagnosed), so it does not start the paragraph.\pagebreakinside\parbox/minipagestill breaks the page. pdflatex keeps a\vadjustinside the box. Both constructs are unsupported and diagnosed (their bodies are flattened into the paragraph). Separately, aminipageafter\noindentprints its5cmwidth argument as text.[h]figure followed by a vertical\pagebreakstays on one page, while pdflatex ends the page after the float. This is pre-existing on main too, and it is float placement rather than this path.vendor/compilerre-pin is an integrator action.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz