8

How can I do this?

When I put \qedhere in cases environment, the square is between the margins somewhere. It is not where the square appears in the usual proof environment, at the right margin.

\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}


\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}

\begin{document}



\begin{proof}

$$
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)\qedhere
\end{cases}
$$
\end{proof}

\begin{ut}The sky is blue.\end{ut}

\begin{proof}Duh.\end{proof}



\end{document}

enter image description here

lockstep
  • 250,273

3 Answers3

5

Abuse gathered:

\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}

\begin{document}

\begin{proof}
\[
\begin{gathered}[b]
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)
\end{cases}
\\
\end{gathered}
\qedhere
\]
\end{proof}

\begin{ut}The sky is blue.\end{ut}

\begin{proof}Duh.\end{proof}

\end{document}

In my opinion this is not the right place, as the baseline should be determined by X(m,n).

enter image description here

egreg
  • 1,121,712
3

You could place the \qedhere outside the cases and raise the box. Or, see follow up to avoid having to recalculate the raise amount for each different cases environment.

\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}

\begin{document}

\begin{proof}

\[
\raisebox{1.2\baselineskip}{$\displaystyle
X(m,n)=
\begin{cases}
x(n),\\
x(n-1)\\
x(n-1)
\end{cases}$}
\qedhere
\]
\end{proof}

\begin{ut}The sky is blue.\end{ut}

\begin{proof}Duh.\end{proof}

\end{document}

enter image description here

FOLLOW UP:

If you didn't want to have to calculate the shift each time, you could use the stackengine package, with \abovebaseline[-\dp\strutbox]{...} in lieu of the \raisebox{shift length}{...}.

2

Following @egreg's suggestion as to the placement of the qed symbol, there's almost nothing to do: just replace $$ … $$ with \[ … \]. One more illuùminating example of why the latter is preferable:

\documentclass{amsart}
\usepackage{amssymb, amsmath, amsthm}

\newtheorem{theorem}{Theorem}
\newtheorem*{ut}{Theorem}

\begin{document}

\begin{proof}[Proof 1]

  \[
    X(m,n)=
    \begin{cases}
      x(n), \\ x(n-1)\\ x(n-1)
    \end{cases}
    \qedhere
  \]
\end{proof}
\vskip4ex

\begin{proof}[Proof 2]

  $$
  X(m,n)=
  \begin{cases}
    x(n), \\ x(n-1) \\ x(n-1)
  \end{cases}
  \qedhere
  $$

  \begin{ut}The sky is blue.\end{ut}

  \begin{proof}Duh.\end{proof}

\end{proof}

\end{document} 

enter image description here

Bernard
  • 271,350