# newenvironment with displaymath causes strange extra space/indent on following line [duplicate]

Possible Duplicate:
Spacing issue for newenvironment wrapper of equation environment

I have

\newenvironment{mymath}{\begin{displaymath}\begin{array}{l}}{\end{array}\end{displaymath}}


but when I write

\begin{mymath}
f(x) = 10
\end{mymath}
and some following text


there is an odd piece of horizontal space inserted before and some following text that is not there if I just write the begin and end commands for the environments out by hand.

-

## marked as duplicate by egreg, Stefan Kottwitz♦Jan 18 '13 at 16:40

add \ignorespacesafterend as the last thing in your end code.