Page LayoutUnwanted Automatic Page Break in Align

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
number0
Posts: 2
Joined: Thu Mar 03, 2011 12:54 pm

Unwanted Automatic Page Break in Align

Post by number0 »

Hello Latex community,

While I was working on my math paper, I noticed something very odd after I compiled my document. I saw that Latex automatically page break my equations that I aligned. In other words, Latex wrote the following:

\being{align*}
TEXT TEXT TEXT
TEXT TEXT TEXT
TEXT TEXT TEXT
TEXT TEXT TEXT
TEXT TEXT TEXT
TEXT TEXT TEXT
\end{align*}

onto the page after the page I intended the equations to be on. I figured that the reason or this is that my equations in my align box is so much (around 8 - 9 lines) and so Latex page broke for me to make it look nice. However, I do not want that. I want to leave the equations on the same page that I wrote it in and let it continue onto the next page. I tried to use the command \nopagebreak and it still does not work. Anyone got any advice? Thanks. P.S. The 8-9 lines is necessary because the algebra is extremely tedious and long.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Unwanted Automatic Page Break in Align

Post by gmedina »

Hi,

the amsmath package implements two useful commands: \displaybreak to allow page breaks inside particular math environments and \allowdisplaybreaks (to be used in the preamble) to allow page breaks inside math environments globally. An example:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % just to generate filler text for the example


\begin{document}

\lipsum[1-2]

\begin{align*}
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\ 
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \displaybreak\\
 a &=b \\
 a &=b \\
 a &=b \\
 a &=b \\
\end{align*}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
number0
Posts: 2
Joined: Thu Mar 03, 2011 12:54 pm

Re: Unwanted Automatic Page Break in Align

Post by number0 »

Thank you!
Post Reply