3

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.

6
  • 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, 2012 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. Oct 26, 2012 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, 2012 at 16:51
  • 2
    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}\[\]. Oct 26, 2012 at 21:06
  • 1
    This seems a bug of ntheorem that should be reported.
    – egreg
    Mar 2, 2013 at 22:55

2 Answers 2

5

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}
1
  • 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, 2013 at 8:13
2

The problem is due to the use of the enumitem package.

Ntheorem supports a finite set of standard LaTeX environments. The algorithm consists of modifications to these environments to trace where the end mark belongs (for the implementation, see its documentation).

As there are dozens of packages that define own environments, it is not possible to support all of them.

1
  • 1
    Welcome to TeX.SX! Are you considering to register your account?
    – egreg
    Aug 25, 2013 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .