[Tex/LaTex] Custom pagebreak in align equation

alignequationspage-breakingvertical alignment

I got the following problem: Right now I am checking my equations, which are usually written in align. This looks great in most of the cases, but sometimes the pagebreaks are weird, ie there is a lot of vertical whitespace left (like 2.5cm) at the end of a page. I made the following MWE to illustrate this.

\documentclass[a4paper, 12pt, headsepline]{scrreprt}
\usepackage[onehalfspacing]{setspace}
\usepackage{amsmath, amssymb, mathtools}
\usepackage{mathptmx}
\usepackage[a4paper]{geometry}
\geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}
% \usepackage{lipsum} %\lipsum
\usepackage[pangram]{blindtext}

\begin{document}
\Blindtext[1][3]%1 paragraph, 3 pangrams
\begin{align}
X_{t+1} &=  \frac{X_{t+1}+X_{t+1}}{Y_t}  \label{eq:1} 
\intertext{Solving...:} \notag 
X_{t}  &=  \frac{X_{t+1}+X_{t+1}}{Y_{t+1}} \notag \\
\intertext{Solving further...:} \notag 
% ===PAGEBREAK HERE: 2nd page begins===
&= \frac{X_{t+1}+X_{t+1}}{Y_t} + 
\frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \\
&= \frac{X_{t+1}+X_{t+1}}{Y_t}...  \notag \\
\intertext{Solving further...:} & = \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag
\end{align} 
\end{document}

In the MWE, the first 'Solving further' should be on the first page instead (to save space and it would also look better I guess?). The position where I would like the pagebreak to be is also marked as a comment in the MWE.

My question is first on a general basis: Which is the best environment to achieve multiple line equations, which can be aligned as in align, and to save space at the same time? Or to be more precise: If possible, I'd like to stick with align and adapt the pagebreaks only if necessary.

Thanks!

Best Answer

If you want automatic page breaks you have to use the command \allowdisplaybreaks in your preamble.

If you want manual page breaks, you have to use the command \displaybreak followed by \\, as in the following MWE:

\documentclass[a4paper, 12pt, headsepline]{scrreprt}
\usepackage[onehalfspacing]{setspace}
\usepackage{amsmath, amssymb, mathtools}
\usepackage{mathptmx}
\usepackage[a4paper]{geometry}
\geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}
% \usepackage{lipsum} %\lipsum
\usepackage[pangram]{blindtext}

\begin{document}
\Blindtext[1][3]%5 paragraphs, each 3 pangrams
\begin{align}
X_{t+1} &=  \frac{X_{t+1}+X_{t+1}}{Y_t}  \label{eq:1}
\intertext{Solving...:} \notag
X_{t}  &=  \frac{X_{t+1}+X_{t+1}}{Y_{t+1}} \notag \\
\intertext{Solving further...:} \notag \displaybreak\\
% ===PAGEBREAK HERE: 2nd page begins===
&= \frac{X_{t+1}+X_{t+1}}{Y_t} +
\frac{X_{t+1}+X_{t+1}}{Y_t}  \notag \\
&= \frac{X_{t+1}+X_{t+1}}{Y_t}...  \notag \\
\intertext{Solving further...:} & = \frac{X_{t+1}+X_{t+1}}{Y_t}  \notag
\end{align}
\end{document} 

Output

enter image description here

Related Question