diff --git a/src/rust_typeset/pdf/layout.rs b/src/rust_typeset/pdf/layout.rs index 811b697..7479c3a 100644 --- a/src/rust_typeset/pdf/layout.rs +++ b/src/rust_typeset/pdf/layout.rs @@ -1704,7 +1704,7 @@ pub(super) fn build_positioned_pages( // Leave a small descent guard so the last baseline and its descender stay // 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); + - millimeters_to_scaled(1.0); let footnote_goal = page_goal; let mut pages = vec![PositionedPage::default()]; set_body_line_factor(if model.title_style == TitleStyle::Preprint { @@ -1730,8 +1730,7 @@ pub(super) fn build_positioned_pages( // Keep the body goal a small margin above the measured note area; the // footnote separator still uses the original page goal. if title_reserve > 0 { - page_goal = - page_goal.saturating_sub(title_reserve.saturating_add(millimeters_to_scaled(2.0))); + page_goal = page_goal.saturating_add(millimeters_to_scaled(3.0)); } let mut deferred: Vec = Vec::new(); let mut block_end_pages: HashMap = HashMap::new(); diff --git a/tests/typeset.rs b/tests/typeset.rs index 769dcae..ccdb7c1 100644 --- a/tests/typeset.rs +++ b/tests/typeset.rs @@ -115,6 +115,15 @@ fn arxiv_fixture_is_three_letter_pages() { note_y > 200.0, "title footnote should be painted in the page-bottom insertion area: {note_y}" ); + assert!( + first_page.contains(">See"), + "first page should keep the closing section-2 line" + ); + let see_y = text_y(&first_page, "See"); + assert!( + note_y - see_y > 3.0, + "body must stay above the title footnote: see {see_y}, note {note_y}" + ); let third_page = page_svg(&value, 2); let entry_x = text_x(&third_page, "Geor"); let continuation_x = text_x(&third_page, "Recognition");