# Formatting an equation

\begin{align} \frac{1}{2} (1-\varepsilon^2)\left(\partial_\tau \phi\right)^2
= \frac{1}{2} \left(1-\epsilon ^2\right) \left(
-\frac{S \epsilon \sin\tau }{\sqrt{\lambda }}
-\frac{\text{g2} S^2 \epsilon ^2\sin2\tau }{3 \lambda }
+\epsilon ^3 \left(-\frac{\left(-\frac{1}{54} \text{g2}^2 S
\left(32+19 S^2\right) \lambda +Z \left(
\frac{35 \text{g2}^4}{27}
-\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8}
-\frac{\text{g2}^2 \lambda }{6}
+\frac{\lambda ^2}{24}\right)\right) \sin\tau }{\lambda ^{5/2}}
-\frac{S^3 \left(4 \text{g2}^2-3 \lambda \right) \sin3\tau }
{24 \lambda ^{3/2}}\right)\right)^2
\end{align}


I want to split the equation in my latex file, I have used & \qquad but it is not working because of bracket. What else I can do?

-
What do you mean, “It’s not working”? Does the equation refuse to render, look strange or have another odd behaviour? – alexwlchan Jun 12 '13 at 16:30
Without & \qquad . It is working fine but when I want to break the equation then it fails – Complex Guy Jun 12 '13 at 16:35
If you start a \left( on one line, and finish it on another (e.g. \left( ... \\ ... \right)), then the compiler borks. Try adding phantom terms such as right., which close the left element (e.g. \left( ... \right. \\ \left. ... \right)). The left and right elements on each line have to match. Does that help? – alexwlchan Jun 12 '13 at 16:37
Got it but little confused , can you apply that into my equations? – Complex Guy Jun 12 '13 at 16:40

close an open \left( by an \right. before you put the linebreak and open it in the next line again with \left.

\begin{align*} \frac{1}{2} (1-\varepsilon^2)\left(\partial_\tau \phi\right)^2
&= \frac{1}{2} \left(1-\epsilon ^2\right)\left(
-\frac{S \epsilon \sin\tau }{\sqrt{\lambda }}
-\frac{\text{g2} S^2 \epsilon ^2\sin2\tau }{3 \lambda }\right.\\
&\quad\left. +\epsilon ^3 \left(-\frac{\left(-\frac{1}{54} \text{g2}^2 S
\left(32+19 S^2\right) \lambda +Z \left(
\frac{35 \text{g2}^4}{27}
-\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8}
-\frac{\text{g2}^2 \lambda }{6}
+\frac{\lambda ^2}{24}\right)\right) \sin\tau }
{\lambda ^{5/2}}\right.\right.\\
&\quad\left.\left.-\frac{S^3 \left(4 \text{g2}^2-3 \lambda \right) \sin3\tau }
{24 \lambda ^{3/2}}\right)\right)^2
\end{align*}

-
If you do it this way there is no guarantee that the paired delimiters are the same size. – David Carlisle Jun 12 '13 at 17:50

Replace each \left( \right) by (say) \Bigl( \Bigr) If you choose the size manually in this way then you may split the brackets over lines and alignment cells.

Also, please always post complete documents not just a fragment:

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

\begin{align*} \frac{1}{2} (1-\varepsilon^2)(\partial_\tau \phi)^2
&= \frac{1}{2} (1-\epsilon ^2) \Biggl(
-\frac{S \epsilon \sin\tau }{\sqrt{\lambda }}
-\frac{\text{g2} S^2 \epsilon ^2\sin2\tau }{3 \lambda }\\
&\quad +\epsilon ^3 \Bigl(-\frac{\Bigl(-\frac{1}{54} \text{g2}^2 S
(32+19 S^2) \lambda +Z \Bigl(
\frac{35 \text{g2}^4}{27}
-\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8}
-\frac{\text{g2}^2 \lambda }{6}
+\frac{\lambda ^2}{24}\Bigr)\Bigr) \sin\tau }{\lambda ^{5/2}}\\
&\qquad -\frac{S^3 (4 \text{g2}^2-3 \lambda) \sin3\tau }
{24 \lambda ^{3/2}}\Bigr)\Biggr)^2
\end{align*}

\end{document}

-
updated with different size brackets – David Carlisle Jun 12 '13 at 16:52
Why not multline? – egreg Jun 12 '13 at 17:08
@egreg,OP started with align:-) – David Carlisle Jun 12 '13 at 17:49

For some reason you want center the three lines. Then you can do the following (observe the commented version with \left and \right):

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\begin{array}{c} \displaystyle \frac{1}{2} (1-\varepsilon^2) \left( \partial_\tau \phi\right)^2 = \frac{1}{2} \left(1-\epsilon ^2\right) %\left( \Biggl( -\frac{S \epsilon \sin\tau }{\sqrt{\lambda }} -\frac{\text{g2} S^2 \epsilon ^2\sin2\tau }{3 \lambda } %\right. \\ \displaystyle +\epsilon ^3 % \left( \Biggl( -\frac{\left(-\frac{1}{54} \text{g2}^2 S \left(32+19 S^2\right) \lambda +Z \left( \frac{35 \text{g2}^4}{27} -\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8} -\frac{\text{g2}^2 \lambda }{6} +\frac{\lambda ^2}{24}\right)\right) \sin\tau }{\lambda ^{5/2}} %\right. \\ \displaystyle %\left.\left. -\frac{S^3 \left(4 \text{g2}^2-3 \lambda \right) \sin3\tau } {24 \lambda ^{3/2}} %\right)\right)^2 \Biggr)\Biggr)^2 \end{array}$

\end{document}


-