Skip to content

TRIOS_PHD_NO_IMAGE_TRAIN: anchor hero panels via Needspace, ban hard clearpage #957

@gHashTag

Description

@gHashTag

Problem

The TRIOS PhD monograph renderer can lay out hero panels as a gallery / image train when section breaks and figure placements interact badly. Two failure modes seen in recent builds:

  1. A section heading sits orphaned at the bottom of a page with its hero image floating to the next page.
  2. Hero figures from neighbouring sections collapse onto a single page, producing a multi-image "image train" without semantic context.

A previous attempt to fix this by inserting a hard \clearpage before every section produced short title-only pages and was rejected by manual QA.

Rule (non-negotiable)

TRIOS_PHD_NO_IMAGE_TRAIN: each hero panel must travel with the nearest substantive heading and its body text. Use a SOFT keep-together reservation; never a hard \clearpage.

Required implementation

  • Add \usepackage{needspace} to docs/phd/main.tex and templates/chapter.template.tex.
  • Wrap \section and \chapter to prepend \Needspace*{0.58\textheight} (soft keep-together; the starred form skips the break when already at top of page).
  • Wrap \chapterhero so heading + hero figure cannot be split.
  • Keep hero images large and centered — this is a placement rule, not a sizing rule.
  • Document the rule in docs/pdf-rendering.md (canonical) and link it from AGENTS.md and docs/phd/README.md.

QA baseline to preserve

150 A4 pages; qpdf --check clean; 0 duplicate long paragraphs; 0 duplicate numbered headings; 0 Cyrillic hits in the body; 0 secret / stale / math anomaly hits; 0 very-short non-empty pages; at most 1 image-heavy / low-context page (the title page).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions