Skip to content

Keep exam section headings with their first question - #37

Merged
agiacalone merged 1 commit into
mainfrom
fix/exam-section-heading-keep-with-next
Sep 28, 2026
Merged

agiacalone merged 1 commit into
mainfrom
fix/exam-section-heading-keep-with-next

Conversation

@agiacalone

Copy link
Copy Markdown
Owner

Summary

\examsection in references/reference_exam.tex now reserves the heading's height plus \qreserve before it prints. The question-level \needspace from issue #29 kept each question whole, but not the heading above it. A heading that fit at the foot of a page was left there alone while its first question moved to the next page.

Found on CECS 326 Fa26 Exam 1, where Code Interpretation sat alone at the foot of page 4. Template-only: existing exam .tex files are not backfilled.

Test plan

  • CECS 326 Fa26 Exam 1 Form A, regenerated with only this template change, puts Code Interpretation at the top of page 5 with its questions
  • reference_exam.tex still builds as a 4-page booklet with no errors
  • pytest: 608 passed, 1 skipped

🤖 Generated with Claude Code

https://claude.ai/code/session_019vCMgevpwqjvXysvDivXBs

\examsection now reserves the heading's height plus \qreserve before it
prints. The question-level \needspace kept each question whole but not
the heading above it, so a heading that fit at the foot of a page was
left there alone while its first question moved to the next page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vCMgevpwqjvXysvDivXBs
@agiacalone
agiacalone merged commit 308f9af into main Sep 28, 2026
4 checks passed
@agiacalone
agiacalone deleted the fix/exam-section-heading-keep-with-next branch September 28, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant