0

This question already has an answer here:

I'm using the book class and I want to renew its existing command \@makechapterhead. The original command is shown on p.32 of this document. In particular, I want to change the spacing in line 811 from 50 to 30, so I did the following

\renewcommand{\@makechapterhead}{
     \def\@makechapterhead#1{%
        \vspace*{30\p@}%
        {\parindent \z@ \raggedright \normalfont
     \ifnum \c@secnumdepth >\m@ne
 ⟨book⟩     \if@mainmatter
         \huge\bfseries \@chapapp\space \thechapter
         \par\nobreak
         \vskip 20\p@
      \fi
⟨book⟩    \fi
    \interlinepenalty\@M
      \Huge \bfseries #1\par\nobreak
      \vskip 40\p@
    }}
}

But I got an error saying illegal parameter number in definition of \@makechapterhead. How do I fix this?

Thanks.

marked as duplicate by Johannes_B, Stefan Pinnow, ebosi, gernot, egreg macros Jan 23 '17 at 8:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • did you remove the <book> tag in your redefinition? – Yan Zhou Jan 23 '17 at 2:06
0

You can add in the preamble of your document:

\makeatletter
\let\@makechapterhead@ori\@makechapterhead
\renewcommand{\@makechapterhead}[1]{\vspace*{-20\p@}\@makechapterhead@ori{#1}}
\makeatother

The original definition of \@makechapterhead is backup-ed in \@makechapterhead@ori. Next, a negative vertical of 20pt is added and then the original \@makechapterhead is applied. As a result, you got a vertical space of 50-20 = 30pt, as desired.

Not the answer you're looking for? Browse other questions tagged or ask your own question.