Skip to content

A figure states its own size, and floats are placed by default - #201

Merged
tannevaled merged 2 commits into
mainfrom
figure-geometry
Sep 3, 2026
Merged

tannevaled merged 2 commits into
mainfrom
figure-geometry

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A figure this engine cannot draw still says how big it is: an EPS in its
%%BoundingBox, a PDF in its /MediaBox. Reading that costs no rendering at all
and is what makes the reserved box the right SHAPE — with only [width=…] given,
the height then follows the figure's own aspect.

Without it, a width-only placeholder came out square. Measured on 2408.08037:
every figure reserved 476.55 × 476.55 pt — nearly a whole page — twenty-one times
over, and the paper ran to 29 pages against a reference of 12.

With figures the right shape, the float placer is finally worth having on. It is
what puts a figure at the top of its page and, when it will not fit with
\textfraction of text under it, on a later page or a float page of its own —
where the inline path lets a tall figure push the text down and leave the bottom
of the page empty. GOTEX_FLOATS=0 restores the inline path.

Measured, 157 arXiv papers against tectonic

Σ page error median exact ≤1 page ≤2 pages
inline (today, after #200) 616 2 21 58 83
this 586 2 21 59 93

beamer is untouched: 40 pages of error over 79 decks either way.

Neither half is worth landing alone, which is what issue #146 asked to be
shown before either shipped: the declared box without the placer measures 637 —
the extra height has nowhere to go — and the placer without the declared box 650,
because it is then placing square figures. Landing them together is the "one
block" that issue asked for.

tannevaled and others added 2 commits September 3, 2026 19:53
A figure this engine cannot draw still says how big it is: an EPS in its
%%BoundingBox, a PDF in its /MediaBox. Reading that costs no rendering and is
what makes the reserved box the right SHAPE — with only [width=…] given, the
height follows the figure's own aspect. Without it a width-only placeholder came
out SQUARE: measured on 2408.08037, every figure reserved 476.55 × 476.55 pt,
nearly a whole page, twenty-one times over.

With figures the right shape, the float placer is finally worth having on: it is
what puts a figure at the top of its page and, when it does not fit with
\textfraction of text under it, on a later page or a float page — where the
inline path lets a tall figure push the text down and leave the bottom of the
page empty. GOTEX_FLOATS=0 restores the inline path.

Measured over the 157 arXiv papers with a tectonic reference:

                     Σ error   median   exact   ≤1 page   ≤2 pages
    inline (today)       616        2      21        58         83
    this                 586        2      21        59         93

beamer is untouched (40 over 79 decks). The two halves are measured apart as
well, and neither is worth landing alone: the declared box without the placer is
637 (the extra height has nowhere to go), the placer without it 650 (square
figures). This is the "one block" issue #146 asked for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An absolute temporary path carries the runner's own characters into TeX's
tokeniser; the three CI lanes read the name back as something else and found no
file, so the placeholder came out square. The document now names a bare file in
the working directory, which is how a paper includes a figure.
@tannevaled
tannevaled merged commit 72f2d9f into main Sep 3, 2026
18 checks passed
@tannevaled
tannevaled deleted the figure-geometry branch September 3, 2026 18:25
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.

1 participant