[Tex/LaTex] misplaced qed symbol after displaymath inside item of inline list

enumitemlistsntheoremtheoremsthmtools

My problem involes a qed symbol which appears too early.
My observations are that it happens after a displaymath inside an item of an unboxed inline list.
All of this seems to be necessary to produce the error.

The packages involved are ntheorem, thmtools and enumitem.

If I compile this code with lualatex using TeXLive 2011.

\documentclass{scrreprt}

\PassOptionsToPackage{thmmarks}{ntheorem}
\PassOptionsToPackage{inline}{enumitem}

\usepackage{amsmath,MnSymbol}
\usepackage{ntheorem,thmtools}
\usepackage{
    enumitem,
}

\declaretheoremstyle[qed={\quad\blacksquare}]{plain}
\declaretheorem[style=plain,numbered=no,name=Proof]{proof}%

\begin{document}

\begin{proof}
  \begin{enumerate*}[mode=unboxed]
    \[a\]
    Still proof.
  \end{enumerate*}
\end{proof}

\end{document}

the output becomes:

qed symbol is placed before end of proof

The symbol is placed correctly if the enumerate* environment isn't used or if $$ or \begin{displaymath and \end{displaymath} is used to mark displaymath mode instead of \[ and \].

Clearly, the qed symbol should be at the end of the proof after “Still proof.” – What am I doing wrong? Couldn't find anything so far.

Best Answer

As per my earlier comment ntheorem seems to add the \qed to the very last display mode equation. So a hack is to to end a proof with

\vspace{-\belowdisplayskip}\[\]

enter image description here

Code:

\documentclass{scrreprt}

\PassOptionsToPackage{thmmarks}{ntheorem}
\PassOptionsToPackage{inline}{enumitem}

\usepackage{amsmath,MnSymbol}
\usepackage{ntheorem,thmtools}
\usepackage{
    enumitem,
}

\declaretheoremstyle[qed={\quad\blacksquare}]{plain}
\declaretheorem[style=plain,numbered=no,name=Proof]{proof}%

\begin{document}

\begin{proof}
  \begin{enumerate*}[mode=unboxed]
    \[a\]
    Still proof.
  \end{enumerate*}
  \vspace{-\belowdisplayskip}\[\]
\end{proof}
\end{document}
Related Question