# End of theorem marker placement

I have a question about marker placement after theorems. I am using a style file provided by Oxford University Press, which I am not used to. It is available here:

http://www.oxfordjournals.org/our_journals/imrn/for_authors/tex_template.zip

This style file wants to put an \openbox at the end of the statement of each theorem, and a \filledbox at the end of every proof.

If one concludes a proof with an equation, I know to use \qedhere to position the end of proof marker correctly. But I don't know how to do something similar in the above situation (after the statement of a theorem). Many of the thoerems, propositions etc. end with equations, and if I use the above style sheet the box is placed too low.

How do I fix this?

-
Did you try using the \qedhere command? If so, what are the results? – Willie Wong Oct 5 '10 at 23:59
(Also, if you are submitting to IMRN, why not just let the publisher/copyeditor worry about it?) – Willie Wong Oct 6 '10 at 0:00
I tried using \qedhere, but it puts a black box, rather than a white box, at the desired spot! You are right that I should just let the publisher deal with it, but it is really annoying me (and makes the document more difficult to read). – geordie Oct 6 '10 at 8:44
I should also mention that when I use \qedhere the white box is replaced by the black box, so it is almost the right thing to do. – geordie Oct 6 '10 at 8:44

You can redefine \qedsymbol just before using \qedhere as in:

\begin{proposition}
This is a funny equation
\begin{equation*}
a = b + c\,. \let\qedsymbol\openbox\qedhere
\end{equation*}
\end{proposition}

I don't know if it is possible, but you could maybe also suggest the people from the journal to fix their class file so that \qedhere works as expected?

-
thanks ... this works very nicely. Willie Wong's suggestion below also works, but the alignment is better with the above option. (That is, it is right aligned as it should be, not just next to the final equation etc.) – geordie Oct 9 '10 at 23:08
this is all very well, but it only works if equation numbers are on the right side of the page. the ams document class default is for equation numbers on the left, so simply dropping the qed box into the equation number position doesn't work. that's why the definition of \qedhere in amsthm is so complicated. more comments on other answers. – barbara beeton Jan 6 '11 at 17:52
@barbara, thanks for your comment! I've checked the link you posted below and indeed it looks very useful. If you could craft a short new answer pointing to the link and with a small example that would be great! – Juan A. Navarro Jan 7 '11 at 11:37

Try this: in the math environment, put the \qedhere command inside of an \mbox, as in

$.... some numbers and equation. \mbox{\qedhere}$

it won't work completely correctly, but now the mark inserted is the openbox, and not the filled box. I think this is a bug with amsthm (see below the cut), so you'd be best off just leaving well-enough alone and let the journal deal with it later.

The oupau class apparently uses amsthm and not ntheorem for its theorem needs. And this is how it defines the open-box symbol for the QED in the theorem environment:

\providecommand{\qedsymbolthm}{\openbox}
\DeclareRobustCommand{\qedthm}{%
\ifmmode \mathqed
\else
\leavevmode\unskip\penalty9999 \hbox{}\nobreak\hfill
\fi
}
\def\@begintheorem#1#2[#3]{%
\@ifempty{#1}{\let\thmname\@gobble}{\let\thmname\@iden}%
\@ifempty{#2}{\let\thmnumber\@gobble}{\let\thmnumber\@iden}%
\@ifempty{#3}{\let\thmnote\@gobble}{\let\thmnote\@iden}%
}%
\ignorespaces}
\def\@endtheorem{\popQED\endtrivlist\@endpefalse }

I don't think the problem is actually with Oxford University Press! I think the problem lies in amsthm! See the definition there for \qedhere

\newcommand{\qedhere}{%
\begingroup \let\mathqed\math@qedhere
\let\qed@elt\setQED@elt \QED@stack\relax\relax \endgroup
}

and the definition for the proof environment

\providecommand{\qedsymbol}{\openbox}%
\newenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6\p@\@plus6\p@\relax
\trivlist
\item[\hskip\labelsep
\itshape
}{%
\popQED\endtrivlist\@endpefalse
}

I'm thinking that the pushQED and popQED commands are defined just so they can accomodate different end symbols! The problem, apparently, lies in the definition of \qedhere, which calls \math@qedhere when it sits in a math environment. And unfortunately, instead of the definitions used in \setQED@elt (which is called in text mode), which process the current qed symbol that's in the QED stack, \math@qedhere depends on