# How to draw a horizontal line at the end of proofs?

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.

-
You can redefine the QEDsymbol. –  Sigur Apr 18 '13 at 1:15

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

\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.

-
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

For example:

\documentclass{article}

\begin{document}

\def\qed{\hrulefill}

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

\end{document}

-
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

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,
notefont=\mdseries, notebraces={(}{)},
bodyfont=\normalfont,
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}


-