# Indentation of left-aligned equations (flalign) without fleqn

I would like to have some math not centered but left aligned. So I found on this site various answers that pointed me to this:

\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\begin{document}
\begin{flalign*}
1+1=2  &&
\end{flalign*}
\end{document}


However I also would like the left aligned math to be indented by \parindent, how could I do that without loading fleqn as a general option?

-
Welcome to TeX.SX! –  Claudio Fiandrino Dec 7 '13 at 13:25
Is there any reason for not using the option fleqn? –  Ch'en Meng Dec 7 '13 at 13:31
@Ch'enMeng because only some math should be left aligned, not all. –  BeeGirl Dec 7 '13 at 13:37
@HenriMenke that is not the same issue since the OP is using fleqn, while I said I don't want to –  BeeGirl Dec 7 '13 at 13:54
@Closers this question is different from the one linked as a duplicate since here the OP wants both centered and left-aligned equations. –  karlkoeller Dec 7 '13 at 15:41

# Remarks

You can indent your flalign by using the definition of flalignfrom amsmath.sty and modifiying it to your liking, e.g. inserting \hskip\parindent.

# Implementation

\documentclass{article}
\pagestyle{empty} % for cropping
\newcommand\shortlipsum{
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.\par
} % Filltext
\usepackage{amsmath}
\makeatletter
\newenvironment{shiftedflalign}{%
\start@align\tw@\st@rredfalse\m@ne%
\hskip\parindent
}{%
\endalign
}
\newenvironment{shiftedflalign*}{%
\start@align\tw@\st@rredtrue\m@ne
\hskip\parindent
}{%
\endalign
}
\makeatother
\begin{document}

\shortlipsum
\begin{flalign}
1+1=2  &&
\end{flalign}
\shortlipsum
\moveright\parindent\vbox{%
\begin{flalign}
1+1=2  &&
\end{flalign}
}
\shortlipsum
\begin{shiftedflalign}
1+1=2  &&
\end{shiftedflalign}
\shortlipsum

\begin{flalign*}
1+1=2  &&
\end{flalign*}
\shortlipsum
\begin{shiftedflalign*}
1+1=2  &&
\end{shiftedflalign*}
\shortlipsum

\end{document}


# Output

-
ok, this is it. Could you point out to a question that describes the differences between the various math environments? Also a resource online, not necessarily on this site. Thanks –  BeeGirl Dec 7 '13 at 15:14
@BeeGirl The mathmode manual by Herbert Voß describes all the important things. –  Henri Menke Dec 7 '13 at 16:08
@HenriMenke Can you remove the superfluous % in \newenvironment{shiftedflalign}? It caused me to question why that was not in \newenvironment{shiftedflalign*}. –  Sean Leather Jun 25 at 9:23
As an aside, you can use \mathindent (see LaTeX/Advanced Mathematics) instead of \parindent to get the normal indentation used by fleqn. –  Sean Leather Jun 25 at 9:26

A very simple method.

We define a new command

\newcommand{\mathleft}{\@fleqntrue\@mathmargin\parindent}


to simulate the option fleqn with \parindent indenting, and a new command to restore the normal behavior

\newcommand{\mathcenter}{\@fleqnfalse}


So, add the following lines in the preamble

\makeatletter
\newcommand{\mathleft}{\@fleqntrue\@mathmargin\parindent}
\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother


and issue \mathleft before and \mathcenter after the math stuff you want left aligned with \parindent.

You can use this solution with all math environments without redefining any of them.

MWE

\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}

\makeatletter
\newcommand{\mathleft}{\@fleqntrue\@mathmargin\parindent}
\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother

\begin{document}

\mathleft
$$1+1=2$$
\mathcenter

Indented paragraph

$$1+1=2$$

Indented paragraph

\end{document}


Output

-
this works also, thanks –  BeeGirl Dec 7 '13 at 16:07