Repository navigation
geometry: one margin beside a body does not cancel the body - #936
Merged
Merged
Conversation
…missing margin is derived
\newgeometry{textheight=9in,textwidth=5.5in,top=1in,...} (neurips_2024.sty,
arxiv.sty, run at \begin{document} after \usepackage[letterpaper]{geometry}) lost
its text height: the `top` key cleared the textheight, and the bottom margin
subtracted instead was the 0.7-body default the first call had left in the state
(#923). The text block came out 8in instead of 9in: 2405.16883 29 -> 34 pages
(reference 26) and 2405.18549 40 -> 45 (reference 37), found by bisecting
v0.288.0..v0.296.0 to 320be1e.
geometry decides each direction from which of margin, body, margin the user
fixed (\Gm@detall, geometry.dtx:2237-2271). One margin beside the body fixes the
body and derives the other margin; only margin + body + margin is
over-specified, and then the body is dropped. top/bottom/left/right now clear
the body only when the opposite margin is already named, and a fixed body
derives the unnamed margin(s) (1:1, 2:3 two-sided, 2:3 top:bottom when neither
is named) instead of keeping an earlier layout's.
Witnesses, tectonic 0.17.0: TW=397.48499pt TH=650.43pt OS=36.13501pt TM=-37.0pt
(v0.296.0 said TH=579.60394pt OS=19.8752pt) and, with bottom=2in,left=1in,
TW=397.48499pt TH=578.16pt OS=0.0pt. TestGeometryOneMarginKeepsTheBody asserts
both.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mutsweep (-sites all) on the four margin guards of the previous commit found three survivors (hasRight, hasLeft, hasBottom): the test only exercised one order of the keys. Add tectonic's values for right-then-left with bottom-then-top and the reverse; all four mutants are now caught. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
tannevaled
added a commit
that referenced
this pull request
Nov 26, 2026
Documents font sizes in any TeX unit, a class's restated \normalsize as the body size, \PassOptionsToClass option expansion, authblk, the elsarticle star marks, LMSans bold and oblique, the page folio, geometry options and heightrounded, eso-pic on even pages, align \tag placement and relation spacing, \text spaces (go-tex/math v0.51.0), and the corpus A/B measured on v0.299.0. Source: engine #936-#950, go-tex/math#69. Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Defect
\newgeometry{textheight=9in,textwidth=5.5in,top=1in,...}(neurips_2024.sty and arxiv.sty run exactly this at\begin{document}, after\usepackage[verbose=true,letterpaper]{geometry}) lost its text height. Thetopkey cleared the text height, and the bottom margin then subtracted was the 0.7-body default that the first call had left in the state (#923). The text block came out 8in instead of 9in.Found by bisecting the corpus regressions between v0.288.0 and v0.296.0 over
git log --first-parent(one paper per step,gotex-abdiff): both 2405.16883 (29 to 34 pages, reference 26) and 2405.18549 (40 to 45, reference 37) are fine at 0900c51 and regress at 320be1e (#923). #923 is right per geometry.dtx; it exposed a second defect, which this PR fixes.Refs #923 (merged, correct; not reverted).
Fix
geometry decides each direction from which of margin, body, margin was fixed (
\Gm@detall, geometry.dtx:2237-2271). One margin beside the body fixes the body and derives the other margin; only margin + body + margin is over-specified, and then the body is dropped.top/bottom/left/rightnow clear the body only when the opposite margin is already named, and a fixed body derives the unnamed margin(s) (1:1, 2:3 two-sided, 2:3 top:bottom when neither is named) rather than keeping an earlier layout's.Witness (tectonic 0.17.0,
--print)With
bottom=2in,left=1inadded (height dropped, width kept): tectonic and this PR both TH=578.16pt OS=0.0pt.TestGeometryOneMarginKeepsTheBodyasserts both.Corpus
2405.16883 34 to 29, 2405.18549 45 to 40 (reference 26 and 37). Full-corpus numbers in a comment below.
🤖 Generated with Claude Code