muzimuzhi / thmtools

New home for LaTeX package bundle thmtools
LaTeX Project Public License v1.3c
18 stars 3 forks source link

qed option does not work with ntheorem loaded with thmmarks #44

Closed mbertucci47 closed 1 year ago

mbertucci47 commented 1 year ago

In thm-ntheorem.sty, there is

\define@key{thmstyle}{qed}[\qedsymbol]{%
  \@ifpackagewith{ntheorem}{thmmarks}{%
    \theoremsymbol{#1}%
  }{%
    \thmt@notsupported
      {ntheorem without thmmarks option}%
      {headindent}%
    }%
}

So the qed option should work in \declaretheoremstyle as long as ntheorem is loaded with the thmmarks option. However,

\documentclass{article}
\usepackage[thmmarks]{ntheorem}
\usepackage{thmtools}

\declaretheoremstyle[
      qed=\textasteriskcentered
    ]{mystyle}
\declaretheorem[style=mystyle]{styledtheorem}

\begin{document}

\begin{styledtheorem}[Euclid]
   For every prime $p$\dots
\end{styledtheorem}

\end{document}

shows no qed symbol.

P.S. In \thmt@notsupported, "headindent" should be replaced with "qed" (addressed in #46).

mbertucci47 commented 1 year ago

Sorry, this is an ntheorem bug, not a thmtools bug.

\documentclass{article}
\usepackage[thmmarks]{ntheorem}

\theoremsymbol{*}
\newtheorem{example}{Example}

\def\blub{blub}

\begin{document}

\begin{example}
   \dots
\end{example}

\begin{example}
   Not a command
\end{example}

\begin{example}
   \blub
\end{example}

\end{document}

splitargs-1

If the last thing in a theorem environment is a command without arguments, it seems ntheorem suppresses the theorem symbol and adds extra vertical space. If thmtools is loaded, a silly way to fix this is adding

\addtotheoremprefoothook{ }

to the preamble.