8

I am trying to split an equation over multiple lines. To improve readability, I want to make the second line line up with the right side of the left brace of the first line as is almost achieved in the image below. Doing this, I stumbled upon the issue that alignment marks (&) do not work inside \left, \right. This question pointed me to the \biggl operators that circumvent this problem. I was however wondering: is there a way to make alignment marks inside \left and \right work as expected?

Example and code to generate it:

example equation

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\begin{document}
\def\leftside{\upsilon_{N, cw}(\omega)}
\def\prefix{- \frac{1}{\Delta} \Gamma}
\def\firstline{i\omega - \xi_{cc}\bar N + \frac{\Delta\Gamma}{2}}
\def\lastline{{+}\:\left.\frac{|\kappa|^2}{2\Delta\Gamma} \exp(-i\omega\tau)}
\begin{align}
    \begin{split}
        \leftside =& \prefix
            \begin{aligned}[t]
                &\left(\firstline\right.\\
                &\left.\lastline\right)
            \end{aligned}
    \end{split}
\end{align}
\end{document}
Octaviour
  • 353
  • 3
  • 14
  • 1
    You might find it interesting to have a look at the documentation of the mathtools package (open a terminal emulator window and type texdoc mathtools): see bottom of p. 28 – p. 29. – GuM Feb 08 '17 at 17:13
  • Left... Right form a group, effectively hiding the & from align, thus will never work. Also using left right in the manner you do here is a bit dangerous, as the size depends on the content, thus you may end up with a ( that has a different size than ), therefore manual scaling is best in this case (as it is in general) – daleif Feb 08 '17 at 17:18

3 Answers3

5

There's a solution with Sébastien Gouezel's \MTkillspecial command and \DeclarePairedDelimiter command from mathtools: I define a \brkparens command, which adds an implicit pair of \left … \right in its starred version. For fine tuning, the non-starred version accepts an optional argument (\big, \Big, &c.):

\documentclass[twocolumn]{article}
\usepackage{mathtools}
   \newcommand\MTkillspecial[1]{% helper macro
    \bgroup
    \catcode`\&=9
    \let\\\relax%
    \scantokens{#1}%
    \egroup
    }
    \DeclarePairedDelimiter\brkparens()
    \reDeclarePairedDelimiterInnerWrapper\brkparens{star}{
    \mathopen{#1\vphantom{\MTkillspecial{#2}}\kern-\nulldelimiterspace\right.}
    #2
    \mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#2}}#3}}

\begin{document}

\def\leftside{\upsilon_{N, cw}(\omega)}
\def\prefix{- \frac{1}{\Delta} \Gamma}
\def\firstline{i\omega - \xi_{cc}\bar N + \frac{\Delta\Gamma}{2}}
\def\lastline{{+}\:\frac{|\kappa|^2}{2\Delta\Gamma} \exp(-i\omega\tau)}
\begin{align}
    \begin{split}
        \leftside =& \prefix
            \begin{aligned}[t]
                &\brkparens*{\firstline\\
                &\lastline}
            \end{aligned}
    \end{split}
\end{align}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Yes indeed: this is exactly what I was suggesting! :-) – GuM Feb 08 '17 at 17:28
  • @Gustavo Mezzetti: Actually, I've already given this kind of answer (maybe for braces), and it would have been more judicious to post a link in a comment, but I don't remember which question it was, nor when! – Bernard Feb 08 '17 at 17:37
3

In the definition of \lastline at line 7, you have one unbalanced \left., you should either remove this or remove the other one repeated at line 13. Also, you may get rid of the split environment since the \\ inside aligned will automatically split the equation over two lines.

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\begin{document}
\def\leftside{\upsilon_{N, cw}(\omega)}
\def\prefix{- \frac{1}{\Delta} \Gamma}
\def\firstline{i\omega - \xi_{cc}\bar N + \frac{\Delta\Gamma}{2}}
\def\lastline{{+}\:\frac{|\kappa|^2}{2\Delta\Gamma} \exp(-i\omega\tau)}

\begin{equation}
  \begin{aligned}
    \leftside = \prefix & \left( \firstline \right. \\
                        & \left. \lastline  \right)
  \end{aligned}
\end{equation}

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127
2

I'm curious, if the following simple elementary solution enabled by use of package mathtools fit to your expectation:

\documentclass[twocolumn]{article}
\usepackage{mathtools}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{equation}
  \begin{multlined}
\upsilon_{N, cw}(\omega) 
    = - \frac{1}{\Delta} \Gamma 
        \left(i\omega - \xi_{cc}\bar N + \frac{\Delta\Gamma}{2}\right.       \\
        \left. + \frac{|\kappa|^2}{2\Delta\Gamma} \exp(-i\omega\tau)  \right)
  \end{multlined}
\end{equation}
\lipsum[2]
\end{document}

enter image description here

Zarko
  • 296,517