LaTeX forum ⇒ Community talkAdd “chapter” word into TOC using tocbibind package

General discussion about this LaTeX community.
Please no LaTeX topics here! Just community topics!
Ahm3dsay3d
Posts: 1
Joined: Fri Jul 12, 2019 10:13 pm

Add “chapter” word into TOC using tocbibind package

Postby Ahm3dsay3d » Fri Jul 12, 2019 10:24 pm

Hello,
I am tired of not successfully doing it right !! I am working on my thesis and i am using this template https://github.com/kks32/phd-thesis-template/. However, there are some changes i need to implement and i could not successfully do it myself.
1. I need to add the word chapter before the chapter number and chapter name in the table of content. I already tried this code before but it added the word chapter before every level-1 heading and i want it to be limited to only main chapters

\makeatletter
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 1.0em \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\settowidth{\@tempdimb}{\normalsize\bfseries \chaptername~}%
\advance\leftskip by \@tempdimb
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@tempdima
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
\chaptername~#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\makeatother



2. In chapters first pages, there is no page numbers and i want the page number to be visible at the top right of the page...

Return to “Community talk”

Who is online

Users browsing this forum: No registered users and 4 guests