8

I have seen a similar post here How to remove the "." in the proof environment?. But I don't know how I can modify the answer to replace . with : by using etoolbox.

7

The easiest way to get Proof: (boldface italic) is to say

\renewcommand{\proofname}{\bfseries Proof:}

The \@addpunct command will not add its argument if it's preceded by a punctuation mark, so no change to the definition of the proof environment is necessary.

Note: the italic shape is already selected, so it's only necessary to add \bfseries. No braces are needed, as the heading is typeset as the optional argument to \item, which forms a group by itself.

One can, alternatively, patch the environment's definition in order to change \@addpunct{.} into \@addpunct{:} and to add \bfseries. Patching the environment with etoolbox is tricky, because the environment has an optional argument:

\usepackage{etoolbox}
\makeatletter
\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}{\@addpunct{:}}{}{}
\expandafter\patchcmd\csname\string\proof\endcsname{\itshape}{\itshape\bfseries}{}{}
\makeatother

With the xpatch package it's easier:

\usepackage{xpatch}
\makeatletter
\xpatchcmd\proof{\@addpunct{.}}{\@addpunct{:}}{}{}
\xpatchcmd\proof{\itshape}{\itshape\bfseries}{}{}
\makeatother
  • A very interesting fact about the \@addpunct command which I didn't know. – Thorsten Donig Feb 14 '12 at 19:06
7

Take the code for the proof environment from the sources of the amsthm package and modify it accordingly.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{mathtools}   % loads »amsmath«
\usepackage{amsthm}

\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\@addpunct{:}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother

\begin{document}
  \begin{proof}
    This is a proof.
  \end{proof}
\end{document}
  • Actually, I can remove the "." at the end as in the link I supplied above and redefine the proof name with a ":" at the end as follows. \def\proofname{\emph{\textbf{Proof:}}} But I find this no good. – bkarpuz Feb 10 '12 at 11:59
  • This is the way I do it when I want to change .->: or to change the font. – yo' Feb 10 '12 at 14:49
  • @bkarpuz. Do you understand this answer? I am completely confused. I find the other answer below more helpful and clear. – J G Feb 12 '12 at 6:29
  • @J G. I used the first one supplied in tex.stackexchange.com/a/44114/9955 by egreg. – bkarpuz Feb 13 '12 at 4:25
  • @bkarpuz: Then you should accept his answer and vote it up (if not done yet). – Thorsten Donig Feb 13 '12 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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