4

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}
2
  • 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, 2014 at 23:25
  • sorry was being lazy earlier, have added one now. thanks.
    – Arpon
    Dec 31, 2014 at 0:21

1 Answer 1

7

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

3
  • 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.) Dec 31, 2014 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, 2014 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.) Dec 31, 2014 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .