In this answer, it is advised to proceed to the following redefinition:
\DeclareRobustCommand{\[}{\begin{equation*}}
\DeclareRobustCommand{\]}{\end{equation*}}
But, as pointed out by the following MCE, this leads to extra vertical spaces.
Do you see how to get rid of these extra spaces?
\documentclass[fleqn]{article}
\usepackage[step=1cm]{pagegrid}
\usepackage[margin=0pt,papersize=2.5cm]{geometry}
%
\usepackage{amsmath}
\usepackage[amsmath,fleqn,thmmarks]{ntheorem}
%
\newcommand{\test}{%
\noindent%
Foo
\[
a=a
\]
Bar
}
%
\begin{document}
\test
%
\DeclareRobustCommand{\[}{\begin{equation*}}%
\DeclareRobustCommand{\]}{\end{equation*}}%
\newpage
\test
\end{document}



thmmarks. – egreg Jun 18 '18 at 12:38