# misplaced qed symbol after displaymath inside item of inline list

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,
}

\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:

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.

-
I also encountered similiar misplacements of the qed symbol in other contexts, but I couldn't reproduce them so far. If I find further such reproduceable misplacements, I'll post them, too. –  k.stm Oct 26 '12 at 16:22
this problem doesn't occur with amsthm. i'm not a user of ntheorem, so you may have other reasons for using it. –  barbara beeton Oct 26 '12 at 16:36
@barbarabeeton I use it to define certain theoremstyles. Maybe I can switch. But this, of course, still wouldn't really solve this particular problem. –  k.stm Oct 26 '12 at 16:51
in the ams author faq, there's a question that deals with qed and other symbols in "nonstandard" places in and out of proofs, by reference to a linked example file. it's specific to amsthm, but maybe it would give you some ideas. sorry i can't help with ntheorem. –  barbara beeton Oct 26 '12 at 17:04
ntheorem seems to add the \qed to the last display mode equation. So, a hackish solution would be to end the proof with \vspace{-\belowdisplayskip}. –  Peter Grill Oct 26 '12 at 21:06
show 1 more comment

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}


## Code:

\documentclass{scrreprt}

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

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

\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}

-
I accepted the answer even though it is – as you said yourself – merely a hackish solution. I personally just switched to using the displaymath-environment. But thanks anyway! –  k.stm Aug 25 '13 at 8:13