# Left-align math with fleqn inside split environment

Below, how would I move the first math-line left so that a^2 left-aligns with where?

\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\setlength{\parindent}{0pt}

Some text
\begin{split} a^2+\lambda_\phi=\phi\\ \begin{aligned} \text{where\qquad} a &= \pm \sqrt{1-\cos^2\theta} \\ \lambda_\phi &= \cos\theta\cos\phi - \sin\theta\sin\phi \end{aligned} \end{split}
Some more text

\end{document}


You need to add appropriate alignment points &.

\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\setlength{\parindent}{0pt}

Some text
\begin{split} &a^2+\lambda_\phi=\phi\\ &\begin{aligned} \text{where\qquad} a &= \pm \sqrt{1-\cos^2\theta} \\ \lambda_\phi &= \cos\theta\cos\phi - \sin\theta\sin\phi \end{aligned} \end{split}
Some more text

\end{document}


Additionally if you are using a version of amsmath from before 2017, the aligned starts with a thinspace, so you need to compensate with a negative thin space \!, i.e. writing

&\!\begin{aligned}


instead of just &\begin{aligned}.

• the \! is not needed after the 2017 amsmath release (finally;-) – David Carlisle Mar 20 '17 at 21:58

Without PSTricks.

\documentclass[preview,border=12pt]{standalone}
\usepackage[fleqn]{amsmath}
\begin{document}
\setlength{\parindent}{0pt}

Some text
\! \begin{aligned} &a^2+\lambda_\phi=\phi\\ &\text{where}\ \! \begin{aligned}[t] a &= \pm \sqrt{1-\cos^2\theta} \\ \lambda_\phi &= \cos\theta\cos\phi - \sin\theta\sin\phi \end{aligned} \end{aligned}
Some more text

\end{document}

• What's the \! stuff doing? It's a little hard to google for... – Ken Williams Jan 31 '18 at 21:27
\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}
\setlength{\parindent}{0pt}

Some text

\begin{split} \begin{aligned} a^2+\lambda_\phi=\phi\\ \text{where\qquad} a &= \pm \sqrt{1-\cos^2\theta} \\ \lambda_\phi &= \cos\theta\cos\phi - \sin\theta\sin\phi \end{aligned} \end{split}
Some more text


Or :-)

{\arraycolsep0.6pt
$$\begin{array}{lrl} \multicolumn{3}{l} {a^2+\lambda_\phi=\phi}\\ \mbox{where\qquad}& a &{}= \pm \sqrt{1-\cos^2\theta} \\ & \lambda_\phi &{}= \cos\theta\cos\phi - \sin\theta\sin\phi \end{array}$$}
\end{document}


• Thanks. But it won't work if the first line is just a bit longer. The alignment is also not 100% – st12 Apr 22 '13 at 19:10