General ⇒ Problems with \listoffigures\thispagestyle{fancy}
Problems with \listoffigures\thispagestyle{fancy}
i want to create a list of my figures. i use \listoffigures\thispagestyle{fancy} because i have a custom head and tail pagestyle. when the list is only one page big then it works well.
when then number of pages become 2 then my special head will only shown on the second page and on the first page will be shown the normal page-style.
how can i do?
does sb know how to fix this problem?
thx.
Greetings,
Peter
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
Problems with \listoffigures\thispagestyle{fancy}
welcome to the LaTeX Community board!
You can set the pagestyle inside the lof:
Code: Select all
\listoffigures
\addtocontents{lof}{\protect\thispagestyle{fancy}}
Stefan
Re: Problems with \listoffigures\thispagestyle{fancy}
it works.
its reakky a nice community with many information here.
greetings,
peter
-
- Posts: 6
- Joined: Sat Apr 14, 2012 7:53 pm
Problems with \listoffigures\thispagestyle{fancy}
i have the same problem. but the code does not work in my case.
can someone hep me?
thanks
parthiv
Code: Select all
\newpage
\phantomsection\label{lof}
\listoffigures
\addtocontents{lof}{\protect\thispagestyle{fancy}}
\addcontentsline{toc}{chapter}{List of Figures}
\setlength{\cftfigindent}{0pt} % remove indentation from figures in lof
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Problems with \listoffigures\thispagestyle{fancy}
welcome to the board!
Perhaps provide more information about your case. The best would be aprdharamshi wrote:but the code does not work in my case.

Stefan
-
- Posts: 6
- Joined: Sat Apr 14, 2012 7:53 pm
Problems with \listoffigures\thispagestyle{fancy}
I am having trouble of using fancyheader in multipage table of contents and list of figures. I have 2 pages of toc and lof. On the first page of both toc and lof, my fancy header does not work but on the second page it works. So I want fancy header on page 1 of toc and lof.
Then I followed the solution of "Fancyhdr problem with table of contents" and it worked out for toc. I tried following code and it worked.
Code: Select all
\addtocontents{toc}{\protect\thispagestyle{fancy}}
I copied the same for lof but it didn't work out.
Code: Select all
\addtocontents{lof}{\protect\thispagestyle{fancy}}
Code: Select all
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{\nouppercase{\leftmark}}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\documentclass[12pt,a4paper]{report}
\input Macros.tex
\begin{document}
\pagestyle{fancy}
\input Acknowledgement.tex
\input Declaration.tex
\input Abstract.tex
\newpage
\tableofcontents
\addtocontents{toc}{\protect\thispagestyle{fancy}}
\input ch1.tex
\input ch2.tex
\input ch3.tex
\input ch4.tex
\newpage
\bibliographystyle{alpha}
\bibliography{MasterThesis}
\thispagestyle{fancy}
\addcontentsline{toc}{chapter}{Bibliography}
\newpage
\listoffigures
\addtocontents{lof}{\protect\thispagestyle{fancy}}
\setlength{\cftfigindent}{0pt} % remove indentation from figures in lof
\addcontentsline{toc}{chapter}{List of Figures}
\newpage
\listoftables
\thispagestyle{fancy}
\setlength{\cfttabindent}{0pt} % remove indentation from tables in lot
\addcontentsline{toc}{chapter}{List of Tables}
\end{document}
thnnks,
parthiv
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Problems with \listoffigures\thispagestyle{fancy}
place
Code: Select all
\addtocontents{lof}{\protect\thispagestyle{fancy}}
Stefan
-
- Posts: 6
- Joined: Sat Apr 14, 2012 7:53 pm
Re: Problems with \listoffigures\thispagestyle{fancy}
i tried to place it before but it does not work. any other possible solution?
thanks,
parthiv
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Problems with \listoffigures\thispagestyle{fancy}
Stefan
-
- Posts: 6
- Joined: Sat Apr 14, 2012 7:53 pm
Re: Problems with \listoffigures\thispagestyle{fancy}
as you said "\thispagestyle {fancy}" comes at the very end. And surprisingly "\thispagestyle {fancy}" line is missing in .lot file but still it has correct page layout.
thanks,
parthiv