2

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.

Christoph
  • 331

2 Answers2

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}
Andrew Swann
  • 95,762
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