# Equation left margin

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 $$...$$ look with the above modification:

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]

\lipsum[2]
$x \mapsto \hom(-,x)$

\lipsum[3]
$$y \mapsto \hom(y,-)$$
\lipsum[4]

\lipsum[5]

\end{document}

• 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

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]

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