I'm trying to write equations on multiple lines using \displaystyle
. I can use \\
for line breaks but can't align or put horizontal space on the second line.
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\begin{document}
\begin{itemize}
\item $\displaystyle
(n+1)^2+5(n+1)+1 = n^2+2n+1+5n+5+1 \\
%\hspace{4em}
%%&
%\quad
= n^2+7n+7
$
\end{itemize}
\end{document}
Note that the equation is in-line and should start at the bullet point. I have made several attempts to indent the second line but the output always looks like
(Note that this is a MWE - the actual equation I'm typesetting is more complicated.) Is there a way to align the two lines of the equation at the =
sign? This is indicated by the red arrow in the picture.
align
environment ;-)\begin{align} (n+1)^2+5(n+1)+1 &= n^2+2n+1+5n+5+1 \\ &= n^2+7n+7 \end{align}
and its variantsalignat
andaligned
etc. – user31729 Feb 6 '19 at 9:39aligned
as well ... – user31729 Feb 6 '19 at 9:42