2

What is best way to let LaTeX formate a long equation such that it matches between the borderrs of a page?

As an example I have the following expression:

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\bar u_e(p')\delta\Gamma^\mu u_\mu(p)=&-\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\; \gamma^\mu\ln\frac{\Delta}{\Delta_\Lambda}u_\mu(p)\\
&+\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\; \frac{1}{\Delta}\left[\frac12\left(| G_L|^2+| G_R|^2+\gamma_5| G_L|^2-\gamma_5| G_R|^2 \right)\left[\left(1-2y\right)q+2pz\right]^\mu\left[(1-z-y)m_\mu\pm m_ey \right]
+\left(\Re(G_Lg_R^*)+i\gamma_5\Im(G_Lg_R^*)\right)\right((1-2y)q+2pz\left)^\mu\right]u_\mu(p)
\end{align*}
\end{document}

I broke the line at some singe points with \\ but inside a breaket this seems not to be possible. Is this correct? Or is there a way to let LaTeX do the newline automatically?

1
  • I would not do that automatically (package breqn btw.). You shoud use a split or multiline or align here. I would always choose \bigl(\biggl(\Bigl(... over \left(. If you want to stick to this, you will have to close it with \right. before the `\\`
    – LaRiFaRi
    Mar 12, 2015 at 15:58

3 Answers 3

5

The main problem are not the brackets but \left and right you're using, you can't break a line inside such a combination, because they have to be inside one line to determine the needed height.

My approach would be to manually set the sizes using \bigl, \Bigl, \biggl and \Biggl from amsmath (and its \bigr collegues for the right hand delimiter). See for example this idea. I further changed your align* to an equation that's split, because you're splitting an equation not aligning multiple ones :)

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
    \begin{equation*}
        \begin{split}
            \bar u_e(p')\delta\Gamma^\mu u_\mu(p)
            &=
            -\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\;                 \gamma^\mu\ln\frac{\Delta}{\Delta_\Lambda}u_\mu(p)\\
            &\qquad+\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\;              \frac{1}{\Delta}
            \Bigl[
            \frac{1}{2}\bigl(| G_L|^2+| G_R|^2 +\gamma_5| G_L|^2-\gamma_5| G_R|^2 \bigr)\\
            &\qquad\qquad\times
            \bigl[(1-2y)q+2pz\bigl]^\mu\bigl[(1-z-y)m_\mu\pm m_ey \bigr]
            \\
            &\qquad\qquad +\Bigl(\Re(G_Lg_R^*)+i\gamma_5\Im(G_Lg_R^*)\Bigl)\bigl((1-2y)q+2pz\bigr)^\mu
            \Bigl]u_\mu(p)
        \end{split}
    \end{equation*}
\end{document}

Yielding

Sketch of splitting

Note that this is just a sketch, this sizes should be a little more fine tuned and the line breaks fitted to logical breaks in the quite loong formula; maybe you can introduce helping variables, e.g. for the first block of \bigl(| G_L|^2+| G_R|^2 +\gamma_5| G_L|^2-\gamma_5| G_R|^2 \bigr) = G_{\text{new}}, something like that improves readability imho more than breaking lines.

6

May be this:

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\bar u_e(p')\delta\Gamma^\mu u_\mu(p)&= -\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\; \gamma^\mu\ln\frac{\Delta}{\Delta_\Lambda}u_\mu(p)\\
&\qquad +\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\; \frac{1}{\Delta}Au_\mu(p)
\intertext{where}
A&= \biggl[\frac12(| G_L|^2+| G_R|^2+\gamma_5| G_L|^2-\gamma_5| G_R|^2 )[(1-2y)q+2pz]^\mu\\
&\qquad [(1-z-y)m_\mu\pm m_ey ]
+(\Re(G_Lg_R^*)+i\gamma_5\Im(G_Lg_R^*))((1-2y)q+2pz)^\mu\biggr]
\end{align*}

\end{document}

enter image description here

There is no automatic way to break as breqn is not stable. Also, I removed all \left and \rights as they are not needed. For the outer pair, I have used \bigg constructs from amsmath which can be broken across lines without balancing.

1
  • 1
    Should't the last line be started with some sort of multiplication marker symbol (just for good meaure)?
    – daleif
    Mar 12, 2015 at 16:11
5

The following suggestion splits the full equation across five lines, and it uses changes in size and style of the typographic "fences" -- round parentheses, square brackets, and curly braces -- to help guide the visual parsing of the full expression.

enter image description here

\documentclass{scrartcl}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\bar u_e(p')\delta\Gamma^\mu u_\mu(p)=
&-\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz \int_0^{1-z} dy\; \gamma^\mu\ln\frac{\Delta}{\Delta_\Lambda}u_\mu(p)\\
&+\frac{ie}{32\pi^2}\bar u_e(p')\int^1_0 dz\int_0^{1-z} dy\; \frac{1}{\Delta}\\
&\qquad \times
\biggl\{\frac12\bigl[| G_L|^2+| G_R|^2+\gamma_5| G_L|^2-\gamma_5| G_R|^2 \,\bigr]\\
&\qquad\qquad\quad\times \bigl[(1-2y)q+2pz\bigr]^\mu
     \bigl[(1-z-y)m_\mu\pm m_ey \bigr]\\
&\qquad\qquad+\bigl[\Re(G_Lg_R^*)+i\gamma_5\Im(G_Lg_R^*)\bigr]
\bigl[(1-2y)q+2pz\bigr]^\mu \biggr\} u_\mu(p)
\end{align*}
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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