I'm in the process of implementing copy-edit comments on a book that has lots of math and lots of single lines before equations in a displayed equation environment. LaTeX likes to break pages between these lines and the equation and I'd prefer if it broke at better locations, like just before the line of text. Is there any way to encourage LaTeX to do this as a general practice.
I do know that I can encapsulate my line of text with the equation in a minipage, but I really want to set a variable or flag somewhere to encourage this behavior.
Edit: After looking at the comments, I see the problem and it is Lyx related, not LaTeX. In Lyx, you cannot easily see whether a line preceding an equation is in the same paragraph as the equation following. I solved my problem by turning on view of paragraph end marks, and by systematically pressing delete at the end of lines preceding equations, and the end of equations that are in the same sentence.
%at the beginning of the line so that it's ignored.) If you're copy-pasting from something printed, blank lines may have been inserted during that process; not all copy-paste apps follow tex's rules. – barbara beeton Aug 20 '19 at 02:39\parhas the same effect. I don't know of any automatic method to overcome this, though it may be possible to script it using regular expressions. – barbara beeton Aug 20 '19 at 13:45