# Bad math environment delimiter: ntheorem with thmmarks, Display math and split

Using a combination of \usepackage[amsmath,thmmarks]{ntheorem}, display math enclosed in  and a \begin{split} environment inside it, pdflatex freaks out completely:

! LaTeX Error: Bad math environment delimiter.

This is the minimum (non)working example (obviously without theorem definitions, nor with the need to have a split environment there; those are not of the essence in showing the error):

\documentclass{article}
\usepackage{amsmath}
\usepackage[amsmath,thmmarks]{ntheorem}
\begin{document}

$\begin{split} a = b \end{split}$

\end{document}


Also, a workaround is to use \begin{equation*} instead.

EDIT: I guess a question was missing: any ideas what the problem is up there?

-
Page 25 of ntheorem's documentation says: "Naturally, ntheorem.sty will not work correctly in combination with other styles which change the handling of 1. theorem-like environments, or 2. environments concerned with the handling of endmarks, e.g. $...$, eqnarray, etc." –  Gonzalo Medina May 28 '12 at 23:41

The problem is caused by the thmmarks option (if you delete it from your code, the error vanishes); this problem is documented in page 25 of the ntheorem documentation:

Naturally, ntheorem.sty will not work correctly in combination with other styles which change the handling of

1. theorem-like environments, or
2. environments concerned with the handling of endmarks, e.g. $...$, eqnarray, etc."

As you have mentioned, the solution is to use equation*:

\documentclass{article}
\usepackage{amsmath}
\usepackage[amsmath,thmmarks]{ntheorem}
\begin{document}

\begin{equation*}
\begin{split}
a = b
\end{split}
\end{equation*}

\end{document}


One might wonder why equation* works whilst $...$ doesn't if both are equivalent as far as amsmath is concerned; the reason is that ntheorem redefines $ and $ when the thmmarks option is activated and this definition is not compatible with the meaning expected by amsmath's environments.

-