5

I know there is a myriad of questions about the alignment of the tombstone symbol, but I couldn't see any one that addresses this little issue.

Say you end your proof with a diagram such as the following:

\[\xymatrix{A & B \\ C & D} \]

Then the little tombstone symbol will be way one line further down from where it should be. If I add \qedhere just after the diagram, then the tombstone is aligned with the B in the diagram, which is just wrong.

How do I get it right?

MWE:

\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage[all,cmtip,2cell]{xy}
\newtheorem{theorem}{Theorem}

\begin{document}
\begin{theorem} A theorem.
\begin{proof}
\[\xymatrix{A & B \\ C & D} \]
\end{proof}
\end{theorem}

\begin{theorem} A theorem.
\begin{proof}
\[\xymatrix{A & B \\ C & D} \qedhere \]
\end{proof}
\end{theorem}


\end{document}
6

Three possible styles:

\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage[all,cmtip]{xy}
\begin{document}
\begin{proof}
\[
\xymatrix{A & B \\ C & D} \qedhere
\]
\end{proof}
\begin{proof}
\[
\begin{gathered}
\xymatrix{A & B \\ C & D}\\
\end{gathered}
\qedhere
\]
\end{proof}
\begin{proof}
\[
\begin{gathered}[b]
\xymatrix{A & B \\ C & D}\\[-\dp\strutbox]
\end{gathered}
\qedhere
\]
\end{proof}
\end{document}

enter image description here

In the last one, the adjustment may depend on what's in the bottom row of the diagram.

  • Magic. I've no idea how it works but the last one does just what I want. Thanks. – Bruno Stonek Apr 23 '14 at 16:29
  • 2
    @BrunoStonek I use \begin{gathered}[b] that sets the reference point at the bottom row of itself; however, I have to use a fake second row, which is empty, which \qedhere uses for the reference point; but some adjustment has to be made, because each cell in the \xymatrix has a \strut in it, so I backup by its depth. – egreg Apr 23 '14 at 16:32
  • @egreg: Makes me wonder why amongst the myriad of theorem packages, no-one seems to have tried a zero-height line with a smashed tombstone at the end, but that would probably put the tombstone even further down than your third variant. – Ulrich Schwarz Apr 23 '14 at 17:51
  • 1
    @UlrichSchwarz “There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy”: what about a last line almost full, with the smashed tombstone overlapping with text? ;-) – egreg Apr 23 '14 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.