Page Layoutremove page headers of table of contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
2100
Posts: 4
Joined: Sat Jul 18, 2009 5:42 pm

remove page headers of table of contents

Post by 2100 »

I'm using the fancyhdr package and titlesec, titletoc package, and the conents has 4 pages. But I can't remove the header on the 2d ,3d, 4th page of the contents.
Also I want that footer of the contents contain page number centered and the code affect pages of the contents only(the header on the rest pages of the book must exist).

I have read the following two websites, but it doesn't work.
http://www.latex-community.org/forum/vi ... f=5&t=2161
http://www.latex-community.org/forum/vi ... f=4&t=3436

Many thanks!

Code: Select all

\documentclass[openany]{book} 
\usepackage{fancyhdr} 
\pagestyle{fancy} 
\fancyhf{} 
 \fancyhead[ER]{\leftmark} 
\fancyhead[OL]{\rightmark} 
\fancyhead[EL,OR]{\thepage} 
\renewcommand{\headrulewidth}{0.4pt} 
......... 
 

or

Code: Select all

\documentclass[openany]{book}
\usepackage[pagestyles]{titlesec}
\usepackage{titletoc}
\sethead[][][][]{{}{}{}}
.............

Recommended reading 2024:

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

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

ubpgs
Posts: 5
Joined: Tue Jul 14, 2009 1:59 pm

remove page headers of table of contents

Post by ubpgs »

Add the following to your preamle and modify it to set the headings as you desire.

Code: Select all

\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{%
	\begingroup%
	%>Insert the command to format headings for the table of contents here.
	\oldtableofcontents%
	\clearpage%
	\endgroup%
}
Post Reply