1

This question already has an answer here:

This code

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb,amsmath}
\usepackage{amsthm}
\usepackage{dsfont}
\usepackage{empheq}
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
\newenvironment{lemmaqed}
{\pushQED{\qed}\lemma}
{\popQED\endlemma}

\begin{document}
\begin{lemmaqed}
\begin{itemize}
  \item $a^2+b^2=c^2$
  \item $a^2+b^2=c^2$
\end{itemize}
\end{lemmaqed}

\begin{lemmaqed}
\begin{align*}
a^2+b^2=c^2
\end{align*}
\end{lemmaqed}

\begin{lemmaqed}
$a^2+b^2=c^2$
\end{lemmaqed}
\end{document}

creates the outputenter image description here My problem is: The qed symbol should be at the place indicating by Lemma 3, so on the right at the same line. This is not the case in Lemma 1 and 2. How can I change this?

marked as duplicate by egreg math-mode Sep 5 '16 at 21:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Use \qedhere when the QED symbol should go in a display or in a list such as itemize. – egreg Sep 5 '16 at 21:06
1

There is no such problem using ntheorem instead of amsthm. Note ntheorem has a compatibilty mode with amsthm:

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amssymb}
\usepackage{empheq}
  \usepackage[thmmarks, amsmath, thref, amsthm]{ntheorem}
  \usepackage{dsfont}
\theoremstyle{plain}
\newtheorem{lemma}{Lemma}
\theoremsymbol{\ensuremath{\square}}
\newtheorem{lemmaqed}[lemma]{Lemma}

\begin{document}

\begin{lemmaqed}
  \begin{itemize}
    \item $a²+b²=c²$
    \item $a²+b²=c²$
  \end{itemize}
\end{lemmaqed}

\begin{lemmaqed}
  \begin{align*}
    a²+b²=c²
  \end{align*}
\end{lemmaqed}

\begin{lemmaqed}
  $a²+b²=c²$
\end{lemmaqed}

\end{document}

enter image description here

One might as well define a lemma environment, which by default has a qed-symbol at the end. This qed-symbol may be for deactivated for specific environments with the directive \NoEndMarks. Also, the symbol is easily customised on a per-theorem basis.