7

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}
  • 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 8 '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 8 '17 at 17:18
3

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

  • Yes indeed: this is exactly what I was suggesting! :-) – GuM Feb 8 '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 8 '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

  • You should probably been using equation instead of align in this specific case, since you are aligning nothing... – Arzigoglu Feb 8 '17 at 19:41
  • Yes, of course, I just kept the OP's format for easy comparison, thanks. – AboAmmar Feb 8 '17 at 19:49
1

I'm curious, if the following simple elementary solution enabled by udse 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

  • You're missing a + sign, it seems. – Arzigoglu Feb 8 '17 at 19:51
  • oh, error due to unaccurate copy-past ... added – Zarko Feb 8 '17 at 20:09

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.