Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
1  
Can you give a minimal working example (MWE) that shows the issue? –  Johannes_B Apr 23 at 16:21
    
@Johannes_B: I can. –  lentic catachresis Apr 23 at 16:25

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Magic. I've no idea how it works but the last one does just what I want. Thanks. –  lentic catachresis Apr 23 at 16:29
1  
@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 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 at 17:51
    
@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 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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