Guide to Cutting Long Equations in Latex for Optimal Formatting

  • LaTeX
  • Thread starter ladil123
  • Start date
  • Tags
    Cut Latex
In summary: If you only had a \left( command on the first line and the closing \right) command on the second line, the program would not be able to find the end of the equation.
  • #1
ladil123
45
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
  • #2
Use http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-223.html .
 
Last edited by a moderator:
  • #3
http://www.ams.org/tex/amslatex.html" for more information.
 
Last edited by a moderator:
  • #4
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.
 
  • #5
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
 
  • #6
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?
 
  • #7
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
 
  • #8
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 ?
 
  • #9
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}
 

1. How do I cut long equations in LaTeX?

To cut long equations in LaTeX, you can use the \splitfrac command. This will split the equation into two lines, making it easier to read and format.

2. Can I cut equations with multiple lines in LaTeX?

Yes, you can use the \begin{align}\end{align} environment to cut equations with multiple lines. This will allow you to align the different parts of the equation for optimal formatting.

3. Are there any other commands for cutting equations in LaTeX?

Yes, there are other commands such as \displaybreak and \allowdisplaybreaks that can be used to control where an equation is split and how multiple equations are aligned. It is recommended to experiment with these commands to find the best formatting for your equations.

4. How can I ensure that my equations are still readable after cutting them in LaTeX?

To ensure readability, it is important to properly align and label your equations. You can use the \label and \eqref commands to reference specific equations in your document. Additionally, using proper indentation and spacing can also help improve the readability of your equations.

5. Are there any packages or templates specifically for cutting equations in LaTeX?

Yes, there are packages such as breqn and mathtools that provide additional features and customization options for cutting equations in LaTeX. There are also templates available that are designed specifically for formatting long equations, such as the IEEEeqnarray template for formatting equations in IEEE publications.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
230
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
782
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
11K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top