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.

How can I draw a horizontal line at the end of proofs? I use \begin{proof}....\end{proof}.

I use amsthm package without any modification.

share|improve this question
    
You can redefine the QEDsymbol. –  Sigur Apr 18 '13 at 1:15
add comment

3 Answers

You could patch \endproof (the end macro of the proof environment) to insert a horizontal rule automatically. The following patch is provided via etoolbox:

enter image description here

\documentclass{article}
\usepackage{amsthm,etoolbox}% http://ctan.org/pkg/{amsthm,etoolbox}
\patchcmd{\endproof}% <cmd>
  {\endtrivlist}% <search>
  {\endtrivlist\par\nobreak\vspace*{\dimexpr-\baselineskip-\parskip}\nobreak\noindent\hrulefill}% <replace>
  {}{}% <succes><failure>
\begin{document}
\begin{proof}
Here is a proof.
\end{proof}
\end{document}

The patch removes a vertical skip after ending proof, and inserts \nobreak together with a horizontal rule (\hrulefill) so that they are not separated by a page break.

share|improve this answer
    
the designers of amsthm don't consider the vertical skip after a proof to be an error, so would prefer "removes" to "corrects". (the purpose of the skip is to make the end of the proof more obvious; clearly, the rule has the same intent, and is handled appropriately in your code.) –  barbara beeton Apr 18 '13 at 13:39
add comment

For example:

\documentclass{article}


\begin{document}

\def\qed{\hrulefill}

\newtheorem{theorem}{Theorem}
\begin{theorem}
2+2=4.
\qed
\end{theorem}

\end{document}
share|improve this answer
2  
Other option is to use \def\qed{\rule{.75\linewidth}{1pt}} so it is possible to set up the width of the line and the thickness. –  Sigur Apr 18 '13 at 1:36
add comment

Here's another option, this time using the thmtools package as a front-end for amsthm:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}% just to generate text for the example

\let\proof\relax
\let\endproof\relax

\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
numbered=no,
headfont=\normalfont\itshape,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
postheadspace=1em,
prefoothook=\vspace*{\dimexpr-\baselineskip+\topsep\relax}\endgraf\nobreak\noindent\hrulefill
]{mystyle}
\declaretheorem[style=mystyle]{proof}

\begin{document}

\begin{proof}
\lipsum*[2]
\end{proof}

\end{document}

enter image description here

share|improve this answer
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.