You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue's original measurements were wrong and have been replaced.
The corrected figures and instrument are below; the history is in the
comments.
CLAUDE.md asks every derivation step to carry a trailing justification.
When that justification sits in a third && column of an aligned block, it
adds its own width to the block, and wide derivations then overflow the text
block in the PDF profiles --- so the justification is clipped off the right
edge of the page, which is exactly the content the rule exists to supply.
HTML is unaffected, so the pre-commit checklist cannot see it.
Measurement
Against the book's own class and geometry (scrbook, twoside=off, top=15mm bottom=20mm), with the text width read from the run via \showthe\textwidth rather than assumed:
So main's existing exposure is one box at 47pt --- small, but the count
grows with every chapter that gains step annotations.
Two instrument traps, both of which produced wrong numbers here
latex-macros is a submodule, so git show <ref>:latex-macros/macros.qmd
returns empty. A harness that reads the macros that way compiles the
comparison arm with no macros at all. That is what produced this issue's
original "8 overfull, worst 153.4pt" for main, and the "~345pt text
width" was assumed rather than measured. Read the macros from disk; the
submodule pin is unchanged by Improve narrative flow and math derivations in count regression chapter #1138.
quarto pandoc does not process {{< include >}}, and injecting macros.qmd into a hand-assembled .tex after \begin{document} skips
Pandoc's latex_macros expansion entirely. Either mistake makes macros
such as \sb reach LaTeX unexpanded, which changes every width and
invents errors. Concatenate macros.qmd's content into the document, or
use quarto render --to latex. See #1152.
What does not work, and why
Shortening the annotation text. An aligned block's width is the sum of its column maxima, so a third column holding the justification adds its width
to every row no matter how the rows are arranged; trimming words moves the
maximum slightly and nothing else. This was tried first in #1138 and took the
worst case only from 390.6pt to 139.7pt.
What works
Move the annotation onto its own row in column 2, so the width becomes the maximum of equation and annotation rather than their sum:
&= \pi \cdot 1 + (1-\pi) e^{-\mu_0} \\
&\quad \text{(substituting the two conditional PMFs)} \\
Applied to all 40 annotated steps in the count-regression chapter, this gives
zero overfull boxes.
The open decision
Whether the rest of the book should adopt the column-2 style. It changes the
look of every annotated derivation, so it is a decision rather than a
cleanup, and #1138 deliberately confines it to its own chapter. A CI check
counting overfull boxes per chapter would keep the problem from growing
silently either way; it pairs naturally with #1152.
Important
This issue's original measurements were wrong and have been replaced.
The corrected figures and instrument are below; the history is in the
comments.
CLAUDE.mdasks every derivation step to carry a trailing justification.When that justification sits in a third
&&column of analignedblock, itadds its own width to the block, and wide derivations then overflow the text
block in the PDF profiles --- so the justification is clipped off the right
edge of the page, which is exactly the content the rule exists to supply.
HTML is unaffected, so the pre-commit checklist cannot see it.
Measurement
Against the book's own class and geometry (
scrbook,twoside=off,top=15mm bottom=20mm), with the text width read from the run via\showthe\textwidthrather than assumed:origin/main(873b4a09)So
main's existing exposure is one box at 47pt --- small, but the countgrows with every chapter that gains step annotations.
Two instrument traps, both of which produced wrong numbers here
latex-macrosis a submodule, sogit show <ref>:latex-macros/macros.qmdreturns empty. A harness that reads the macros that way compiles the
comparison arm with no macros at all. That is what produced this issue's
original "8 overfull, worst 153.4pt" for
main, and the "~345pt textwidth" was assumed rather than measured. Read the macros from disk; the
submodule pin is unchanged by Improve narrative flow and math derivations in count regression chapter #1138.
quarto pandocdoes not process{{< include >}}, and injectingmacros.qmdinto a hand-assembled.texafter\begin{document}skipsPandoc's
latex_macrosexpansion entirely. Either mistake makes macrossuch as
\sbreach LaTeX unexpanded, which changes every width andinvents errors. Concatenate
macros.qmd's content into the document, oruse
quarto render --to latex. See#1152.
What does not work, and why
Shortening the annotation text. An
alignedblock's width is the sum of itscolumn maxima, so a third column holding the justification adds its width
to every row no matter how the rows are arranged; trimming words moves the
maximum slightly and nothing else. This was tried first in #1138 and took the
worst case only from 390.6pt to 139.7pt.
What works
Move the annotation onto its own row in column 2, so the width becomes the
maximum of equation and annotation rather than their sum:
Applied to all 40 annotated steps in the count-regression chapter, this gives
zero overfull boxes.
The open decision
Whether the rest of the book should adopt the column-2 style. It changes the
look of every annotated derivation, so it is a decision rather than a
cleanup, and #1138 deliberately confines it to its own chapter. A CI check
counting overfull boxes per chapter would keep the problem from growing
silently either way; it pairs naturally with #1152.
Filed by Claude Code (AI agent).