General[toc] how to add Chapter before 1.introduction in toc

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

[toc] how to add Chapter before 1.introduction in toc

Post by chao »

by default the toc formed like this

NameOf1stChapter
1. Introduction..................1
1.1 xxx.............................2

How to change it to

CHAPTER 1--NameOf1stChapter...........1
1. Introduction.........................................1
...

I used
\renewcommand{\cftchappresnum}{CHAPTER }
However, it overlaps with the NameOf1stChapter

Thanks a lot

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

[toc] how to add Chapter before 1.introduction in toc

Post by Stefan Kottwitz »

Hi chao,

perhaps try like this, untested:

Code: Select all

\renewcommand*\cftchappresnum{\MakeUppercase{\chapapp}~}
\settowidth{\cftchapnumwidth}{\cftchappresnum}
\renewcommand{\cftchapaftersnumb}{\qquad}
...
% perhaps for the appendix:
\addtocontents{toc}{%
\protect\renewcommand*\protect\cftchappresnum{\MakeUppercase{\appendixname}~}}
\appendix
...
Stefan
LaTeX.org admin
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

Re: [toc] how to add Chapter before 1.introduction in toc

Post by chao »

:lol:
it works.
I only changed \chapapp to "chapter"

a following question is how to add "...." to link the "chapter 1. introduction" to page number "1" in toc?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

[toc] how to add Chapter before 1.introduction in toc

Post by Stefan Kottwitz »

Hi chao,

write

Code: Select all

\renewcommand*\cftchapdotsep{\cftdotsep}
Stefan
LaTeX.org admin
chao
Posts: 20
Joined: Tue Jun 17, 2008 5:52 pm

Re: [toc] how to add Chapter before 1.introduction in toc

Post by chao »

you are my savor
sivals
Posts: 8
Joined: Mon Jul 27, 2009 6:12 pm

Re: [toc] how to add Chapter before 1.introduction in toc

Post by sivals »

Hi

as per dept. requirement, i want similar to this
CHAPTER 1 Introduction...........1
1. Introduction..................1
sivals
Posts: 8
Joined: Mon Jul 27, 2009 6:12 pm

Re: [toc] how to add Chapter before 1.introduction in toc

Post by sivals »

Hi

as per dept. requirement, i want similar to this
CHAPTER 1 Introduction...........1
1.1 Introduction.........1

I am using book class. Please any one can help me to solve this problem.
i used following command but no use
\renewcommand*\cftchappresnum{\MakeUppercase{\chapapp}~}
\settowidth{\cftchapnumwidth}{\cftchappresnum}
\renewcommand{\cftchapaftersnumb}{\qquad}
i am getting error message. thank you for your help.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

[toc] how to add Chapter before 1.introduction in toc

Post by gmedina »

Hi,

some advise has already been given in your post in this other thread.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply