diff --git a/crates/texrra-tex-core/src/math.rs b/crates/texrra-tex-core/src/math.rs index d5d9b5f..395cc46 100755 --- a/crates/texrra-tex-core/src/math.rs +++ b/crates/texrra-tex-core/src/math.rs @@ -1336,7 +1336,7 @@ pub fn layout_math(atom: &MathAtom, font: &Cmr10Metrics) -> MathBox { MathBox { width, height: numerator_box.height + numerator_box.depth + 2 * 65_536, - depth: denominator_box.height + denominator_box.depth + 2 * 65_536, + depth: denominator_box.height + denominator_box.depth, } } } diff --git a/crates/texrra-tex-core/src/render.rs b/crates/texrra-tex-core/src/render.rs index 97b05d6..0d2a15a 100755 --- a/crates/texrra-tex-core/src/render.rs +++ b/crates/texrra-tex-core/src/render.rs @@ -1242,11 +1242,12 @@ impl Page { Self::paint_math(base, font, x, baseline, size, list); let italic = math::italic_correction(base, font); let small = (size as f64 * 0.7) as i64; + let script_x = x + base_box.width + italic + 65_536 / 2; if let Some(sup) = sup { Self::paint_math( sup, font, - x + base_box.width + italic, + script_x, baseline - base_box.height * 2 / 3, small, list, @@ -1256,8 +1257,8 @@ impl Page { Self::paint_math( sub, font, - x + base_box.width + italic, - baseline + base_box.depth * 2 / 3, + script_x, + baseline + base_box.depth + 2 * 65_536, small, list, ); diff --git a/docs/TEX_FIDELITY_ROADMAP.md b/docs/TEX_FIDELITY_ROADMAP.md index aacbab7..eecb000 100644 --- a/docs/TEX_FIDELITY_ROADMAP.md +++ b/docs/TEX_FIDELITY_ROADMAP.md @@ -48,8 +48,9 @@ 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; fraction boxes now reserve the full - numerator/denominator extent, and tags sit at the right margin; + - display math is approximate; fraction boxes reserve the full + numerator/denominator extent, subscripts drop below the base, 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 a91bb71..64141a1 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; fraction box now reserves full numerator/denominator extent; tag at the right margin | +| Display equation | fully typeset fraction/product/sum | approximate body; fraction box uses full extents, subscripts drop below the base, and the tag sits 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 |