I have a proof which is concluded by a long, multi-line equation. I would like to place the QED right-aligned on the same line as the last line of the equation.

Without \qedhere, I get the desired right-aligned QED, except it's on a new line with undesired vertical space. I tried using \hfill but it didn't appear to do anything.

Here's a MWE.


\newtheorem {lemma}{Lemma}

This is a lemma.
Proof includes a long, multi-line equation.
a &= b \\
  &= c \\
  &= d. \qedhere


enter image description here

How do I right align the QED on the same line as the last line of the equation? Thanks in advance for any insight.

1 Answer 1


The issue is the order the packages are loaded. To get \qedhere to behave properly inside the align* environment, you need to load amsmath before amsthm.


enter image description here

  • 3
    That ordering requirement is documented in the amsthm user guide, but not for amsmath. I've reported that and asked for an update (in due time). May 7, 2020 at 21:00

You must log in to answer this question.

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