TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
3  
    
@MaartenDhondt but I put amsthm after amsmath like it suggested... – Forever Mozart Jan 6 at 12:02
    
@MaartenDhondt I don't think so. There's no align here and the problem is completely different. – egreg Jan 6 at 12:17
    
It seems I was too quick in judging this as a duplicate. I'll retract my vote. – Maarten Dhondt Jan 6 at 12:22
up vote 3 down vote accepted

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

share|improve this answer
    
thanks. by the way, what's the difference between using \ [ and $$ ? – Forever Mozart Jan 6 at 12:20
1  
@ForeverMozart See Why is \[ … \] preferable to $$? – egreg Jan 6 at 12:21

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}{...}.

share|improve this answer
    
oh that looks right. by the way, how did you know to use value 1.2? – Forever Mozart Jan 6 at 12:15
    
@ForeverMozart Trial and error, knowing it to be approximately 1\baselineskip. See my edited answer to see how to avoid having to calculate the value for each different cases. – Steven B. Segletes Jan 6 at 12:16

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.