3

If I use code such as:

\chapter{Introduction}
\subfile{intro/Introduction}

\chapter{Remaining Work}
\subfile{remaining/Remaining}

The result is:

Chapter 1
Introduction

Chapter 2 
Remaining Work

I'd like to remove the "Chapter 1" etc title, preferably replacing with the number and title.

If I use:

\chapter*{Introduction}

Then the Chapter 1 label is removed, however, this ruins the table of contents - sections are labelled 0.1, 0.2 etc without ever being labelled by chapter.

How can I remove the Chapter N label and keep the numbering on the table of contents correct?

EDIT:

Full working example (changing chapter to chapter*):

\documentclass{book}
\usepackage{subfiles}

\begin{document}

\addcontentsline{toc}{chapter}{Contents}
\tableofcontents
\let\cleardoublepage\clearpage

\mainmatter

\chapter{Introduction}
Test
\section{Test1}
Test
\subsection{Test1.1}
Test
\section{Test2}
Test
\section{Test3}
Test
\section{Test4}
Test

\chapter{Remaining Work}
Test
\section{Test1}
Test
\subsection{Test1.1}
Test
\section{Test2}
Test
\section{Test3}
Test
\section{Test4}
Test

\clearpage
\backmatter

\end{document}
4
  • 2
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Commented Dec 4, 2014 at 22:09
  • Your question depends heavily on the documentclass being used. Do you want to have just the chapter title, no Chapter N leadin ?
    – user31729
    Commented Dec 4, 2014 at 22:09
  • 1
    Take a look at the titlesec package and its companion titletoc, at least if you use one of the standard classes.
    – Bernard
    Commented Dec 4, 2014 at 22:13
  • Have added an example Commented Dec 4, 2014 at 22:21

1 Answer 1

2

In the standard book class, the macro \@makechapterhead creates the chapter title leadin, starting with Chapter N.... chapter title.

Using the xpatch package, this leadin can be removed and stripped down to the pure title only with xpatchcmd.

\documentclass{book}
\usepackage{subfiles}

\usepackage{xpatch}%

\makeatletter  % For \mainmatter chapters so far only!
\xpatchcmd{\@makechapterhead}{\huge\bfseries \@chapapp\space \thechapter}{\huge\bfseries}{}{}%

\makeatother

\begin{document}

\addcontentsline{toc}{chapter}{Contents}
\tableofcontents
\let\cleardoublepage\clearpage

\mainmatter

\chapter{Introduction}
Test
\section{Test1}
Test
\subsection{Test1.1}
Test
\section{Test2}
Test
\section{Test3}
Test
\section{Test4}
Test

\chapter{Remaining Work}
Test
\section{Test1}
Test
\subsection{Test1.1}
Test
\section{Test2}
Test
\section{Test3}
Test
\section{Test4}
Test

\clearpage
\backmatter

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .