How can I automatically append a symbol to an asmthm environment?

I recently got attached to the idea of finishing definitions, remarks, and observations with something “dual” to qed as appended to \proof environments – I currently define \newcommand{\fin}{\hfill\blacklozenge} and append this manually.

Is there any way to modify my \newtheorem{obs}[theorem]{Observation} declaration to automatically append \fin?

You could use the etoolbox package to append the \fin command to the end of the obs environment.

\documentclass{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{etoolbox}
\newcommand{\fin}{\hfill\ensuremath{\blacklozenge}}
\newtheorem{obs}{Observation}
\AtEndEnvironment{obs}{\fin}
\begin{document}
\begin{obs}
Test observation.
\end{obs}
\end{document}
• No, if the \hfill is chosen as a line break point, the lozenge will be typeset at the beginning of the next line. A \strut does nothing to prevent the problem. – egreg Jan 6 at 16:50
• Oh, thanks for pointing it out, I corrected my answer. I had made a test and it worked, so I thought it would solve the problem. I guess I have just been lucky with the placement of the line break. – Vincent Jan 6 at 16:58