20

Using amsthm, is there a possibility to remove the dot when typing \begin{proof}...\end{proof}? This would be typeset as "Proof." If you change your proofname \begin{proof}[Proof:]...\end{proof} you would get "Proof:"; but for typesetting without a dot or colon?

6 Answers 6

19

with amsthm, you can provide an optional proof heading ending with \nopunct; this setting is checked by \@addpunct before adding the period. so you could input \begin{proof}[Proof:\nopunct] ... \end{proof} and the last thing in the heading would be the colon. or you could just omit all punctuation -- but you do have to use the option to provide the text.

the \nopunct technique was originally created to take care of situations in which a heading ends with (say) a question mark, but since it would work for this as well, ...

5
  • @barbarabeeeton: I was trying to do exactly what you hint at, namely ending the title of a subsection with a question mark. I tried to add \nopunct in the title between brackets, so it reads \subsection{Another proof?\nopunct} but it still renders with a dot at the end. Am I missing something? Nov 6, 2015 at 14:23
  • the \subsection heading isn't necessarily defined the same way as the heading of the proof environment; it depends on what document class you are using. but if you really want a proof, and are using amsthm, you could start it as \begin{proof}[Another proof?\nopunct]. Nov 6, 2015 at 14:39
  • No, no, I am in \subsection (unfortunately) and I am using a class from EMS which is hugely based on amsclass. Nov 6, 2015 at 15:25
  • @FilippoAlbertoEdoardo -- i have tested with this file: \documentclass{amsart} \begin{document} \subsection{What?\nopunct} some text \end{document} and the output has no period after the subsection heading. if you get a period, then the definition of \subsection has been modified in a manner that isn't obvious. if that is the case, then please ask a new question, and include a compilable example (that produces the flaw) for experimentation. Nov 6, 2015 at 17:42
  • I will do it. In the meantime, I have checked your MWE: I agree that it does not output a period, but on my computer it wouldn't produce it even without the \nopunct. Is it normal? You can find the question here tex.stackexchange.com/q/277061/30052 Nov 7, 2015 at 1:02
12

A way to do this is to use the thmtools package:

enter image description here

\documentclass{article} 
\usepackage{amsthm} 
\usepackage{thmtools}

\declaretheorem{theorem} 
\declaretheoremstyle[%
  spaceabove=-6pt,%
  spacebelow=6pt,%
  headfont=\normalfont\itshape,%
  postheadspace=1em,%
  qed=\qedsymbol,%
  headpunct={}
]{mystyle} 
\declaretheorem[name={Proof},style=mystyle,unnumbered,
]{Proof}

\begin{document}
\begin{proof}% Old
\end{proof}
%
\begin{Proof}% New
\end{Proof}
\end{document}
8

In order to get rid of the pesky punctuation mark following the string "Proof", one could perform a full \renewenvironment on the proof environment (see @lockstep's answer), or one could use the package etoolbox to "patch" (obliterate, in the present case) a single command in the proof environment:

\documentclass{article}
\usepackage{amsthm}   % amsthm defines the environment 'proof'
\usepackage{etoolbox} % etoolbox defines the command 'AtBeginEnvironment'
\makeatletter
\AtBeginEnvironment{proof}{\let\@addpunct\@gobble}
\makeatother

\begin{document}
\begin{proof} Hello World. \end{proof}
\end{document}
3
  • 3
    i'm surprised nobody took a look at the definition of \addpunct. it already contains a trap for omitting punctuation when the \spacefactor is greater than 1000, hence the definition of \nopunct{\spacefactor 1007 }. please see my answer. Oct 12, 2011 at 18:50
  • Very interesting indeed! I must confess not recalling ever having noticed this detail in the documentation for the amsthm package. So I checked the user guide for the current version (2.20, August 2004, correct?) and sure enough, there's still no reference to this nifty feature, whether for the proof environment specifically or all theorem-like environments in general. :-( Fortunately, though, the user guide does state that "An optional argument of the proof environment allows you to substitute a different name for the standard 'Proof'."
    – Mico
    Oct 12, 2011 at 19:21
  • thanks for checking the amsthm documentation. i'll make sure this feature makes it into the next edition. Oct 21, 2011 at 6:25
7

The dot is hard-coded in amsthms definition of the proof environment, so the definition has to be changed.

\documentclass{article}

\usepackage{amsthm}

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

\begin{document}

\begin{proof}[Proof]
Some text.
\end{proof}

\end{document}
1
  • please see my answer. Oct 12, 2011 at 15:44
4

You can redefine the output with:

\makeatletter
\let\@addpunct\@gobble
\makeatother

MWE:

\documentclass{article}
\usepackage{amsthm}
\makeatletter
\let\@addpunct\@gobble
\makeatother
\begin{document}
\begin{proof}
Text
\end{proof}
\end{document}
4
  • 4
    If one uses one of the AMS classes, this would omit punctuation also in the references.
    – egreg
    Oct 12, 2011 at 15:46
  • 2
    @egreg: Of course but the op said he is using amsthm. : If he used a amsclass, he wouldn't need this package. Oct 12, 2011 at 16:03
  • 1
    @Marco: Maybe the OP doesn't know this.
    – lockstep
    Oct 12, 2011 at 16:45
  • @lockstep: ;-) Oct 12, 2011 at 16:46
1

The amsthm package also provides a means to modify or define your own theorem environments using

\newtheoremstyle{<name>}%
  {<space above>}%
  {<space below>}%
  {<body font>}%
  {<indent amount>}%
  {<theorem head font>}%
  {<punctuation after theorem head>}%
  {<space after theorem>}%

You would need to set <punctuation after theorem head>. The other setting could remain similar to the existing proof environment. Then you would use

\theoremstyle{<name>}
\newtheorem*{Proof}{Proof}

to have a Proof environment (without number *) labelled Proof.

1
  • 8
    This won't give the automagical QED symbol.
    – egreg
    Oct 12, 2011 at 16:37

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.