1

This question already has an answer here:

The following works fine,

\begin{equation*}
    \begin{aligned}
        \begin{split}
            \left\| \left(a - c\right) - \frac{|b|^2\cdot |d|^2}{|b \times d|^2} \left[
                                     \left(\left(a - c\right)\cdot \left(\frac{b}{|b|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{d}{|d|}\right)\right) \cdot \frac{b}{b} \right.\right. + \\
            \left.\left. \left(\left(a - c\right)\cdot \left(\frac{d}{|d|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{b}{|b|}\right)\right) \cdot \frac{d}{d} 
            \right] \right\| = \frac{|(a - c) \cdot b \times d|}{|b \times d|}  
        \end{split}
    \end{aligned}
\end{equation*}

but if I add &, it throws an error

\begin{equation*}
    \begin{aligned}
        \begin{split}
            \left\| \left(a - c\right) - \frac{|b|^2\cdot |d|^2}{|b \times d|^2} \left[
                                     & \left(\left(a - c\right)\cdot \left(\frac{b}{|b|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{d}{|d|}\right)\right) \cdot \frac{b}{b} \right.\right. + \\
            & \left.\left. \left(\left(a - c\right)\cdot \left(\frac{d}{|d|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{b}{|b|}\right)\right) \cdot \frac{d}{d} 
            \right] \right\| = \frac{|(a - c) \cdot b \times d|}{|b \times d|}
        \end{split}
    \end{aligned}
\end{equation*}

According to many posts, I tried several combinations of \begin{equation*}, \begin{aligned}, \begin{split} and \begin{multline*} but without success. What do I miss?

Expected result

enter image description here

(Without & the first square bracket is also ok, but the alignment is destroyed)

Comment, why this is not a duplicate of other questions: To me, the crucial point of the answer is, that you need an extra \vphantom{\frac{b}{b}}\right.\right. and you have to add another & \left.\left. line.

marked as duplicate by campa, Raaja, Phelype Oleinik, CarLaTeX, user156344 Apr 26 at 14:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You can't put an alignment symbol & between \left and \right. – campa Apr 26 at 12:26
  • @campa But how can I then get the expected result? – Christoph Apr 26 at 12:27
  • @campa, no, see my edit. I tried and the solution there does not work. I think, there is no way around the trick suggested in the solution below. – Christoph Apr 26 at 12:45
  • @Christoph The phantom is also mentioned in the duplicate. – Andrew Swann Apr 26 at 14:21
  • @AndrewSwann: OK, if you understand the problem, you know, the comment at the bottom of the page is crucial ;-) Perhaps it would be good to add that point to the answer below? – Christoph Apr 26 at 14:24
1

Inserting \right.\right. before and \left.\left. seems to help:

\documentclass{article}

\usepackage{mathtools}


\begin{document}

\begin{equation*}
    \begin{aligned}
            \left\| \left(a - c\right) - \frac{|b|^2\cdot |d|^2}{|b \times d|^2} \left[\!\!\!\!\vphantom{\frac{b}{b}}\right.\right.
                                     & \left.\left. \left(\left(a - c\right)\cdot \left(\frac{b}{|b|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{d}{|d|}\right)\right) \cdot \frac{b}{b} \right.\right. + \\
            & \left.\left. \left(\left(a - c\right)\cdot \left(\frac{d}{|d|} - \frac{b \cdot d}{|b|\cdot|d|} \cdot \frac{b}{|b|}\right)\right) \cdot \frac{d}{d} 
            \right] \right\| = \frac{|(a - c) \cdot b \times d|}{|b \times d|}
    \end{aligned}
\end{equation*}

\end{document}

enter image description here

  • Cool, you can even delete the ...{split}! – Christoph Apr 26 at 12:40
2

You don't need to use \left..\right at all, several instances you have do nothing, and others you can specify the sizes via \bigl, \Bigl, \biggl, etc., which do not suffer from problems across line breaks.

Also for a two line split like this multline* is easier.

enter image description here

\documentclass{amsart}

\usepackage{mathtools}

\begin{document}

\begin{multline*}
  \biggl\| (a - c) - \frac{|b|^2\cdot |d|^2}{|b \times d|^2} \biggl[
  \biggl((a - c)\cdot \biggl(\frac{b}{|b|} - \frac{b \cdot
  d}{|b|\cdot|d|} \cdot \frac{d}{|d|}\biggr)\biggr) \cdot \frac{b}{b}
  \\
  + \biggl((a - c)\cdot \biggl(\frac{d}{|d|} - \frac{b \cdot
  d}{|b|\cdot|d|} \cdot \frac{b}{|b|}\biggr)\biggr) \cdot \frac{d}{d}
  \biggr] \biggr\| = \frac{|(a - c) \cdot b \times d|}{|b \times d|}
\end{multline*}

\end{document}

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