This code wraps arbitrary tex inside of a block that will not break until it is longer than a page

noBreaks(tex)

Arguments

tex

A string including escaped tex