If I have a theorem environment which uses a QED symbol, and I put a verbatim block at the end of such a theorem, then the QED symbol gets put on a new line below, creating extra space. Is there a way to define a macro similar to \qedhere
but which places the symbol at the end of the line above, and so doesn't create an extra line just for the symbol?
MWE:
\documentclass{article}
\usepackage{amsthm}
\begin{document}
\begin{proof}
For example:
\begin{verbatim}
Some code.
\end{verbatim}
\qedhere
\end{proof}
\end{document}
Edit: This suggests \par\vspace{-1.7\baselineskip}\qedhere
, which sort of works, but there's a "magic" value of 1.7 that needs adjusting, and the QED symbol can still be put on the next page.