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 2688 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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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