Skip to content

\insertPicture: keep a full-width picture from opening an empty line … - #42

Merged
sesquideus merged 1 commit into
trojsten:masterfrom
084intheImpala:fix/insert-picture-overwide
Oct 19, 2026
Merged

sesquideus merged 1 commit into
trojsten:masterfrom
084intheImpala:fix/insert-picture-overwide

Conversation

@084intheImpala

Copy link
Copy Markdown
Contributor

…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.

…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 sesquideus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever floats the boat.

@sesquideus sesquideus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever floats the boat.

@sesquideus
sesquideus merged commit c13672e into trojsten:master Oct 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants