[Tex/LaTex] Redefining proof environment

amsthmenvironmentsformatting

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.

Best 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}

enter image description here

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}
Related Question