32

How do I remove "Chapter N" from the chapters when using the book document class?

This does not appear in the TOC (which I don't want, either).

But it appears at the beginning of a chapter, and on each page, in the header.

21
  • How are you producing your headers? Jun 24, 2013 at 4:17
  • @GonzaloMedina: They appear automatically on each page that isn't a "new chapter" page - I guess because of the book mode. Jun 24, 2013 at 4:19
  • What about the table of contents? Should the chapter entries remain numbered? What about sections, should they still carry the chapter number as a prefix? Jun 24, 2013 at 4:21
  • @GonzaloMedina: Yes, to both questions. Jun 24, 2013 at 4:23
  • 2
    If you want unnumbered chapters in the book class, and if you're not tweeking the appearance of your chapter titles, you should use the \chapter* command, not the \chapter command.
    – user10274
    Jun 24, 2013 at 7:22

5 Answers 5

28

With the help of titlesec:

\documentclass{book}
\usepackage{titlesec}
\usepackage{lipsum}

\titleformat{\chapter}[display]
  {\normalfont\bfseries}{}{0pt}{\Large}

\begin{document}

\chapter{Test Chapter}
\lipsum[3]

\end{document}

Without titlesec:

\documentclass{book}
\usepackage{lipsum}

\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \interlinepenalty\@M
    \Large \bfseries #1\par\nobreak
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Large \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}
\makeatother
\begin{document}

\chapter{Test Chapter}
\lipsum[3]

\end{document}

enter image description here

To customize the headers/footers, one option is to use the fancyhdr package; a little example, suppressing the prefix "Chapter N" from the default headers, and with the text in normal case (no upper-case):

\documentclass{book}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{lipsum}

\titleformat{\chapter}[display]
  {\normalfont\bfseries}{}{0pt}{\Large}

\pagestyle{fancy}

\fancyhf{}
\fancyhead[RE]{\leftmark}
\fancyhead[LO]{\rightmark}
\fancyhead[LE,RO]{\thepage}
\renewcommand\headrulewidth{0pt}
\renewcommand\chaptermark[1]{\markboth{#1}{}} 
\renewcommand\sectionmark[1]{\markright{\thesection.\ #1}}

\begin{document}

\chapter{Test Chapter}
\section{Test Section}
\lipsum[1-20]

\end{document}

Another option for the headers/footers is to use the pagestyles option for titlesec and design the desired style:

\documentclass{book}
\usepackage[pagestyles]{titlesec}
\usepackage{fancyhdr}
\usepackage{lipsum}

\titleformat{\chapter}[display]
  {\normalfont\bfseries}{}{0pt}{\Large}
\newpagestyle{mystyle}{
  \sethead[\thepage][][\chaptertitle]{\thesection~\sectiontitle}{}{\thepage}
}
\pagestyle{mystyle}

\begin{document}

\chapter{Test Chapter}
\section{Test Section}
\lipsum[1-20]

\end{document}
1
  • I used without using titles but the output is showing some paragraph which was not supposed to be shown how to remove it? Apr 28, 2021 at 6:01
15

Partial solution

Thanks to einpoklum's answer, I found that this

\titleformat{\chapter}[display]
{\bfseries\Large}                                            
{\filright}
{1ex}{}[]

solves the problem for the chapter start.

But the page headers remain.

Full solution

It appears this did it. Thanks to Gonzalo Medina, for his answer, from where I exerted the code.

\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}[display]{\normalfont\bfseries}{}{0pt}{\Huge}
\newpagestyle{mystyle}
{\sethead[\thepage][][\chaptertitle]{}{}{\thepage}}
\pagestyle{mystyle}

Now it looks the way I like. (The screenshots got dusty, for some reason.)

chapter http://user.it.uu.se/~embe8573/chapter.png header http://user.it.uu.se/~embe8573/header.png

3

The 'Chapter N' text is the value of the \@chapapp macro, defined in the book document class.

But... no need to tinker with that directly. See

How to create specific chapter style in book documentclass

it refers you to the titlesec package and to these pages, with which you can change the chapter heading style. One of the things you can do, specifically, is play with the way the number is displayed.

2
  • Thanks, that solved half the problem. Check out the edit I just made. Jun 24, 2013 at 4:12
  • 1
    \thechapter just produces the representation for the counter; the string "Chapter" comes from the internal \@chapapp command. Jun 24, 2013 at 4:53
2

I found adding an asterisk after chapter works, like this: \chapter*{Introduction}

Found on https://www-users.york.ac.uk/~pjh503/LaTeX/text.html

It worked for me.

0
0

To remove the "Chapter n", just need to add \setcounter{secnumdepth}{-1} before the \begin{document}

Source:

The ctan package documentation says

@chapter | This macro is called when we have a numbered chapter. When secnumdepth is larger than −1 and, in the book class, @mainmatter is true, we display the chapter number. We also inform the user that a new chapter is about to be typeset by writing a message to the terminal.

%% example code in the documentation
790 \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
791 ⟨book⟩ \if@mainmatter
792 \refstepcounter{chapter}%
793 \typeout{\@chapapp\space\thechapter.}%
794 \addcontentsline{toc}{chapter}%
795 {\protect\numberline{\thechapter}#1}%
796 ⟨∗book⟩
797 \else
798 \addcontentsline{toc}{chapter}{#1}%
799 \fi
800 ⟨/book⟩
801 \else
802 \addcontentsline{toc}{chapter}{#1}%
803 \fi

For example, if you need to remove "Part N" for \part, then you change it for \setcounter{secnumdepth}{-2} and so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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