I want to use the thmtools
package, because it provides some awesome features for declaring environments (proofs, theorems, examples etc.)
And I especially like the "qed" feature which places some nice symbols like the q.e.d. square at the end of the environments. For example, I am using different symbols for different environments.
However, there are some issues, if I use special blocks (itemize, align) at the end of such an environment. The "qed" symbol is too low and much space is wasted.
Test the following example:
\documentclass{book}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheoremstyle[headpunct=\\*,qed=\ensuremath{\triangle}]{myexstyle}
\declaretheorem[style=myexstyle]{myexample}
\begin{document}
\begin{myexample}[This is an example 1]
This is an example...
And the symbol is on the correct line!
\end{myexample}
\begin{myexample}[This is an example 2]
This is an another example...
\begin{itemize}
\item And the symbol is \emph{not} on the correct line!
\end{itemize}
\end{myexample}
\end{document}
I want that the \triangle
is shown on the same line as the last \item
.
I already fixed that problem for align
environments (I am using package adjustbox
und aligned
now), but I cannot solve the problem, if I want to use itemize
the way shown.
I think that I also know the reason for the problem. \end{itemize}
ends the paragraph and a new paragraph must be started in order to place the "qed" symbol.
Is there an option? A Workaround? Preferably without \qedhere
or manual adjustments for each environment! I was also wondering if package enumitem
(or another one) could be helpful with any kind of option?
Best Answer
The problem with the endmarks in
amsthm
is a well known issue; the following remark is from the documentation:So one option is to manually put
\qedhere
:However, you said you don't want to manually use
\qedhere
, then I am afraid that usingamsthm
is not the best choice. One option would be to usentheorem
as the back-end forthmtools
instead ofamsthm
, since the former solves the problem of setting endmarks of theorem-like environments automatically at the right positions (even if the environment ends with a displaymath or list environment).Now, you have to make a choice: either you stick to
amsthm
and accept having to manually put\qedhere
under some circumstances, or you switch tontheorem
; perhaps Theorem packages: which to use, which conflict? can help you to make a decision.Here's your example but now using
ntheorem
:As you can see, the note for the title appears boldfaced; unfortunately, the
notefont
key forthmtools
is not supported withntheorem
, so if you want to change the note font, you will have to add the following to the preamble: