[Tex/LaTex] Left-aligned equations

align

My problems are:

1 the equations in the align environment should be left-aligned (not centered)

2 there should be no vertical space before the align environment

\documentclass{scrbook}
\usepackage{amssymb}
\usepackage{amsmath}
\begin{document}
\underline{Berechnung}
\begin{align*}
    T_{3,-1}(x) &= -4+(-4)\cdot(x-(-1))+\frac{1}{2}\cdot(-8)\cdot(x-(-1))^2+\frac{1}{6}\cdot(-24)\cdot(x-(-1))^3\\
                &= -4-4\cdot(x+1)-4\cdot(x+1)^2-4\cdot(x+1)^3
\end{align*}
\end{document}

Best Answer

You can use flalign environment to get the equations flush with the margin, and the space precedding the flalign can be adusted by changing \abovedisplayskip:

enter image description here

An alternate is to use the aligned environment which yields similar results.

Note:

  • Note the trailing & in the flalign environment. This is needed on at least one of the lines.
  • The adjustment of the \abovedisplayskip was done within a brace group so that subsequent display mode equations are not effected.

Code: flalign:

\documentclass{scrbook}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{showframe}
\begin{document}
\underline{Berechnung}
{\setlength{\abovedisplayskip}{0pt}%
\begin{flalign*}
    T_{3,-1}(x) &= -4+(-4)\cdot(x-(-1))+\frac{1}{2}\cdot(-8)\cdot(x-(-1))^2+\frac{1}{6}\cdot(-24)\cdot(x-(-1))^3 &\\
                &= -4-4\cdot(x+1)-4\cdot(x+1)^2-4\cdot(x+1)^3
\end{flalign*}%
}%
\end{document}

Code: aligned:

\documentclass{scrbook}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{showframe}
\begin{document}
\underline{Berechnung}\par\noindent
$\begin{aligned}
    T_{3,-1}(x) &= -4+(-4)\cdot(x-(-1))+\frac{1}{2}\cdot(-8)\cdot(x-(-1))^2+\frac{1}{6}\cdot(-24)\cdot(x-(-1))^3 &\\
                &= -4-4\cdot(x+1)-4\cdot(x+1)^2-4\cdot(x+1)^3
\end{aligned}$
\end{document}
\end{document}
Related Question