How can I extend the page content for one line to not break the paragraph? (like \enlargethispage)

Hi, I am looking for a way to extend the content of my page for one line in order not to break the paragraph.
I have found somewhere online that the following can be used:

#pad(bottom: -1em)[paragraph]

I could not find the thread anymore, that is why I am asking again.

Unfortunately this does not work when there is a footnote on the page, as the last line of the paragraph then overlaps with that footnote.
Is there a command similar to LaTeXs \enlargethispage?

Hi there @aurel,

Have a look at Text Function – Typst Documentation costs parameter.

Something like:

#set text(costs: (widow: 0%))

Thank you for the quick reply! Does this also work when two lines are displayed on the second page? It seems not to, but maybe I am overseeing an argument.

Also, wouldn’t setting the cost to 0% allow the widow lines?

Seems to me they are two parameters working independently. With defaults at 100% as per the docs.

Not sure about the two lines. But that would be defeating the purpose of widow/orphan? Maybe there is another option.

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