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

share|improve this question
1  
You could use the easier way with the thmtools (see answer tex.stackexchange.com/a/31355/8042 ) by writing headpunct={:} –  Ronny Feb 10 '12 at 8:33

2 Answers 2

up vote 6 down vote accepted

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
share|improve this answer
    
A very interesting fact about the \@addpunct command which I didn't know. –  Thorsten Donig Feb 14 '12 at 19:06

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

 
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.