Goal: I want to be able to mark the end of examples and exercises using some sort of symbol, much as $\qedsymbol$ marks the end of proofs. In particular, I want a command that acts like \qedhere for my symbol of choice.
Background: This is in fact one of the potential modifications listed in the amsthm package documentation: to "extend applicability of \qedhere to theorem-class elements as well as to proofs." They say that while this has merit, it requires more work and is essentially on the back burner.
My attempt:
The way I have attempted to implement an exercise environment with its own end-symbol is as follows:
\documentclass{memoir}
\usepackage{amsthm}
\usepackage[varg,bigdelims]{newpxmath}
\usepackage{ifthen}
\newcounter{madesymbol}
\newtheorem{exc}{Exercise}
\newcounter{exc-counter}
\newenvironment{exercise}[1][]
{
\begin{exc}[#1]~
\def\mysymbol{$\lozenge$}
\setcounter{madesymbol}{0}
\def\tagsymbol{\stepcounter{madesymbol}\tag*{\mysymbol}}
}
{
\ifthenelse{\equal{\value{madesymbol}}{0}}{\hspace*{\fill}\mysymbol}{}
\end{exc}
\stepcounter{exc-counter}
}
\begin{document}
\begin{exercise}
A function $f$...
\end{exercise}
\end{document}
This feels bulky, and I'm looking for a better solution.
Problems with ntheorem: One suggestion I have seen is the ntheorem package. I have tried ntheorem, but it seems to change "everything", e.g. not act at all like amsthm (even with the [amsthm] option loaded). If someone suggests I use this package, please give explicit code for making it act as much like amsthm as possible.
\lozenge
?