I have an extremely long equation using subequations, similar to the below, except that it has many many constraints. latex starting a new page at the beginning of the equation. However, I'd prefer if it started the equation, and then allowed for a pagebreak in between some of the constraints.
\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks
\begin{document}
\begin{subequations} \label{eq:my_eq}
\begin{alignat}{2}
& \min_{x, w,b} && \gamma \label{eq:obj} \\
& & & \text{s.t. } x \le 1 \label{eq:constr_1}. \\
& & & \text{s.t. } 0 \le w \le 1 \label{eq:constr_2} \\
& & & \text{s.t. } x \ge 0 \label{eq:constr_3}. \\
& & & \text{s.t. } 0 \le b \le 1 \label{eq:constr_4}
\end{alignat}
\end{subequations}
\end{document}
I saw the question here: Is it possible to pagebreak aligned equations?, but the command \allowdisplaybreaks
didn't change anything for me. Does anyone know another way around this?
I also saw this question: https://tex.stackexchange.com/questions/625456/`, although I'm not in a split
environment so it didn't help.
alignat{2}
environment is a bit puzzling. For sure, check what happens if you insert the instruction\setlength\textheight{3mm}
immediately before\begin{document}
and re-run LaTeX: You should be getting the 5-line equation spread out over 5 pages.amsmath
), then works as expected: equation break between two pages. So, please extend your code snipped to complete small document, which we can test as it is and which reproduce your problem!\documentclass{article} \usepackage{amsmath}
to make the code minimally compilable. :-)