From 802526c352b4b9a6ecbaaf8f63fe0a7eeabc9ea6 Mon Sep 17 00:00:00 2001 From: GloamXun Date: Wed, 28 Oct 2026 00:39:05 +0800 Subject: [PATCH] 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. --- crates/texrra-tex-core/src/math.rs | 4 ++-- docs/TEX_FIDELITY_ROADMAP.md | 3 ++- docs/WEB_ROUTE_D_EXPERIMENT.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/texrra-tex-core/src/math.rs b/crates/texrra-tex-core/src/math.rs index 087f7fa..d5d9b5f 100755 --- a/crates/texrra-tex-core/src/math.rs +++ b/crates/texrra-tex-core/src/math.rs @@ -1335,8 +1335,8 @@ pub fn layout_math(atom: &MathAtom, font: &Cmr10Metrics) -> MathBox { .saturating_add(2 * 65_536); MathBox { width, - height: scaled(numerator_box.height + numerator_box.depth, 0.7) + 2 * 65_536, - depth: scaled(denominator_box.height + denominator_box.depth, 0.7) + 2 * 65_536, + height: numerator_box.height + numerator_box.depth + 2 * 65_536, + depth: denominator_box.height + denominator_box.depth + 2 * 65_536, } } } diff --git a/docs/TEX_FIDELITY_ROADMAP.md b/docs/TEX_FIDELITY_ROADMAP.md index ba47dfd..aacbab7 100644 --- a/docs/TEX_FIDELITY_ROADMAP.md +++ b/docs/TEX_FIDELITY_ROADMAP.md @@ -48,7 +48,8 @@ execution is not a goal. - project `.bib` entries now produce author-year labels and natbib-style parenthetical citations; inline `thebibliography` without labels remains 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 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 diff --git a/docs/WEB_ROUTE_D_EXPERIMENT.md b/docs/WEB_ROUTE_D_EXPERIMENT.md index 12b7cec..a91bb71 100644 --- a/docs/WEB_ROUTE_D_EXPERIMENT.md +++ b/docs/WEB_ROUTE_D_EXPERIMENT.md @@ -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 | | 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 | -| 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 | | Float order | figure/table on page 3 with section 3.4 | figure/table on page 3 above 3.3/3.4 |