[Tex/LaTex] Indenting equations

amsmathindentation

I'm using amsmath[fleqn] but I'd like to also indent equations outside equation/align/gather environments. A natural choice would be to indent using the same length amsmath uses, but I don't know how to do that. I've tried to use \mathindent (without defining its value) but it gives a "missing number" error. How should I do this? Thanks

Best Answer

\mathindent holds a length, so to "use it", it would have to be done as \hspace{\mathindent}, say. Here's perhaps an example of what might be of interest:

enter image description here

\documentclass{article}
\usepackage[fleqn]{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Some text before the equation.
\begin{equation}
  f(x) = ax^2 + bx + c
\end{equation}
Some text after the equation.

\hspace*{\dimexpr\mathindent-\parindent}$f(x) = ax^2 + bx + c$

Some more text before an equation.
\[
  f(x) = ax^2 + bx + c
\]
Some more text after an equation.
\end{document}

Note that unnumbered equations are possible without the need for manual indentation. You could just use the starred version of align, say.

Related Question