Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In a paper I'm writing, I end a proof with a displayed equation that has some cases in it. The relevant code looks something like the following:

\[f(x) = \begin{cases}
2x & \text{if $x<0$}\\
7  & \text{if $x=0$}\\
1-x & \text{if $x>0$}
\end{cases} \]
\end{proof}

What I want to happen is for the amsthm "tombstone" to be placed on the right-hand side of the page aligned with the "1-x" line. I think this should be possible by placing a \qedhere in an appropriate place, but I can't seem to figure out where (I've tried all the obvious choices, and they all give me incorrect behavior).

Thanks for any help!

share|improve this question
add comment

1 Answer

up vote 19 down vote accepted

This can be achieved using the ntheorem package. This package handles endmarks properly. Note, you should specify the amsmath and amsthm options if you use amsmath and the proofenvironment, further thmmarks to get endmarks.

Here's a complete example, placing the qed symbol at the same height like 1-x, like desired by you:

\documentclass{article} 
\usepackage{amsmath}
\usepackage[amsmath,amsthm,thmmarks]{ntheorem}
\begin{document}
\begin{proof}
\[ f(x) = \begin{cases}
     2x & \text{if $x<0$}\\
     7  & \text{if $x=0$}\\
    1-x & \text{if $x>0$}
\end{cases} \]
\end{proof}
\end{document}

Output:

alt text

You could use further features of ntheorem to customize the proof layout and to choose a qed symbol. The ntheorem documentation may tell you more.

share|improve this answer
3  
this is definitely a minor quibble; however, the bottom of the "tombstone" should really be aligned with the baseline of the last cases line, not with the tippy tail end of the brace. (on the other hand, with amsthm and \qedhere, it sits on the baseline with the $f(x)$, so i apologize for casting stones.) –  barbara beeton Aug 4 '11 at 17:34
1  
Unfortunately, the ntheorem package doesn't work with the amsart class. –  Jairo Bochi Sep 25 '13 at 19:12
add comment

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.