Guide to Cutting Long Equations in Latex for Optimal Formatting

  • Context: LaTeX 
  • Thread starter Thread starter ladil123
  • Start date Start date
  • Tags Tags
    Cut Latex
Click For Summary

Discussion Overview

The discussion revolves around formatting long equations in LaTeX, specifically how to break them across multiple lines while maintaining proper syntax and alignment. Participants explore various methods and address common issues encountered when using commands like \left and \right.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks advice on how to break a long equation in LaTeX so that it continues on the next line.
  • Another participant suggests using the split environment for better formatting of long equations.
  • There is a mention that the eqnarray environment is no longer recommended due to spacing issues.
  • A participant raises a follow-up question regarding the use of \left and \right commands when breaking equations across lines, noting that it leads to errors.
  • Another participant asks for clarification on the issue with \left and \right commands and suggests using dummy constructs \left. and \right. to resolve the problem.

Areas of Agreement / Disagreement

Participants express differing preferences for methods of breaking long equations, with some advocating for the split environment while others highlight the limitations of certain commands. The discussion remains unresolved regarding the best approach to handle \left and \right commands across multiple lines.

Contextual Notes

Participants mention specific LaTeX commands and environments, but there are unresolved issues related to the proper use of \left and \right commands in multi-line equations, as well as potential errors that arise from their misuse.

ladil123
Messages
42
Reaction score
0
Hello!

I got a very long equation that I´m writing in Latex, it is so long that the equation reference can´t fit on the same line.

How do I write to cut the equation so it continues on the next line?

Thanks
 
Physics news on Phys.org
Use http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-223.html .
 
Last edited by a moderator:
http://www.ams.org/tex/amslatex.html" for more information.
 
Last edited by a moderator:
Like lars, I prefer to use the split environment. Using it, it looks something like this
Code:
\begin{equation}
\label{whateverequation}
\begin{split}
x &= start of long equation \\
& second half of long equation
\end{split}
\end{equation}

The two backslashes indicate the end of the line, and the ampersands on each line are aligned underneath each other.
 
The use of eqnarray is no longer suggested, since the spacing leaves much to be desired. as las3rjock noted, there are much better options available.

One more note: this link is a little dated, but the advice found there is good.

http://www.math.uiuc.edu/~hildebr/tex/displays.html
 
Thanks for the help!

I got a follow up question..

If I have "\left(" command on the first line of the equation and the closing "\right)" command on the second line it won't work!

Any tips on how to make it work?
 
ladil123 said:
If I have "\left(" command on the first line of the equation and the closing "\right)" command on the second line it won't work!

Could you be more precise in what won't work?

If you have a one line equation that you break at some point, why do you use \left( instead of just (?

I only use the \left( when I have multi line math environment, like a matrix.

Cheers
 
Ok,
My equation has one breaking point. At the first line i got the "\left[" command
and then that line is cut off with \\
Then on the second line I got "\right]".

Then when I should quick build my pdf file I get an error message:
"Missing \right inserted"

below is my input

\begin{align}

w_{h}^{''}(x) & =2 \lambda^{2} \left[ cosh \lambda x (E cos \\
\lambda x - D sin \lambda x ) + sinh \lambda x (B cos \lambda x - A sin \lambda x )\right] \label{winkler_homo8910} \\

\end{align}


I hope I made it more clear ?
 
There was JUST a post that addressed this. Basically each individual line in latex needs both a left and a right. In order to resolve this with multi-line equations, you use the dummy \left. and \right. constructs. Basically these act as ghost braces to end the current one.
Example:
Code:
\begin{equation}
\label
\begin{split}
x =& \left[ the start of the equation \right. \\
\left. &second half of the equation \right]
\end{split}
\end{equation}
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
14K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
3
Views
8K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K