[Tex/LaTex] Wrapping lines of an equation with \left and \right parentheses

equationsformattingwrap

I am having trouble formatting the following mathematical expression:

\begin{align*}
       A  &= \left(\left(\frac{1}{2},\frac{1}{2}\right) + \sqrt{2}Rot_{-\pi/4}\left\langle 0, \frac{1}{2} \right\rangle, \sqrt{2}Rot_{\pi/4}\left\langle 0, \frac{1}{2} \right\rangle \sqrt{2}Rot_{3\pi/4}\left\langle 0, \frac{1}{2} \right\rangle\right)\\
          &=  \left(\left(\frac{1}{2},\frac{1}{2}\right)+ \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & \sin(\pi/4) \\
                             -\sin(\pi/4) & \cos(\pi/4) \end{pmatrix}, \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & -\sin(\pi/4) \\
                             \sin(\pi/4) & \cos(\pi/4) \end{pmatrix}, \sqrt{2}
                           \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}
                           \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}\right)\\
\end{align*}

It gives me the following result:

enter image description here

I would like for the piece that runs off the page to just continue on the next line with a little bit of indentation. I tried to do this with more align symbols, but this fails because whenever I go to break the line, I leave an unmatched \left(.

How can I format this so that the piece of the equation that runs of the page continues onto the next line with a little bit of an indentation?

Thanks for all the help!

Best Answer

Use multline* instead.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  \begin{multline*}
 \left(\left(\frac{1}{2},\frac{1}{2}\right)+ \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & \sin(\pi/4) \\
                             -\sin(\pi/4) & \cos(\pi/4) \end{pmatrix}, \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & -\sin(\pi/4) \\
                             \sin(\pi/4) & \cos(\pi/4) \end{pmatrix},\right.\\
                              \left. \qquad  \sqrt{2}                %% remove \qquad if you want
             \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}
                           \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}\right)\\
\end{multline*}
\end{document}

enter image description here

For the updated query and needs, use mathtools (instead of amsmath) and it multlined environment.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
  \begin{align*}
       A  &= \left(\left(\frac{1}{2},\frac{1}{2}\right) + \sqrt{2}Rot_{-\pi/4}\left\langle 0, \frac{1}{2} \right\rangle, \sqrt{2}Rot_{\pi/4}\left\langle 0, \frac{1}{2} \right\rangle \sqrt{2}Rot_{3\pi/4}\left\langle 0, \frac{1}{2} \right\rangle\right)\\
          &=\!\!
          \begin{multlined}[t]
 \left(\left(\frac{1}{2},\frac{1}{2}\right)+ \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & \sin(\pi/4) \\
                             -\sin(\pi/4) & \cos(\pi/4) \end{pmatrix}, \sqrt{2}
             \begin{pmatrix} \cos(\pi/4) & -\sin(\pi/4) \\
                             \sin(\pi/4) & \cos(\pi/4) \end{pmatrix},\right.\\[\jot]
                              \left. \qquad  \sqrt{2}                %% remove \qquad if you want
             \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}
                           \begin{pmatrix} \cos(3\pi/4) & -\sin(3\pi/4) \\
                             \sin(3\pi/4) & \cos(3\pi/4) \end{pmatrix}\right)\\
\end{multlined}
\end{align*}
\end{document}

enter image description here