0

When my proof end with an enumeration resp. a formula, the qed-symbol is set in a new line. But I want it to be in the last line of the enumeration resp. the formula.

Here is what is looks like: enter image description here

Here is my code:

\documentclass[ngerman, fontsize=11pt, DIV=15, ,BCOR = 10mm, parskip=half-, twoside]{scrbook}

\usepackage{amsmath, amsthm}
\usepackage{cleveref}

\begin{document}

    \begin{proof}
        We want to prove
    \begin{enumerate}
        \item that this is true
        \item and that the QED-symbol is not on this line. But it is not, and that makes me sad.
    \end{enumerate}
    \end{proof}
%
    \begin{proof}
    We want to prove that
    \begin{align*}
        1+2 = 4
    \end{align*}
\end{proof}
\end{document}
4
  • 2
    With amsthm you can only do it manually using \qedhere in the list and \tag*{\qedhere} in align*. Note that the ntheorem package can do this automatically with the right options (though their algorithm is fragile, for example no blank lines before \end)
    – daleif
    May 24 at 15:20
  • @daleif Hey that did it! Thank you!! May 24 at 15:26
  • I am kind of surprised that I cannot find a good Canonical Question about \qedhere to close this as a duplicate of. I'm sure a lot of newer users run into this. Maybe someone should write a canonical answer? May 24 at 20:49
  • @daleif As explained elsewhere, \qedhere doesn't work in align* if there's no & on the particular line. But align* for a single equation is wrong to begin with.
    – egreg
    May 24 at 21:51

1 Answer 1

1

You use \qedhere.

\documentclass{article}

\usepackage{amsmath, amsthm}

\begin{document}

\begin{proof}
We want to prove
\begin{enumerate}
  \item that this is true
  \item and that the QED-symbol is not on this line.
        But it is not, and that makes me sad.\qedhere
\end{enumerate}
\end{proof}

\begin{proof}
We want to prove that
\begin{equation*}
  1+2 = 4 \qedhere
\end{equation*}
\end{proof}

\begin{proof}
We want to prove that
\begin{align*}
  1+2 &= 3+5 \\
      &= 4 \qedhere
\end{align*}
\end{proof}

\end{document}

Note that for single equation align should not be used.

enter image description here

5
  • Thank you, that did it! Now I have one more question, hope it fits here. I want several theorems to be ended by a \diamond. And this diamond shall be set just like the qed-square you answered me for. But i cannot use a \qedhere if I don't want the qed-Symbol? May 25 at 9:16
  • @mathquester tex.stackexchange.com/a/656628/4427
    – egreg
    May 25 at 9:21
  • Wow that was fast, thank you. I think it is what I want to. It works on my machine. Nevertheless, it still says "proof" at the beginning (of course, because I use a proof, obviously). But I want my selfmade lemma-environment to be ended by the diamond. Is that possible, too? May 25 at 9:29
  • @mathquester That's a different business: tex.stackexchange.com/a/32394/4427
    – egreg
    May 25 at 10:01
  • That was exactly what I was looking for. Thank you so much! May 25 at 10:16

You must log in to answer this question.

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