6

I've redefined the proof environment to make the heading boldface by adapting the code from the amsthm documentation (p. 11). I've literally just deleted \itshape and typed \bfseries instead, nothing else was changed.

(Note: It doesn't even matter whether one changes the italics to boldface, the same problem arises when one copies the provided code from the documentation directly into the document.)

Unfortunately, lists now start on the second line instead of beginning right after the heading. Can this be fixed?

\documentclass[]{article}
\usepackage{amsthm, lipsum}

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

\begin{document}
\begin{proof}
    \begin{enumerate}
        \item \lipsum[66]
        \item \lipsum[66]
    \end{enumerate}
\end{proof}
\end{document}
Jeroen
  • 4,491
  • 1
    Did you change anything but the itshape into bfseries? – daleif Jan 27 '16 at 21:41
  • Strange, I cannot test until tomorrow – daleif Jan 27 '16 at 21:44
  • Off topic: after the right answer by @egreg, you could wish to use \newlength{\@thlabel@width}\newcommand{\thmenumhspace}{\settowidth{\@thlabel@width}{\upshape(i)}\sbox{\@labels}{\unhbox\@labels\hspace{\dimexpr-\leftmargin+\labelsep+\@thlabel@width-\itemindent}}} and then \begin{enumerate}\thmenumhspace to get a better spacing in this case, where the item begins the environment. – Sigur Jan 27 '16 at 22:08

1 Answers1

8

You have two errors:

  1. there should be [...] after \item, whereas you have {...}
  2. \hskip\labelsep should go inside the optional argument
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
    \pushQED{\qed}%
    \normalfont \topsep6\p@\@plus6\p@\relax
    \trivlist
    \item[\hskip\labelsep\bfseries#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother

Unfortunately, the code shown in the documentation is wrong. :(

Here is the original definition in amsthm.sty

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

You might want to do

\usepackage{amsthm}
\usepackage{xpatch}

\xpatchcmd{\proof}{\itshape}{\bfseries}{}{}

that would avoid looking up the code.

egreg
  • 1,121,712
  • 1
    That's perfect! Pity it's wrong in the documentation indeed. Pity as well that I don't have the hard TeX background and therefore didn't spot the mistakes you pointed out... :) – Jeroen Jan 27 '16 at 22:11
  • 1
    @Jeroen On the other hand, you do have TeX.SE! :) – yo' Jan 28 '16 at 14:50