52

I do have a longer paper. In one chapter I got several multiline equations, which I wrote using the align environment from amsmath-package. Actually those are quite long computations which should break anywhere for avoiding to much empty space on a page.

I want to use something like \allowdisplaybreaks, which does exactly what I want. The problem is, that I do not want to allow displaybreaks anywhere else in the document, where I have no control about it. I tried to use \allowdisplaybreaks directly before \begin{align}, hoping it would only apply on the next following align-enviroment. But it applies to every align-environment later in the text.

Is there any way to "stop" the command again?

And yes, I could use \displaybreak for single breaks, but I had to use it in many equations and I needed to put it in every single line, since the pagebreak should move, if I add a few more lines anywhere in the chapter.

Thanks for your help, Greyfox

1 Answer 1

63

you can localize the breaks if you code your display like this:

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

the percent sign probably isn't needed after the \end{align}, but i'm just playing it safe, to avoid a possible space at the beginning of the next line if it doesn't start a new paragraph.

4
  • 5
    In such cases I'd be tempted to do \begin{allowdisplaybreaks}\begin{align}...\end{align}\end{allowdisplaybreaks}, but that's probably bad form. — EDIT (after reading implementation) it seems that \allowdisplaybreaks[0] should disable breaks again. Commented Aug 23, 2016 at 20:19
  • @BrunoLeFloch -- i'll have to try that. don't usually experiment with commands-turned-into-environments if they're not predefined. also need to check on presence of space at beginning of text line after display. Commented Aug 23, 2016 at 21:55
  • @BrunoLeFloch does the environment \begin{allowdisplaybreaks}...\end{allowdisplaybreaks} belong to any package or is it a standard LaTeX environment? Commented May 4, 2018 at 17:09
  • 6
    @Taekwondavide It's an ugly hack that I probably shouldn't have suggested: \begin{anything}...\end{anything} is roughly the same as \begingroup\anything...\endanything\endgroup, but works even if \endanything is not defined. Commented May 4, 2018 at 19:33

You must log in to answer this question.

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