1

I would like to remove the "Chapter 3" on the last page. I would like to keep everything else as is, including the toc content.

\documentclass{book}
\usepackage{lipsum}

\begin{document}

\tableofcontents

\chapter{Lorem} \lipsum[3]

\chapter{Ipsum} \lipsum[3]

\chapter{Dolor} \lipsum[3]

\end{document}

I am aware of the solution of adding this in the header:

\usepackage{titlesec}

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

I would like to remove the "Chapter X" only once, however. The only work-around that I can come up with is using the above solution and adding "Chapter N" for all the other chapters manually. Seems clumsy, though.

  • Welcome to tex.sx. If the last page is otherwise blank, you can end the text with \clearpage \thispagestyle{empty}; that will also omit the page number. – barbara beeton Dec 07 '23 at 20:52
  • Thank you. This removes the page number but does not remove "Chapter 3". – kemajuan Dec 07 '23 at 20:57
  • Should the "Dolor" chapter in this example be numbered in the TOC? Should the chapter after that be four or three? – Marijn Dec 07 '23 at 21:07
  • It should be numbered in the TOC. The next chapter should be four. In fact, in my case there are no further chapters, only sections and subsections (within that chapter), whose numbering should accordingly be 3.x.x – kemajuan Dec 07 '23 at 21:10
  • Then I guess \chapter*{Dolor} \stepcounter{chapter} \addcontentsline{toc}{chapter}{3 Dolor} does what you need? – Marijn Dec 07 '23 at 21:12
  • So what does the 3 in section 3.x.x mean when there's no visual reference to Chapter 3 in the main text? – Werner Dec 07 '23 at 21:12
  • @Marijn: Probably \chapter*{Dolor} \stepcounter{chapter} \addcontentsline{toc}{chapter}{\protect\numberline{3}Dolor}. – Werner Dec 07 '23 at 21:13
  • @Werner yes that is what I meant :) just now I was looking for the syntax to get the number correct. – Marijn Dec 07 '23 at 21:16
  • https://tex.stackexchange.com/questions/35433/creating-unnumbered-parts-chapters-sections-plus-adding-them-to-the-toc-and-or seems very similar (except for the \stepcounter and \numberline part) – Marijn Dec 07 '23 at 21:23
  • Thank you both! This does exactly what I was looking for! The visual reference issue is a fair point. This is for the reference section which I did not want to call a Chapter. I'll keep thinking about it. – kemajuan Dec 07 '23 at 21:24
  • If you want, @Werner, you can post your comment as an answer so that I can accept it. I would say it is a valid separate question. Clear and simple question - clear and simple answer. – kemajuan Dec 07 '23 at 21:32
  • If you want to be able to refer to it as chapter 3, you want \refstepcounter. However, the usual format is not to number a chapter like this anywhere, but to use \chapter*{Dolor} and, if desired, add an unnumbered chapter to the toc. Similar things for headers/footers etc. if they would otherwise include a chapter number. This is common for things like bibliographies, references and, indeed, tables of contents. – cfr Dec 08 '23 at 00:28
  • If it is for the reference section then you should use the official \bibliography (BibTeX) or \printbibliography (BibLaTeX) commands. These don't get the 'Chapter X' header. There are options to choose your own title for the section (Bibliography, References, Literature, something else) and there is a package that lets you choose whether or not to include this section in the Table of Contents. – Marijn Dec 18 '23 at 08:47

1 Answers1

0

You have to do some minor legwork to achieve what you're going for. Primarily the steps are:

  1. Set an unnumbered chapter
  2. Step the chapter counter (what a typical numbered \chapter would do)
  3. Add the "numbered" chapter to the ToC
  4. Update the headers (if used)

enter image description here

\documentclass{book}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\chapter{Lorem} \section{First section}\lipsum[1-10] \section{Second section}\lipsum[11-20] \section{Third section}\lipsum[21-30] \section{Final section}\lipsum[31-40]

\chapter{Ipsum} \section{First section}\lipsum[1-10] \section{Second section}\lipsum[11-20] \section{Third section}\lipsum[21-30] \section{Final section}\lipsum[31-40]

% Insert numberless chapter \chapter{Dolor} % Pretend that it's not numberless and increment the chapter counter; if you % wish to refer to Chapter 3 via a \label, use \refstepcounter instead. \stepcounter{chapter} % Add the "numbered" chapter to the ToC (because \chapter is not added by default) \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}Dolor} % Update the chapter marks for this chapter (inner right for verso pages in book) \chaptermark{Dolor} \section{First section}\lipsum[1-10] \section{Second section}\lipsum[11-20] \section{Third section}\lipsum[21-30] \section{Final section}\lipsum[31-40]

\end{document}

The above setup should work even if you're using hyperref.

Werner
  • 603,163