Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(typesetters): Discourage page breaks after hyphenated lines #2221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Feb 4, 2025

When typesetting a real book, sooner or later, the following occurs:

image

Most typographers would frown upon hyphenated words at the end of a page (even so more if the page ends being a right page).

Is this a bug? Well yes if SILE reportedly pretends being as good as TeX already.
Otherwise it's a "feature", implementing the missing TeX "brokenpenalty".

So here it is...

Simplified MWE

\begin[papersize=a7]{document}
\neverindent
\nofolios
\font[family=Libertinus Serif, size=12pt]
\language[main=en]

Check page break.

% Ad hoc skip to trigger the issue, with some flexibility to allow for lines to
% move around.
% Some lines of text, our sentence with a long word ("desintructionalizations")
% that we expect to be hyphenated, and some more text.
% The game is for our word to be broken, but not conflict with orphan/widow lines.
\skip[height=6.5cm plus 1cm minus 1cm]

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam nec purus nec nunc ultricies ultricies.
Desintructionalizations may lead to revolutions in the future.

\end{document}

Observed

image

Expected (fixed)

image

It should be a good thing to start with.1

Footnotes

  1. To be honest, there's more to be discussed on the topic...
    - Esp. with footnotes, where this could be more "acceptable" (say some) (so what value should be active with footnotes is a question for the footnote logic)
    - And... Er... on the main text content with footnotes again, due to the way they can be split or not, etc. and how the current pagebuilder computes penalties and badness.

@Omikhleia Omikhleia requested a review from alerque as a code owner February 4, 2025 20:14
@Omikhleia Omikhleia added the enhancement Software improvement or feature request label Feb 4, 2025
@Omikhleia Omikhleia self-assigned this Feb 4, 2025
@Omikhleia
Copy link
Member Author

NOTE.
This will obviously affect existing books. If needed, one can set typesetter.brokenpenalty to 0 and the output will then be the same as before. I'm not sure we should put that in "retrograde" or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Software improvement or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant