3

I have equations inside an environment which has a larger left-margin than the main text (analogous to an enumerate/itemize environment, implemented with the changepage package's adjustwidth environment). Just as equations in enumerate/itemize behave, the equations are centered with respect to the entire text, rather than just the width of the container environment. I want the latter behavior.

I'm trying to accomplish this by wrapping all display-math in minipages. Namely, I'm modifying the mathdisplay environment in amsmath.sty as follows:

\makeatletter
\let\oldmd\mathdisplay
\def\mathdisplay#1{%
  \newline
  \begin{minipage}{\textwidth-\@totalleftmargin}%
    \oldmd{#1}%
}
\let\oldendmd\endmathdisplay
\def\endmathdisplay#1{%
  \oldendmd{#1}%
  \end{minipage}
}
\makeatother

This is almost working, but there are some issues with spacing which I don't understand how to fix. Here's how the the normal \[ ... \] and numbered \begin{equation} ... \end{equation} look with the above modification:

unnumbered

numbered

My main confusion is why the numbered version is behaving so differently from the unnumbered. But all in all I want to fix this so that the spacing above and below is even as it usually is. Any help is appreciated, thanks.

Edit: Here's a compilable example:

\documentclass{amsart}

\usepackage{lipsum}
\usepackage{calc}
\usepackage{changepage}

\makeatletter
\let\oldmd\mathdisplay
\def\mathdisplay#1{%
  \newline
  \begin{minipage}{\textwidth-\@totalleftmargin}%
    \oldmd{#1}%
}
\let\oldendmd\endmathdisplay
\def\endmathdisplay#1{%
  \oldendmd{#1}%
  \end{minipage}
}
\makeatother

\setlength{\parindent}{0pt}

\begin{document}

\lipsum[1]

\begin{adjustwidth}{20pt}{}
\lipsum[2]
\[
x \mapsto \hom(-,x)
\]

\lipsum[3]
\begin{equation}
  y \mapsto \hom(y,-)
\end{equation}
\lipsum[4]
\end{adjustwidth}

\lipsum[5]

\end{document}
  • 1
    Welcome to TeX.SX! Can you make a compilable example that reproduces the issue? It's important to know what documentclass and what options to it you're using. – egreg Dec 30 '14 at 23:25
  • sorry was being lazy earlier, have added one now. thanks. – Arpon Dec 31 '14 at 0:21
5

The amsart class makes the precise choice of always centering displays with respect to the overall margins, even in lists where the left margin is shifted.

Your redefinition of mathdisplay has several defects, as you realized.

The solution is simpler: remove \fullwidthdisplay from \everydisplay. I added also an align environment to show that it works, too.

\documentclass{amsart}

\usepackage{lipsum}
\usepackage{calc}
\usepackage{changepage}

\renewcommand{\fullwidthdisplay}{}

\begin{document}
\lipsum[1]

\begin{adjustwidth}{20pt}{}
\lipsum*[2]
\begin{align}
x &\mapsto \hom(-,x)\\
z &\mapsto \hom(z,-)
\end{align}
\lipsum*[3]
\begin{equation}
  y \mapsto \hom(y,-)
\end{equation}
\lipsum[4]
\end{adjustwidth}

\lipsum[5]

\end{document}

enter image description here

  • one "justification" for this decision is that, with equation numbers on the left, narrowing the display width results in such an equation number being indented, and thus more difficult to locate. (equation numbers on the left do not interfere with qed boxes when the last line of a proof is a numbered display.) – barbara beeton Dec 31 '14 at 16:43
  • @barbarabeeton I understand the rationale behind AMS style; however I'm against equation numbers on the left mainly because they behave badly with lists (and also against ending proofs with a numbered equation). – egreg Dec 31 '14 at 16:47
  • just wanted to put out a public explanation; i don't think this is documented anywhere. i agree that ending proofs with a numbered equation isn't a good practice, but we're up against a random collection of authors who either don't agree, or haven't been taught "good practices". in any event, equation numbers on the left is an ams style of long standing, going 'way back to 1900. (i checked.) – barbara beeton Dec 31 '14 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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