# I want to end a proof with a multiline equation

This question is related to placement of QED symbol on numbered equation line but I'm hoping for a cleaner solution.

I want to end a proof with a multiline environment which is numbered (actually, an XYpic diagram) I would like the number to be center-aligned vertically, but the QED box to be at the bottom. I've tried a number of combinations of aligned and gathered with qedhere without particular success, but I feel sure it's possible.

[update: an MWE has been requested. This one isn't quite minimal in that it includes the whole diagram, but the rest of the code is.

\documentclass{article}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[all]{xy}\newdir{ >}{{}*!/-7pt/\dir{>}}
\begin{document}
\begin{proof}
This follows from the commutativity of the bundle square
\begin{gathered}[b] \begin{aligned} \xymatrix@C=1em@R=1.5em{ & G \ar[ddl]_j \ar[d]|{\varkappa \,\circ\, j} \ar[ddr]\ar[drr] & \\ & {}_KG_K \ar[rr]|(.24)\hole \ar'[d][dd] & & BG \ar[dd]^\pi \\ G_K \ar@{ >->}[ru]_\varkappa \ar[rr] \ar[dd]_\chi & & EG \ar[ru] \ar[dd] & \\ & BK \times BK \ar'[r]_(.675){\rho \times\rho}[rr] & & BG \times BG. \\ BK \ar@{ >->}[ru]_(.55){(\mathrm{id},\mathrm{pt})} \ar[rr]_\rho & & BG \ar@{ >->}[ru]_(.55){(\mathrm{id},\mathrm{pt})} & } \\[-\dp\strutbox] \end{aligned} \end{gathered} \qedhere
\end{proof}
\end{document}


As you can see, the equation number and QED box both align with \pi, whereas I'd like the number to align with \pi in the middle and the box to align with BG at the bottom.]

• Please provide an MWE of what you've done so far.
– Mico
Jul 9 '16 at 6:52
• Would you end a proof with a one line numbered equation? Well, it's the same. Jul 9 '16 at 7:13
• @egreg: the desire appears to be a number vertically centered (i.e. following the middle equation) and a box at the end of the bottom equation.
– JPi
Jul 9 '16 at 10:22
• @JPi That's clear, my objection is that it wouldn't be nice. Jul 9 '16 at 10:50
• egreg: For the record, I would not scruple to do exactly that if there were enough room for both the box and the equation number. In a format where equation numbers were left-aligned, I would think it entirely reasonable.
– jdc
Aug 3 '16 at 0:09

You can use the usual placement of the proof's qed symbol, but backup vertically just before:

\documentclass{article}

\usepackage{amsmath,amsthm,amssymb}
\usepackage[all]{xy}\newdir{ >}{{}*!/-7pt/\dir{>}}

\begin{document}

\begin{proof}
This follows from the commutativity of the bundle square
$$\vcenter{ \xymatrix@C=1em@R=1.5em{ & G \ar[ddl]_j \ar[d]|{\varkappa \,\circ\, j} \ar[ddr]\ar[drr] & \\ & {}_KG_K \ar[rr]|(.24)\hole \ar'[d][dd] & & BG \ar[dd]^\pi \\ G_K \ar@{ >->}[ru]_\varkappa \ar[rr] \ar[dd]_\chi & & EG \ar[ru] \ar[dd] & \\ & BK \times BK \ar'[r]_(.675){\rho \times\rho}[rr] & & BG \times BG. \\ BK \ar@{ >->}[ru]_(.55){(\mathrm{id},\mathrm{pt})} \ar[rr]_\rho & & BG \ar@{ >->}[ru]_(.55){(\mathrm{id},\mathrm{pt})} & } }$$

\vspace*{-2\baselineskip}
\end{proof}

Following text.
\end{document}