Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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).

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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

share|improve this answer
    
Is there a way to disable these commands for a single list, while leaving them active for the rest of the document? –  fctaylor25 yesterday
    
@fctaylor25 Then the redefinitions and the list should go into a local group between \begingroup and \endgroup. –  Heiko Oberdiek yesterday

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.