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.

I'm using the proof environment from the amsthm package. In some cases, the last line of a proof falls at the end of a page, but the QED symbol (the little white box) ends up on the following page.

Is there any way to guarantee that in each instance of \begin{proof} ... \end{proof} in my document, the QED symbol will always be on the same page as the last line of the proof?

Here is an MWE which demonstrates this problem:

\documentclass{article}

\usepackage{lipsum}
\usepackage{amsthm}

\begin{document}

\begin{proof}

\lipsum[1-5]
This is the concluding line of the proof.

\end{proof}

This line is on the second page, below the QED symbol.

\end{document}
share|improve this question
6  
An example? Does the proof end with a list environment or a displayed equation? In that case check for \qedhere in the documentation of amsthm –  egreg Apr 13 '12 at 14:26
1  
How full is this last line? If it spans the entire \textwidth, you may have to restructure the sentence in order to leave room for the QED symbol to fit on the same line. –  Werner Apr 13 '12 at 15:29
1  
@Werner I believe that it should be possible to use widow penalty to solve it in that case. @jamaicanworm: Could you please try adding \widowpenalty=10000 at the very end of the last paragraph of your proof? I'm really not sure whether it can help and I can't test it now. –  tohecz Apr 13 '12 at 16:43
    
Thank you for your comments. I edited the question to include an MWE which demonstrates the problem. (Adding \widowpenalty as @tohecz suggested unfortunately does not help.) –  jamaicanworm Apr 13 '12 at 18:20
3  
@jamaicanworm: Removing the blank line before the end of your proof environment. If you want to keep this for readability purposes, then use a % in the blank line. –  Werner Apr 13 '12 at 18:24

2 Answers 2

up vote 15 down vote accepted

If you remove the blank line between This is the concluding line of the proof. and the \end{proof}, the problem disappears.

share|improve this answer

it's probable that your proof ends with a list or a display environment. since you're using amsthm, you can put \qedhere just before the end of that environment and the "tombstone" will be moved up onto the last line of the list or display.

edit: with the addition of a (non)working example, it became obvious that the problem was caused by a blank line before \end{proof}. never leave a blank line before \end{proof}; doing so will always result in the qed box being on a separate line, and even possibly on the next page as in this example.

share|improve this answer
    
I have voted on this answer since it gives more general answer(in my paper I didn't leave blank line) - although from the OP's view the marked answer is better. –  quapka Apr 19 at 13:04

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.