Generalremove chapter numbers in table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

remove chapter numbers in table of contents

Post by webhead »

I used the Search, honest! But I couldn't find where this was discussed. I want to have only chapter names in a book, no chapter numbers. It's really a collection of letters and each letter stands alone, meaning they are not all on one particular topic.

Code: Select all

\documentclass[a4paper,10pt]{book}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{makeidx} 

\begin{document}
\tableofcontents
\pagestyle{empty}
\pagestyle{headings}

\chapter{A Letter}
\blindtext
\chapter{Another Letter}
\blindtext
\chapter{Yet Another Letter}
\blindtext

\end{document}
Keep to the Code.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

remove chapter numbers in table of contents

Post by gmedina »

There are several discussions about the tocloft and titlesec packages that could be useful.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

remove chapter numbers in table of contents

Post by webhead »

I wasn't able to find what I need in there, but I did find this elsewhere:
If you want to add a document chapter that has no a chapter number but appearing inside the table of content, the classical LATEX commands \chapter and \chapter* are inefficient. Indeed, \chapter add a numbered chapter inside the table of content, and \chapter* adds an unnumbered chapter but not inside the table of content.

To add a unnumbered chapter inside the table of content, you could use one of the commands:
\chaptertoc[toctitle]{title}
\chaptertoc*[toctitle]{title}
The commands
\chaptertoc and \chaptertoc* have the same effect except that \chaptertoc* aligns the chapter’s title to the other numbered chapters’ titles; and \chaptertoc not.
But I get an error message:
Undefined control sequence.
1.6 \chaptertoc
*[toctitle]{title}
I assume the new command replaces the existing chapter command, right?
Keep to the Code.
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

remove chapter numbers in table of contents

Post by webhead »

Found the answer Here.
Keep to the Code.
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

Re: remove chapter numbers in table of contents

Post by webhead »

::sigh::

Except for one little problem: the word CONTENTS appears where the chapter name used to be on the individual pages of the chapters.
Keep to the Code.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

remove chapter numbers in table of contents

Post by Stefan Kottwitz »

Hi,

you could use \markboth, \markright.

Stefan
LaTeX.org admin
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

Re: remove chapter numbers in table of contents

Post by webhead »

That gets me close, but instead of the actual chapter name, it just says "Chapter".
Keep to the Code.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: remove chapter numbers in table of contents

Post by Stefan Kottwitz »

In that case show a small example how you are doing it at the moment.

Stefan
LaTeX.org admin
webhead
Posts: 26
Joined: Sat Jul 19, 2008 5:29 pm

remove chapter numbers in table of contents

Post by webhead »

Code: Select all

\documentclass[a4paper,10pt]{book}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{makeidx}

\begin{document}
\tableofcontents
\pagestyle{myheadings}
\markboth{\chaptername}{The Book Name}

\chapter*{A Letter} \addcontentsline{toc}{chapter}{A Letter}
\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\blindtext

\chapter*{Another Letter} \addcontentsline{toc}{chapter}{Another Letter}
\blindtext

\blindtext

\blindtext

\chapter*{Yet Another Letter} \addcontentsline{toc}{chapter}{Yet Another Letter}
\blindtext

\blindtext

\blindtext

\blindtext

\end{document}
Keep to the Code.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

remove chapter numbers in table of contents

Post by Stefan Kottwitz »

Try

Code: Select all

\markboth{The Book Name}{The Book Name}
instead.

Stefan
LaTeX.org admin
Post Reply