Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to break a long equation in LaTex. I have tried multline and align but I always get errors with the brackets.

\begin{equation}
\dfrac{dr_{ij}}{dt} = \frac{1}{2r_{ij}} \left[ 2 \left( x_{i}-x_{j} \right) \left( \dfrac{dx_{i}}{dt} - \dfrac{dx_{j}}{dt} \right) + 2 \left( y_{i}-y_{j} \right) \left( \dfrac{dy_{i}}{dt} - \dfrac{dy_{j}}{dt} \right) + 2 \left( z_{i}-z_{j} \right) \left( \dfrac{dz_{i}}{dt} - \dfrac{dz_{j}}{dt} \right) \right] 
\end{equation}

I want to break it in a way, so that all the three "2"s are below each other. How can I do that without getting an error with the brackets?

share|improve this question

2 Answers 2

If you need to split large brackets across lines of an equation, it's easiest to set their size manually.

\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\dfrac{dr_{ij}}{dt} = \frac{1}{2r_{ij}} \biggl[ 
         &2 ( x_{i}-x_{j}) \left( \dfrac{dx_{i}}{dt} - \dfrac{dx_{j}}{dt} \right) \nonumber \\
   {}+{} &2 ( y_{i}-y_{j}) \left( \dfrac{dy_{i}}{dt} - \dfrac{dy_{j}}{dt} \right) \nonumber \\
   {}+{} &2 ( z_{i}-z_{j}) \left( \dfrac{dz_{i}}{dt} - \dfrac{dz_{j}}{dt} \right) \biggr]
\end{align}
\end{document}
share|improve this answer

This is a job for split:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
\frac{dr_{ij}}{dt} =
\frac{1}{2r_{ij}} \biggl[
  & 2 \left( x_{i}-x_{j} \right) \left( \dfrac{dx_{i}}{dt} - \dfrac{dx_{j}}{dt} \right) + {}\\
  & 2 \left( y_{i}-y_{j} \right) \left( \dfrac{dy_{i}}{dt} - \dfrac{dy_{j}}{dt} \right) + {}\\
  & 2 \left( z_{i}-z_{j} \right) \left( \dfrac{dz_{i}}{dt} - \dfrac{dz_{j}}{dt} \right)
  \biggr]
\end{split}
\end{equation}
\end{document}

enter image description here

Note that we have to manually specify the size for the outermost braces, because \left and \right cannot be divided across lines.

share|improve this answer
2  
you should probably also mention that you've specified the size of the outermost brackets manually instead of using \left ... \right, since those can't be separated across lines. –  barbara beeton Apr 21 at 15:35
    
@barbarabeeton Done, thanks. –  egreg Apr 21 at 16:00
    
Is there any way to use \left ... \right or any way that adapts the brackets' size automatically? –  user50224 Apr 21 at 19:41
1  
@user50224 Sorry, no. –  egreg Apr 21 at 19:50
1  
@user50224 I try to avoid compound fractions in the first place. \left[<formula>\right. and \left.<formula>\right] with some \vphantom may help. –  egreg Apr 21 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.