Code: Select all
\begin{document}
\begin{preview}
$\frac{(1+mx)^n-(1+nx)^m}{x^2} = \frac{x^2\left( (\dots)x+ \frac{mn(n-m)}{2} \right)}{x^2} = \left( (\dots)x+ \frac{mn(n-m)}{2}\right) =\frac{mn(n-m)}{2}.$
\end{preview}
\end{document}

As seen, the default alignment is justify. How to set the default alignment in math blocks on the left side?
I know that an alignment usually done by directives align, flalign etc, but I would like to set the default alignment for math-blocks directly, generally.
I'm doing the web generator image formulas for the forum, so it is impossible to know in advance what the expression will be substituted between $ and $. For this reason I can not use align, flalign and other special blocks for alignment.
I tried to do so:
Code: Select all
\begin{document}
\begin{preview}
\begin{flushleft}
$\displaystyle <myexpression>$
\end{flushleft}
\end{preview}
\end{document}
Code: Select all
! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
... l.25 ...shleft}$\displaystyle \sin x+\cos x=1,4 \\
\frac{1 {\sqrt{2}}\sin x+...
?
! Emergency stop.