[Tex/LaTex] LyX — QED symbol same as last line of the proof (instead of line below)

lyxproof-package

I understand that usually for LaTeX we do \qedhere to force the QED symbol to appear where you want it.

How do I change the Proof environment in LyX to get LyX to do the same thing?

Right now if I have alignat environment as the last bit of my proof, the QED square appears one line below where I would like it to be.

enter image description here

Best Answer

In any amsmath environment such as alignat, you can add \qedhere at the end of the last cell and wrap it inside \tag*, as follows:

\qedhere inside \tag*

For repeated usage, I recommend defining a macro as follows:

macro with \qedhere inside \tag*

I have been using this trick for years, it always worked for me.