4

This question explains how to center single equations in the enumerate environment, but I'm not sure how to do the same thing with multiple equations (e.g., gather or align).

1 Answers1

4

Also the amsmath environments are using TeX's $$ display equations internally. The latter is using \displaywidth for the width of the equation and \displayindent for the left indentation of the equation. Both can be changed. Thus the following example patches internal amsmath macros to add the settings:

\displaywidth=\textwidth
\displayindent=-\leftskip

Full example:

\documentclass{article}
\usepackage{amsmath}

\usepackage{etoolbox}
\makeatletter
\patchcmd\start@gather{$$}{%
  $$%
  \displaywidth=\textwidth
  \displayindent=-\leftskip
}{}{\errmessage{Cannot patch \string\start@gather}}
\patchcmd\start@align{$$}{%
  $$%
  \displaywidth=\textwidth
  \displayindent=-\leftskip
}{}{\errmessage{Cannot patch \string\start@align}}
\patchcmd\start@multline{$$}{%
  $$%
  \displaywidth=\textwidth
  \displayindent=-\leftskip
}{}{\errmessage{Cannot patch \string\start@multline}}
\patchcmd\mathdisplay{$$}{%
  $$%
  \displaywidth=\textwidth
  \displayindent=-\leftskip
}{}{\errmessage{Cannot patch \string\mathdisplay}}
\makeatother

\begin{document}
\begin{gather}
  A=A
\end{gather}
\begin{enumerate}
\item Hello
  \begin{gather}
    A=A
  \end{gather}
\item Hello
  \begin{align}
    A=A
  \end{align}
\item Hello
  \[
    A=A
  \]
\item Hello
  \begin{equation}
    A=A
  \end{equation}
  \begin{enumerate}
  \item Hello
    \begin{gather}
      A=A
    \end{gather}
  \end{enumerate}
\end{enumerate}
\end{document}   

Result

Heiko Oberdiek
  • 271,626