[Tex/LaTex] QED – as three letters – to the right of a display equation

amsthmequationssymbols

What is the best way for me to get "QED"–as the three letters, not the square generated by \qed–flush with the right side of a page on the same line as a display equation?

Note – I am intentionally not using the proof environment.

Best Answer

Since this is only for the equation* environment, one can use \displaymath@qed (defined by amsthm); in the following example I \let the command \QED to be \displaymath@qed and used the etoolbox package to redefine \qedsymbol inside equation* to produce the text "Q.E.D." in small caps and using \footnotesize:

\documentclass{article}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{etoolbox}

\makeatletter
\let\QED\displaymath@qed
\makeatother
\AtBeginEnvironment{equation*}{\renewcommand\qedsymbol{{\footnotesize\textsc{q.\,e.\,d.}}}}

\begin{document}

some test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here  test text goes here
\begin{equation*}
a=b + c.\QED
\end{equation*}
some test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here test text goes here  test text goes here

\end{document}

enter image description here