Repository navigation
\insertPicture: keep a full-width picture from opening an empty line … - #42
Merged
sesquideus merged 1 commit intoOct 19, 2026
Merged
Conversation
…above it
What changed
------------
`core/latex/utilities.tex`, the ordinary `\insertPicture` only: the
`\includegraphics` (and its `example-image` fallback) is now wrapped in
`\makebox[\linewidth]{...}` inside the existing `center` environment, and a
comment above the macro explains why. Nothing else is touched -- in
particular not the answer-block variant that `\tightPictures` defines, and
not pictures sized by `height=`.
Why
---
graphicx's scaling is not exact. A picture bound by `width=\linewidth` can
come out a hundredth of a point *wider* than the line. That is under
`\hfuzz`, so TeX prints no Overfull warning, but it is enough that the box
no longer fits on the same line as the empty `\item` label that `center`
(a trivlist) starts with. TeX therefore breaks after the label: an empty
centred line -- a whole `\baselineskip` -- opens above the drawing, and the
picture is set on the line below it.
In volume 29 that cost `amusement-speed` about 5 mm, enough to push it off
its page in the Portuguese tear-off, and `chopper` had the same gap above
its figure. Nothing in the source showed it, because the source asks for
exactly `\linewidth`.
`\makebox[\linewidth]` is exactly `\linewidth` wide whatever it holds, so the
picture always fits beside the label and the empty line cannot appear. The
box is centred content of the same width as before, so the picture's
horizontal position is unchanged; a picture narrower than the line is centred
inside the box just as `center` centred it.
Originally 699938b on fix/insert-picture-empty-line; re-applied unchanged
onto current upstream master (e408edb), where it applies cleanly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sesquideus
approved these changes
Oct 19, 2026
sesquideus
left a comment
Collaborator
There was a problem hiding this comment.
Whatever floats the boat.
sesquideus
approved these changes
Oct 19, 2026
sesquideus
left a comment
Collaborator
There was a problem hiding this comment.
Whatever floats the boat.
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.
…above it
What changed
core/latex/utilities.tex, the ordinary\insertPictureonly: the\includegraphics(and itsexample-imagefallback) is now wrapped in\makebox[\linewidth]{...}inside the existingcenterenvironment, and a comment above the macro explains why. Nothing else is touched -- in particular not the answer-block variant that\tightPicturesdefines, and not pictures sized byheight=.Why
graphicx's scaling is not exact. A picture bound by
width=\linewidthcan come out a hundredth of a point wider than the line. That is under\hfuzz, so TeX prints no Overfull warning, but it is enough that the box no longer fits on the same line as the empty\itemlabel thatcenter(a trivlist) starts with. TeX therefore breaks after the label: an empty centred line -- a whole\baselineskip-- opens above the drawing, and the picture is set on the line below it.In volume 29 that cost
amusement-speedabout 5 mm, enough to push it off its page in the Portuguese tear-off, andchopperhad the same gap above its figure. Nothing in the source showed it, because the source asks for exactly\linewidth.\makebox[\linewidth]is exactly\linewidthwide whatever it holds, so the picture always fits beside the label and the empty line cannot appear. The box is centred content of the same width as before, so the picture's horizontal position is unchanged; a picture narrower than the line is centred inside the box just ascentercentred it.Originally 699938b on fix/insert-picture-empty-line; re-applied unchanged onto current upstream master (e408edb), where it applies cleanly.