Skip to content

Keep end-of-block diamond glued to its content across page breaks#103

Merged
PatrikBak merged 1 commit into
mainfrom
patrik/template-block-pagebreak-fix
May 16, 2026
Merged

Keep end-of-block diamond glued to its content across page breaks#103
PatrikBak merged 1 commit into
mainfrom
patrik/template-block-pagebreak-fix

Conversation

@PatrikBak
Copy link
Copy Markdown
Owner

Summary

  • \Exercise / \Theorem / \Example / \Problem all close with an \endblock diamond. Previously \leftbar always emitted two breakable medskips of trailing glue, so when the closing diamond followed inline content (review-mode solution, \Theorem proof, review-mode example, review-mode problem) it could land on a fresh page detached from the block above.
  • Adds a \LeftbarOpen flag set by callers just before \leftbar when inline content follows in the same logical block; \leftbar then emits a single \nobreak\kern\medskipamount\nobreak instead of the breakable medskips, forbidding a page break between the bar and the diamond.
  • Default tail behavior is unchanged for self-closing \leftbar calls.

\Exercise / \Theorem / \Example / \Problem all close with a \endblock
diamond. Previously \leftbar always emitted two breakable medskips of
trailing glue, so when the closing diamond followed inline content
(review-mode solution, \Theorem proof, review-mode example, review-mode
problem) it could land on a fresh page detached from the block above.

Adds a \LeftbarOpen flag set by callers just before \leftbar when inline
content follows in the same logical block; \leftbar then emits a single
\nobreak\kern\medskipamount\nobreak instead of the breakable medskips,
forbidding a page break between the bar and the diamond. Default tail
behavior is unchanged.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
math-comps Ready Ready Preview, Comment May 16, 2026 2:11am

@PatrikBak PatrikBak enabled auto-merge May 16, 2026 02:07
@PatrikBak PatrikBak disabled auto-merge May 16, 2026 02:30
@PatrikBak PatrikBak merged commit 953ed10 into main May 16, 2026
4 checks passed
@PatrikBak PatrikBak deleted the patrik/template-block-pagebreak-fix branch May 16, 2026 02:30
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