[Tex/LaTex] Removing the “chapter” title for one chapter only

chapters

How can I remove the "chapter" title for one chapter only?

E.g. if I want to remove the "chapter" title for chapter 2 only, using

\documentclass{report}

\begin{document}

\chapter{Hello}
\chapter{World}
\chapter{!}

\end{document}

I get:

enter image description here

I would like to obtain instead:

enter image description here

Best Answer

The chapter head is set in report.cls by the macro \@makechapterhead:

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

We can create a "duplicate" of it, only with the creation of Chapter X removed. Let's call this duplicate \fake@makechapterhead:

\def\fake@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \strut%\@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}

The commented part has been replaced by \strut (in order to have an appropriate baseline correctly set.

Now we add some house-keeping and user-interface macros and you can use \newchapterhead to create the "fake" chapter head, and \restorechapterhead to restore the original setting:

\documentclass{report}

\makeatletter
\let\old@makechapterhead\@makechapterhead
% Taken from http://mirrors.ctan.org/macros/latex/unpacked/report.cls
\def\fake@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \strut%\@chapapp\space \thechapter
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\newcommand{\newchapterhead}{\let\@makechapterhead\fake@makechapterhead}
\newcommand{\restorechapterhead}{\let\@makechapterhead\old@makechapterhead}
\makeatother

\begin{document}

\chapter{Hello}

\newchapterhead
\chapter{World}

\restorechapterhead
\chapter{!}

\end{document}

The above procedure keeps the same vertical location for the chapter title by merely removing the phrase Chapter X from being printed.


An alternative approach might be to use the \chapter* setting of a chapter. This doesn't provide the same vertical position on the chapter-page for the title, but may also be what you're after:

\documentclass{report}
\begin{document}

\chapter{Hello}

\clearpage\refstepcounter{chapter}%
\chapter*{World}

\chapter{!}

\end{document}

The issuing of a \clearpage\refstepcounter{chapter} allows for two things:

  1. Steps the chapter counter to have a correct reference for sub-content in chapter World;

  2. Correct mark in the document if you're using hyperref for placing a internal document hyperlink.

Related Question