Can I tab inside of align environment?
Just add suitable phantoms:
\documentclass[a4paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amssymb, amsmath}
\begin{document}
\begin{align}
f_1(x) &= a \left (x - \frac{b}{3a} \right )^3 + b \left (x-\frac{b}{3a} \right )^2
+ c \left (x-\frac{b}{3a} \right ) + d\\
&= a \left (x^3 - 3 \frac{b}{3a}x^2 + 3 (\frac{b}{3a})^2 x
- \frac{b^3}{27a^3} \right )
+b \left (x^2 - \frac{2b}{3a} x + \frac{b^2}{9a^2} \right )
+c x - \frac{bc}{3a} + d\\
&= ax^3 - bx^2 + \frac{b^2}{3a}x - \frac{b^3}{27 a^2}\\
&\hphantom{{}=ax^3}+ bx^2 - \frac{2b^2}{3a}x + \frac{b^3}{9a^2}\\
&\hphantom{{}=ax^3-bx^2} + c x - \frac{bc}{3a} + d\\
&= ax^3 + \frac{b^2}{3a} (1-2+c)x + \frac{b^3}{9a^2} \left (1-\frac{1}{3} \right )
- \frac{bc}{3a} + d
\end{align}
\end{document}
In this solution, I used the tabstackengine
package which is now available at http://ctan.org/pkg/tabstackengine.
The package introduces tabbing to the existing features of the stackengine
package.
So, in this example, I replace the three lines requiring further tabbing with a \tabbedShortstack
. I used the default interline gap which is 3pt, but that can be changed with \setstackgap{S}{length}
. Also, what showed as three separate equations (3)-(5) in the original should, I think, be only a single equation.
I should also point out that, in tabstackengine
, the default tabbing character is &
and the default end-of-line character is \\
, but that I had to reset those as to not conflict within the align
environment.
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage{tabstackengine}
\setstackEOL{@}
\setstackTAB{*}
\stackMath
\begin{document}
\begin{align}
f_1(x) &= a \left (x - \frac{b}{3a} \right )^3 + b \left (x-\frac{b}{3a} \right )^2 + c \left (x-\frac{b}{3a} \right ) + d\\
&= a \left (x^3 - 3 \frac{b}{3a}x^2 + 3 (\frac{b}{3a})^2 x - \frac{b^3}{27a^3} \right )
+b \left (x^2 - \frac{2b}{3a} x + \frac{b^2}{9a^2} \right )
+c x - \frac{bc}{3a} + d\\
&\tabbedShortstack{%
= ax^3 *- bx^2 *+ \dfrac{b^2}{3a}x - \dfrac{b^3}{27 a^2}@
* + bx^2 *- \dfrac{2b^2}{3a}x + \dfrac{b^3}{9a^2}@
**+ c x - \dfrac{bc}{3a} + d%
}\\
&= ax^3 + \frac{b^2}{3a}\left (1-2+c \right )x + \frac{b^3}{9a^2} \left (1-\frac{1}{3} \right )- \frac{bc}{3a} + d
\end{align}
\end{document}
Just for edification regarding the tabstackengine
package, some of its commands include