# autonum, amsmath and \qedhere

I have a weird behavior of the \qedhere command while using amsmath in combination with autonum.

Consider the minimal (not working) example below: In unreferenced equation with \qedhere (Theorem 2) the qed symbol is not shown at all. Not using the autonum package obviously resolves this issue, but then both equations are numbered. Is there a way to get \qedhere working with autonum?

Another (maybe related) problem occurs if the \usepackage{amsmath} - line is commented out. Now the second, unreferenced equation gets the right qed symbol but the referenced equation does not display correctly (the diamond is shown in front of the numbering "(1)" ).

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{autonum}

\declaretheoremstyle[qed=$\diamondsuit$]{myTheorem}
\declaretheorem[style=myTheorem]{theorem}

\begin{document}
Refer to equation \ref{eq:eq1}.
\begin{theorem}
$$\label{eq:eq1} a = b+c \qedhere$$
\end{theorem}

\begin{theorem}
$$a = b+c \qedhere$$
\end{theorem}

\end{document}

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Commented Sep 14, 2013 at 18:53
• Can you explain what you want to achieve? BTW: If I remove \qedhere from both the equations I get the symbol in both the equations. Commented Sep 14, 2013 at 19:00
• The purpose of \qedhere is the usual one: Place the end of proof (or theorem) symbol at the right position if the ambient environment ends with an equation. Without \qedhere the symbol is typeset under the equation and not on the same height. So i want for equation 2 the same behavior as for the first one. Commented Sep 14, 2013 at 19:44
• I think it's not a good idea to use \qedhere with a numbered equation, particularly if the equation numbers are on the right margin. To be honest, I'd be very cautious with ending a proof with an equation. Since you don't know whether your equation will get numbered, just add some words after it to end the proof. Commented Sep 14, 2013 at 19:50
• @egreg It wouldn't be so bad if the equation number was on the left. Commented Nov 22, 2013 at 11:18

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{autonum}

\declaretheoremstyle[qed=$\diamondsuit$]{myTheorem}
\declaretheorem[style=myTheorem]{theorem}

\begin{document}
Refer to equation \ref{eq:eq1}.
\begin{theorem}
$$\label{eq:eq1} a = b+c \qedhere$$
\end{theorem}

\begin{theorem}
$$\pushQED{\qed} a = b+c \qedhere\popQED$$
\end{theorem}

\end{document}


This is not ideal. But it partially allows for the possibility of manual adjusments of theorems ending in equations.