GeneralCustom Chapter Name For Just One Entry

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Custom Chapter Name For Just One Entry

Post by AleCes »

Hello.

I want to have a customized ToC like this:

Chapter 1
/////// 2
/////// 3

and so on.

Is there a way to do that with tocloft?

Code: Select all

\documentclass{book}
\usepackage{tocloft}
\begin{document}
\chapter{Foreword}

\chapter{blah}

\chapter{Afterword}
\end{document}
Thanks everybody.

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Custom Chapter Name For Just One Entry

Post by Stefan Kottwitz »

AleCes wrote:Chapter 1
/////// 2
/////// 3
Are 1, 2, 3 chapter numbers or page numbers? In case of the first - no page numbers? No titles such as "Foreword", "Afterword" of the example?

Which is the just one entry for you would like to have a custom name, and which is the name?

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Custom Chapter Name For Just One Entry

Post by AleCes »

OK sorry, I wanted something like this:

Chapter 1.................01
/////// 2.................10
/////// 3.................30
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Custom Chapter Name For Just One Entry

Post by Stefan Kottwitz »

Sounds like simply

Code: Select all

\addcontentsline{toc}{chapter}{Chapter \thechapter}
...
\addcontentsline{toc}{chapter}{/////// \thechapter}
...
\addcontentsline{toc}{chapter}{/////// \thechapter}
at those places.

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Custom Chapter Name For Just One Entry

Post by AleCes »

Thanks but I was thinking about something more standardized, where only the first entry has a special format.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Custom Chapter Name For Just One Entry

Post by Stefan Kottwitz »

I still don't understand why \chapter{Foreword} should produce "Chapter 1.................01" (without "Foreword") in the table of contents, and what "///////" in the other entries should mean (such actual symbols or dummy characters as place-holder for titles).

It would be good to post code you really mean (your code doesn't even contain the command \tableofcontents) and a better description. Even a hand-made drawing would be good.

Stefan
LaTeX.org admin
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Custom Chapter Name For Just One Entry

Post by AleCes »

You're right I'm sorry about my sloppiness :oops:

Yeah, ///// stands for dummy characters as place-holders for titles. Anyway, tomorrow I shall draw a sketch of what I want and post it here.

Bye and thanks a lot for your patience! ;)
Post Reply