1

I know there are several topics about this, but for any reason, no one answered my exact problem. So, I end a proof with a cases-environment and I want to set the QED-Square at the end of the last line. But it is either

  1. set right after the last symbol (but in the correct line) or
  2. in a new line (but at the correct position).

Here is my MWE which results in case 1. If I type

 \qedhere

before the \end{cases} command, it results in case 2.

\documentclass{article}

\usepackage[german, linesnumbered, boxruled]{algorithm2e} \usepackage[utf8]{inputenc} \usepackage[german]{babel} \usepackage[T1]{fontenc} \usepackage{empheq} \usepackage{amsthm}

\begin{document}

There is

\begin{proof} this proof for [ \begin{cases} a \ b. \end{cases} ] \end{proof} \end{document}

Lereu
  • 449

2 Answers2

1

I'm not sure I would do this, but I guess you want

enter image description here

\documentclass{article}

\usepackage[german, linesnumbered, boxruled]{algorithm2e} \usepackage[utf8]{inputenc} \usepackage[german]{babel} \usepackage[T1]{fontenc} \usepackage{empheq} \usepackage{amsthm}

\begin{document}

There is

\begin{proof} this proof for [ \begin{cases} a &xxx\ b.&yyy \end{cases} ]

\vspace{-1.2\baselineskip} \mbox{}\qedhere \end{proof}

\noindent X\dotfill X % just for testing \end{document}

David Carlisle
  • 757,742
1

You can slightly change the code at https://tex.stackexchange.com/a/282772/4427

\documentclass[twocolumn]{article}
\usepackage{amsmath}
\usepackage{amsthm}

\begin{document}

\begin{proof} this proof for [ \begin{gathered}[b] \begin{cases} a \ b. \end{cases}\[-1.2\normalbaselineskip]\mathstrut \end{gathered}\qedhere ] \end{proof}

\end{document}

enter image description here

Note. twocolumn is used just to make a smaller picture that better shows the alignment.

Anyway, the simplest way is to avoid such situations and finish the proof with some explicatory words.

egreg
  • 1,121,712