1

I want my theorems be ended by a diamond. It works fine, except when there is an equation at the end, then the diamond is in a new, empty line. With the following MWE, I get this: this here

Here is my MWE:

\documentclass[ngerman, fontsize=11pt, DIV=15, BCOR = 10mm,parskip=half-, twoside]{scrbook}
\usepackage{babel}
\newcommand{\thmend}{\hfill\mbox{$\diamond$}}
\usepackage{cleveref}
\crefname{thm}{Theorem}{Theorems}
\newtheorem{thm}{Theorem}


\begin{document}
    \begin{thm}
        This works fince because it's in one line. \thmend
    \end{thm}
    
    \begin{thm}
        This does not work because:
        \[
        1+2=3 
        \]\thmend
    \end{thm}
\end{document}

If I set \thmend right after the equation, the diamond comes right after the 3 and not at the end of the line.

1 Answer 1

2

You could use thmtools to create a new style for theorems including a "QED symbol". This allows to use \qedhere in theorems to place the symbol in equations, for example.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheoremstyle[qed=$\diamond$]{thm}
\declaretheorem[style=thm, name=Theorem]{thm}
\begin{document}
    \begin{thm}
        This works fince because it's in one line.
    \end{thm}
    
    \begin{thm}
        This does not work because:
        \[
        1+2=3 \qedhere
        \]
    \end{thm}
\end{document}
3
  • Such a nice suggestion.
    – MadyYuvi
    Mar 7 at 15:23
  • This works, thank you! Can you yet tell me how I can link the counter I already used? Something like \declaretheoremstyle[qed=$\diamond$]{thm} \declaretheorem[style=thm, name=Theorem]{Theorem}[Iamthecounter] Mar 7 at 15:34
  • 1
    @mathquester you can use the key numberlike=counter in the options of \declaretheorem. There are more details in the manual of thmtools.
    – Vincent
    Mar 7 at 15:37

You must log in to answer this question.

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