Reserve full fraction extents in math layout

Fraction layout scaled numerator and denominator extents by 0.7 while painting
both at the full size, underestimating the box height and depth. Use the full
extents plus the bar clearance so the display equation no longer compresses its
fraction vertically.

Test count stays 1077.
This commit is contained in:
gloamxun committed 2026-10-28 00:39:05 +08:00
1 parent 764bc18850
commit 802526c352
3 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -1335,8 +1335,8 @@ pub fn layout_math(atom: &MathAtom, font: &Cmr10Metrics) -> MathBox {
.saturating_add(2 * 65_536); .saturating_add(2 * 65_536);
MathBox { MathBox {
width, width,
height: scaled(numerator_box.height + numerator_box.depth, 0.7) + 2 * 65_536, height: numerator_box.height + numerator_box.depth + 2 * 65_536,
depth: scaled(denominator_box.height + denominator_box.depth, 0.7) + 2 * 65_536, depth: denominator_box.height + denominator_box.depth + 2 * 65_536,
} }
} }
} }
+2 -1
View File
@@ -48,7 +48,8 @@ execution is not a goal.
- project `.bib` entries now produce author-year labels and natbib-style - project `.bib` entries now produce author-year labels and natbib-style
parenthetical citations; inline `thebibliography` without labels remains parenthetical citations; inline `thebibliography` without labels remains
numeric, and the full natbib option surface is not implemented; numeric, and the full natbib option surface is not implemented;
- display math is approximate; equation tags now sit at the right margin; - display math is approximate; fraction boxes now reserve the full
numerator/denominator extent, and tags sit at the right margin;
- PNG/JPEG/BMP floats now reserve their image height, embed the raster with - PNG/JPEG/BMP floats now reserve their image height, embed the raster with
its real pixel dimensions, centre the image within the float, and emit it its real pixel dimensions, centre the image within the float, and emit it
into the SVG preview as a PNG data URI. Table floats are centred with their into the SVG preview as a PNG data URI. Table floats are centred with their
+1 -1
View File
@@ -148,7 +148,7 @@ PDF was rendered page-by-page next to the route-D output.
| Citations | natbib author-year `(Kour and Saabne, 2014a; …)` | author-year `(Kour and Saabne, 2014a; Keshet et al., 2016)` for `.bib`; numeric for unlabeled inline bibliographies | | Citations | natbib author-year `(Kour and Saabne, 2014a; …)` | author-year `(Kour and Saabne, 2014a; Keshet et al., 2016)` for `.bib`; numeric for unlabeled inline bibliographies |
| Table | booktabs rules, `Size (µm)`, `~100`, `10^6` | centred with rules; `Size (µm)`, `~100`, `10⁶` | | Table | booktabs rules, `Size (µm)`, `~100`, `10^6` | centred with rules; `Size (µm)`, `~100`, `10⁶` |
| Figure | framed rule box above the caption | centred framed rule body (raster) on page 3 | | Figure | framed rule box above the caption | centred framed rule body (raster) on page 3 |
| Display equation | fully typeset fraction/product/sum | approximate body; equation number now at the right margin | | Display equation | fully typeset fraction/product/sum | approximate body; fraction box now reserves full numerator/denominator extent; tag at the right margin |
| References | author-year, italic venue, DOI link | author-year entries; plain venue text, no DOI | | References | author-year, italic venue, DOI link | author-year entries; plain venue text, no DOI |
| Float order | figure/table on page 3 with section 3.4 | figure/table on page 3 above 3.3/3.4 | | Float order | figure/table on page 3 with section 3.4 | figure/table on page 3 above 3.3/3.4 |