Say I have a short line and a split long line, both of which I wish to left-justify, while also aligning the long line at the equals sign.
The following code…
\documentclass[oneside,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
&f(x)=x^2-x-1\\
&g(x)=\frac{1}{2}-x\\
\begin{split}
(f\circ g)&=f(g(x))=f(\frac{1}{2}-x)=(\frac{1}{2}-x)^2-(\frac{1}{2}-x)-1\\
&= \frac{1}{4}-x+x^2-\frac{1}{2}+x-1
\end{split}
\end{align*}
\end{document}
Gives the following result…
The third and fourth line are properly aligned, but they're not left-justified with the first and second, which is what I'm trying to accomplish.
Best Answer
If you need to economize on (vertical) space, I suggest you use two nested
aligned
environments inside\[ ... \]
rather than nest analigned
environment inside analign*
environment. I would also argue that replacing all instances of\frac
with\tfrac
not only economizes on vertical space even more, it also helps establish more of a visual balance between the various quadratic, linear, and constant terms.A final remark: I can't help but note that using nested
aligned
environments does not do all that much to enhance appearance. A singlealigned
environment, with all five rows aligned on the first=
symbols per row, would work just as well -- if not even a bit better...