diff --git a/docs/STATUS.md b/docs/STATUS.md index 5680f80..0359e0a 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -80,7 +80,7 @@ the source changes; the SVG preview is refreshed per page. bottom (TeX `\maxdepth`) so the last baseline and its descender stay inside the page frame. - Preprint title blocks reserve the title/author `\thanks` footnote height on - page one, use the arxiv class's 11 pt leading and reference title + page one plus one spare baseline; the body layout goal is reduced while the footnote area still paints from the unreduced page goal, so body text cannot cross the separator. Uses the arxiv class's 11 pt leading and reference title gaps; table cells get a 1 mm render-area tolerance so bottom floats at the page goal do not trip the frame check. - Live preview: paragraph cache, page-hash diffing, warm rebuilds in the low diff --git a/src/rust_typeset/pdf/layout.rs b/src/rust_typeset/pdf/layout.rs index 800abde..e236d0c 100644 --- a/src/rust_typeset/pdf/layout.rs +++ b/src/rust_typeset/pdf/layout.rs @@ -1705,6 +1705,7 @@ pub(super) fn build_positioned_pages( // inside the page frame; TeX's \maxdepth plays the same role. let mut page_goal = scaled_points(content_height_mm * PDF_POINTS_PER_INCH / 25.4).0 as i64 - millimeters_to_scaled(3.0); + let footnote_goal = page_goal; let mut pages = vec![PositionedPage::default()]; set_body_line_factor(if model.title_style == TitleStyle::Preprint { 1.1 @@ -1726,7 +1727,11 @@ pub(super) fn build_positioned_pages( math_layout, cache, ); - page_goal = page_goal.saturating_sub(title_reserve); + // The measured note may wrap to one more line than the conservative + // estimate; reserve a full baseline of slack above the insertion area. + if title_reserve > 0 { + page_goal = page_goal.saturating_sub(title_reserve.saturating_add(normal_line_height)); + } let mut deferred: Vec = Vec::new(); let mut block_end_pages: HashMap = HashMap::new(); let mut block_start_pages: HashMap = HashMap::new(); @@ -3091,7 +3096,7 @@ pub(super) fn build_positioned_pages( model, &mut pages, &block_end_pages, - page_goal, + footnote_goal, content_width_mm, metrics, font_cache,