Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

The problem with the endmarks in amsthm is a well known issue; the following remark is from the documentation:

Placement of the QED symbol can be problematic if the last part of a proof environment is a displayed equation or list environment or something of that nature. In that case put a \qedhere command at the place where the QED symbol should appear...

So one option is to manually put \qedhere:

\begin{myexample}[This is an example 2]
This is an another example...
\begin{itemize}
  \item And the symbol is on the correct line!\qedhere
\end{itemize}
\end{myexample}

However, you said you don't want to manually use \qedhere, then I am afraid that using amsthm is not the best choice. One option would be to use ntheorem as the back-end for thmtools instead of amsthm, 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 to ntheorem; perhaps Theorem packages: which to use, which conflict? can help you to make a decision.

Here's your example but now using ntheorem:

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

\declaretheoremstyle[
headpunct={},
qed=\ensuremath{\triangle},
bodyfont=\normalfont
]{myexstyle} 
\declaretheorem[style=break]{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 on the correct line!
\end{itemize}
\end{myexample} 

\end{document}

enter image description here

As you can see, the note for the title appears boldfaced; unfortunately, the notefont key for thmtools is not supported with ntheorem, so if you want to change the note font, you will have to add the following to the preamble:

\makeatletter
\renewtheoremstyle{break}%
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
          ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%
  {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont
          ##1\ ##2\ {\normalfont(##3)}\theorem@separator}\hbox{\strut}}}]}
\makeatother
share|improve this answer
    
Ok, I understand now that both amsthm and ntheorem can be used as backend. I have known that already, but forgot after one year. I have also had many problems one year ago. However, I tried again, and thanks to your tips, it really works better then with amsthm. However, one must know that some special is required. For example (as I have seen in your example) declaretheoremstyle can be used, but must be placed directly before each declaretheorem. Usable options are different as well (and much less)! However, after some research I found each option I needed. Thanks! –  Stefe Klauou Sep 5 '12 at 21:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.