[Tex/LaTex] How to replace the “.” with “:” in the proof environment

amsthmpunctuationtheorems

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.

Best Answer

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