How can I change the \begin{proof}
environment so that the word Proof
which is displayed in my document isn't italic? I tried changing \proofname
, but that only changes the displayed text, not the style.
1 Answer
I assume you're talking about proof
as defined by amsthm
. The command \itshape
is hardwired in the environment's definition.
I suggest patching it so it uses a “generic” command that you can redefine at will:
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{} % add nothing
Full example. The \renewcommand
is just for testing.
\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{}
\begin{document}
\begin{proof}
Obvious, isn't it?
\end{proof}
\renewcommand{\proofnamefont}{\bfseries}
\begin{proof}[Proof in boldface]
Test for boldface and the optional argument.
\end{proof}
\end{document}
Just to clear up things: if you want boldface, the code should be
\documentclass{article}
\usepackage{amsthm}
\usepackage{xpatch}
\xpatchcmd{\proof}{\itshape}{\normalfont\proofnamefont}{}{}
\newcommand{\proofnamefont}{\bfseries}
\begin{document}
\begin{proof}
Obvious, isn't it?
\end{proof}
\end{document}
-
@Nicholas I added the
amsthm
tag, so surely our friend Barbara Beeton will take notice of the feature request.– egregJun 20, 2015 at 12:47 -
request posted, but as a request to add \proofnamefont rather than hard-coded \itshape. in fact, there is a generic request on file to reconsider all hard-coded font settings (except perhaps for italic for the basic theorem environment, although even there i know some people who prefer slanted type). Jun 20, 2015 at 14:39
-
\documentclass{...}\usepackage{....}\begin{document}...\end{document}
. If possible, it should compile and have the minimum amount of code needed to illustrate your problem. This makes it much easier for people to help you - and much more likely that they will! If you are using the amsthm package then\begin{proof}[\textbf{Proof}]...\end{proof}
should put proof in bold.