7

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.

\documentclass{report}
\usepackage{amssymb,amsthm,amsmath}

\newtheorem {lemma}{Lemma}
\begin{document}

\begin{lemma}
This is a lemma.
\end{lemma}
\begin{proof}
Proof includes a long, multi-line equation.
\begin{align*}
a &= b \\
  &= c \\
  &= d. \qedhere
\end{align*}
\end{proof}

\end{document}

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

15

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.

\usepackage{amssymb,amsmath,amsthm}

enter image description here

1
  • 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 .