3

I have an align* environment finishing a proof. The environment has three columns. I tried to place the QED symbol using \qedhere, but the symbol collides with the right column. Is this a bug, or should I proceed in an other way? Any hint toward a solution?

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\begin{document}

\begin{proof}
The $\qedsymbol$ is misplaced.
\begin{align*}
A &= B\\
  &= C & = D\qedhere
\end{align*}
\end{proof}

\end{document}

Example of misplaced qed symbol

I have Texlive 2016, amsmath 2016/03/10 v2.15b and amsthm 2015/03/04 v2.20.2.

2
  • 1
    Why do you need the second & in the second equation? Just remove it.
    – Werner
    Commented Oct 13, 2016 at 17:21
  • Bug. :-( I checked with all TeX Live distributions up to 2012 and it's the same. Add a & in the second line
    – egreg
    Commented Oct 13, 2016 at 17:22

1 Answer 1

2

It's undoubtedly a bug in amsthm; I checked with all TeX Live versions from 2012 on and it's exactly the same.

Workaround: add & somewhere in the affected line: for instance

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\begin{document}

\begin{proof}
The $\qedsymbol$ is misplaced.
\begin{align*}
A &= B \\
  &= C && = D\qedhere
\end{align*}
\end{proof}

\end{document}

enter image description here

Depending on what the column is for you might need

  &= C & = D & \qedhere

(this will provide right alignment for the =D part).

6
  • I wouldn't call it a bug. An align environment expects an & between columns of equations, and this is missing in the example. In fact, If there are no further equations to align with the =D, the last row should probably be &=C=D\qedhere.
    – Dan
    Commented Oct 13, 2016 at 19:27
  • @Dan The & is there. The =D could be a side condition. While I'd prefer left alignment for side conditions, others may think differently.
    – egreg
    Commented Oct 13, 2016 at 19:36
  • Thanks @egreg for your insights. And right the =D is a side comment (in my original example, that I may have oversimplified, there were parentheses around this =D).
    – Bruno
    Commented Oct 13, 2016 at 20:04
  • @egreg In a line like &=C &=D align sees the second & as a separator between two equations and sees the =D as the LEFT side of a second equation (which it surely isn't). Adding or deleting an & makes more sense to me than the given example (side condition or not). Since that also makes \qedhere work, I still don't see this as a bug.
    – Dan
    Commented Oct 13, 2016 at 20:15
  • 1
    Isn't it well-known that k alignment groups require 2k – 1 &?
    – Bernard
    Commented Oct 13, 2016 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .