# How to put an ending sign within equation for theorem-alike environments? [duplicate]

Thanks to an answer to my question asked here, I used the following codes to generate for each theorem-alike environment exactly one square symbol as the ending sign:

\documentclass[12pt]{amsart}
\usepackage{manfnt}
\makeatletter
\renewcommand\@endtheorem{\vvv@endmarker\endtrivlist\@endpefalse}
\newcommand\vvv@endmarker{%
{\unskip\nobreak\hfil\penalty50
\parfillskip=0pt \finalhyphendemerits=0 \par
\penalty 10000 \parskip=0pt\noindent}\ignorespaces}
\makeatother
\newtheorem{thm}{Theorem}

\begin{document}
\title[]{Title}
\author[]{Author}

\maketitle

\section{Proofs}
... The above argument proves the following theorem:
\begin{thm}
There are infinitely many integers $x, y, z > 0$ such that
$x^{2} + y^{2} = z^{2}.$
\end{thm}

\end{document}


However, how do I make the square symbol, the ending sign, lie within the displayed equation? I tried \qedhere but nothing happened.

## marked as duplicate by Mico math-mode StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 29 '15 at 6:57

• You're apparently not using the second method @egreg provided in his answer to your earlier query. Is there something about the \newmarkedtheorem method that's not working for you? – Mico May 29 '15 at 6:26