TransWikia.com

How to right align QED at a specific line within align environment? [MWE]

TeX - LaTeX Asked by Heather Guarnera on March 15, 2021

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.

One Answer

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

Correct answer by Sandy G on March 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP