Math & ScienceBreaking lines in the align environment.

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
GleasSpty
Posts: 5
Joined: Sat Nov 28, 2009 6:17 pm

Breaking lines in the align environment.

Post by GleasSpty »

Normally, when I try to break lines in the align environment, everything works perfectly line. However, if I try to make a line break inside brackets, for example, created with the \left[ / \right] commands, Latex throws tons of errors and won't typeset anything at all after the line break.

Is there any way around this? How can I perform a line break inside brackets (or parentheses, or curly braces, etc.)?

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Breaking lines in the align environment.

Post by localghost »

In a line there has always to be a complete pair of \left and \right delimiters. In case such a pair spreads over two or more lines, you have to balance that with according invisible delimiters \left. and \right. in order to avoid errors.


Best regards and welcome to the board
Thorsten¹
GleasSpty
Posts: 5
Joined: Sat Nov 28, 2009 6:17 pm

Re: Breaking lines in the align environment.

Post by GleasSpty »

When I did this, everything typset correctly (as far as I can tell); however, Texniccenter is still throwing errors at me: 4 to be prcise. They all say "Missing delimeter".

It's not that big of a deal because the output is what it should be, but is there any way to eliminate these errors as well?

Thanks much!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Breaking lines in the align environment.

Post by localghost »

Show the relevent code embedded in a minimal working example (MWE).
GleasSpty
Posts: 5
Joined: Sat Nov 28, 2009 6:17 pm

Breaking lines in the align environment.

Post by GleasSpty »

Here is the relevant line:

Code: Select all

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}

\begin{align*}
\nabla ^2v & =2\left[ \left( \left( \frac{\partial ^2u}{\partial x^2}\right) ^2+\frac{\partial u}{\partial x}\frac{\partial ^3u}{\partial x^3}+\left( \frac{\partial ^2u}{\partial x\partial y}\right) ^2+\frac{\partial u}{\partial y}\frac{\partial ^3u}{\partial x^2y}\right) \right \\
& +\left \left( \left( \frac{\partial ^2u}{\partial y^2}\right) ^2+\frac{\partial u}{\partial y}\frac{\partial ^3u}{\partial y^3}+\left( \frac{\partial ^2u}{\partial x\partial y}\right) ^2+\frac{\partial u}{\partial x}\frac{\partial ^3u}{\partial xy^2}\right) \right]
\end{align*}

\end{document}
The error reads:
Missing delimiter (. inserted ).
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Breaking lines in the align environment.

Post by localghost »

As mentioned earlier, you have to balance a single delimiter with an invisible one to make the pair complete (see »Math Miscellany«).

Code: Select all

\left. \ldots \right)
GleasSpty
Posts: 5
Joined: Sat Nov 28, 2009 6:17 pm

Re: Breaking lines in the align environment.

Post by GleasSpty »

Oops. Sorry about that. I didn't see the period there before. Anyways, I have resolved the problem now.

Thanks a lot!
olofos
Posts: 56
Joined: Tue Nov 24, 2009 10:37 pm

Breaking lines in the align environment.

Post by olofos »

In general I think it's better to manually adjust the size of the delimiters using \big or it's cousins, when the start and end brackets are on different lines. This makes sure that both brackets are of the same size. Another option is to use the breqn package, which seems very powerful, though I never actually used it myself.
Post Reply