How to leave a single line of paragraph on the previous/next page (widow/orphan control)?

When a paragraph breaks at the end of a page, if there remains only one line in the next page, then the whole paragraph will jump to the next page. See the following example.

However, if more than one line is left, the paragraph will break normally. See the following example.

How to disable this feature? I want the paragraph to break even when there is only one line left. Thanks!

You can set the orphan costs to 0% to allow single lines on the previous page, see Text Function – Typst Documentation.

#set text(costs: (orphan: 0%))
4 Likes

Thank you! That’s exactly what I want.