Text FormattingHow to change fancy header multiple times on table of contents

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ririya
Posts: 2
Joined: Sun Mar 29, 2020 5:48 am

How to change fancy header multiple times on table of contents

Post by ririya »

Hi everybody, I'm using my university's template and there seems to be a bug in it. They require that the table of contents show different left headers depending on the section. The style file defines that the header should be CHAPTER on subsequent pages, however it is also showing CHAPTER in the list of tables, instead of TABLE. Where should I modify it?

Thanks!

example.png
example.png (38.76 KiB) Viewed 2408 times
This is on the .sty file:

Code: Select all

\newcommand{\cftlabel}{CHAPTER}
%
% Get rid of the header underline.
\renewcommand{\headrulewidth}{0pt}
%
% Get the header on subsequent pages right.
\renewcommand{\@cfttocstart}{ 
\newgeometry{top=1.0in,hmargin=1.25in,height=9.0in,
includehead,includefoot,letterpaper}%,showcrop,showframe}

\doublespace
\pagestyle{fancyplain}
\afterpage{\lhead{\cftlabel}\rhead{Page}}
This is the table of contents section:

Code: Select all

\tableofcontents
\addtocontents{toc}{~\hfill Page\par}
\newpage
\addcontentsline{toc}{part}{LIST OF TABLES}
\listoftables
\addtocontents{lot}{Table~\hfill Page \par}
\newpage
\addcontentsline{toc}{part}{LIST OF FIGURES}
\listoffigures
\addtocontents{lof}{Figure~\hfill Page \par}
\newpage

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

mthakur4
Posts: 1
Joined: Fri Apr 10, 2020 8:54 am

How to change fancy header multiple times on table of contents

Post by mthakur4 »

Just add
\renewcommand{\cftlabel}{Table}
on the line before \listoftables and add
\renewcommand{\cftlabel}{Figure}
on the line before \listoffigures
Post Reply