247

The report I'm writting features a lot of long, multiple lines equations. To reduce visual polution I've been using an aligned environment nested inside equation. This way (unlike just using an align environment) I get only a single label for all the lines.

The problem is that so many long equations often need to be broken into two pages, otherwise I get lots of blank vertical space in the document. However the aligned environment does not allow the \displaybreak command.

Is there an alternative way to achieve a pagebreak inside an aligned equation?

Here's a sample ofthe equations I'm using

\begin{equation}
    \begin{aligned}
    ...\\
    ...\\  %I need to pagebreak here
    ...\\
\end{aligned}\end{equation}    
4
  • 2
    What about the split environment? Commented Apr 12, 2012 at 18:05
  • 3
    About \begin{equation}\begin{aligned}: Would \begin{align}...\notag \\ \label{where you want it} \\ \end{align} (or the split environment as mentioned by Stephan Lehmke) be a possible alternative for you?
    – Stephen
    Commented Apr 12, 2012 at 18:09
  • @Stephen I'll try it now, but according to AucTeX split can't be broken either. align+\notag seems like a good idea. I wasn't using it because that would involve managing dozens of \notags. But I suppose I could use it only on the problematic equations.
    – Malabarba
    Commented Apr 12, 2012 at 21:15
  • 6
    if you only want one number you can use the starred form of the environment and use \tag once rather than the unstarred form and use \notag on all but one line Commented Apr 12, 2012 at 22:22

4 Answers 4

266

In relation to the comments I want to answer this question.

First of all to allow page breaks inside equations you have to set the command \allowdisplaybreaks. Without setting this one no page break occurs.

Using a simple align-environment. Of course as @DavidCarlisle suggested you can use the star variant to suppress the numbering and set a specific tag by \tag.

The environment split can't handle page breaks.

\documentclass{article}
\usepackage{amsmath}
\usepackage{kantlipsum}
\usepackage{showframe}
\allowdisplaybreaks

\begin{document}
\kant[1-3]
\begin{align*}
    a\\
    b\\
    c\\
    d\\
    e\tag{\stepcounter{equation}\theequation}\\
    f\\
    g\\
    h\\
    i
\end{align*}
\end{document}
7
  • The tag thing is not working for me. I found this \stepcounter{equation}\tag{\theequation}\label{myeq1} working. Commented Dec 28, 2014 at 9:12
  • 1
    It somehow solves my problem of a mildly underfull split equation...it didn't break, but fudge the spaces a little bit...why...?
    – Troy Woo
    Commented Feb 9, 2015 at 15:42
  • 32
    What's the correct way to set \allowdisplaybreaks locally? Just directly saying it inside a group surrounding the align*? Or inside the align*? Commented Jul 29, 2017 at 10:57
  • 7
    @EvgeniSergeev see this answer - yes, using a group works Commented Jul 23, 2019 at 23:23
  • 1
    how can this be used for \begin{equation}\begin{aligned} XXX \end{aligned}\end{equation} Commented Sep 26, 2021 at 15:33
117

Additionally to the above answers, as asked in comments, the command \allowdisplaybreaks from amsmath can be used locally do a display break by using the \begingroup and \endgroup commands:

\begingroup
\allowdisplaybreaks
\begin{align}
    ....
\end{align}
\endgroup

Or simpler syntax (shoutout to GWPR):

{\allowdisplaybreaks
\begin{align}
    ....
\end{align}
}
5
  • 3
    This answer indicates that without \begingroup and \endgroup, the effect of \allowdisplaybreaks are applied globally. Commented Jan 3, 2021 at 3:51
  • Best answer, because it doesn't break the rest of the document. For example, I have a bunch of small equation systems which I did not want to break over pages. However, I also had a couple very long ones. This solution comes in handy because it avoids having to manually break pages before every single short equation system that one desires to keep together, because of the latter's small size.
    – GPWR
    Commented Apr 22, 2023 at 12:00
  • @KaiserKatze Globally or everywhere after the instance of \allowdisplaybreaks?
    – GPWR
    Commented Apr 22, 2023 at 12:01
  • 1
    Can \begingroup and \endgroup nor be replaced by { and }, respectively?
    – GPWR
    Commented Apr 22, 2023 at 15:52
  • 1
    @GPWR Can confirm it does work. As another note, on a primitive level the { and } are not equivalent to \begingroup and \endgroup. See here
    – Mr G
    Commented May 1, 2023 at 3:44
24

Just add the \allowdisplaybreaks command from the amsmath package to the preamble of your document. Works only with the math environments provided by this package. So you can use align.

3
  • 10
    Isn't this all covered in the other answer?
    – Johannes_B
    Commented Nov 5, 2017 at 9:13
  • 7
    @Johannes_B To be fair, the other answer doesn't clarify that this only works with the environments from amsmath, so that the solution doesn't work with, for example, a custom math environment. This answer does clarify that. Commented Sep 18, 2018 at 16:41
  • 1
    Also, the \allowdisplaybreaks command accepts an optional value of 1-4 indicating how "allowed" display breaks are. E.g., \allowdisplaybreaks[4] will allow more display breaks than \allowdisplaybreaks[1] will.
    – inavda
    Commented Sep 10, 2022 at 2:32
3

I am posting my version because it took me some time to figure that out and i hope it will help others also.

\allowdisplaybreaks goes before \begin{document} and it is used only once. Then a very general code example for an equation is the following

\begin{align} 
\sum{...a very large expression...} &= \sum{...another large expression...} \nonumber \\ 
&= \sum{...a result which is also large but needs to be aligned under first "="...} \nonumber \\
{...again a large expression...} &= {...still a large expression...}  \\
&= {... a final large expression...}
\end{align} 

If \nonumber is not used, latex will assign numbers to every line break which for the majority of cases is useless. That worked for me

1
  • 2
    align* gives the not-numbered version. So, this answers is pointless. Commented Jul 4, 2021 at 6:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .