0

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.

5
  • 1
    Welcome to TeX.SE. Your claim that the you can't get page breaks within the 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.
    – Mico
    Commented Dec 8, 2023 at 6:20
  • Welcome to TeX.SE! If I add to your code snipped missed part (documentclass, package 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!
    – Zarko
    Commented Dec 8, 2023 at 6:22
  • @Zarko - While you were posting your comment, I edited the OP's sample code and added \documentclass{article} \usepackage{amsmath} to make the code minimally compilable. :-)
    – Mico
    Commented Dec 8, 2023 at 6:24
  • 3
    @Mico, thank you for help to OP, but this not reproduce OP problem (if it really exist). So I like that he show MWE, which reproduce problem about which he complain.
    – Zarko
    Commented Dec 8, 2023 at 6:30
  • @Zarko - You're right.
    – Mico
    Commented Dec 8, 2023 at 6:56

0

You must log in to answer this question.

Browse other questions tagged .