remove page headers of table of contents

2,861 views
Skip to first unread message

yzymat

unread,
Jul 18, 2009, 9:32:31 PM7/18/09
to LaTeX Users Group
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).

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

or


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

Peter Flynn

unread,
Jul 20, 2009, 6:22:12 PM7/20/09
to latexus...@googlegroups.com
On Sun, Jul 19, 2009 at 2:32 AM, yzymat <yzy...@gmail.com> wrote:

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).

\makeatletter
\renewcommand\tableofcontents{%
  \section*{\contentsname}% or \chapter* but that looks ugly
  \pagestyle{plain}%
  \@starttoc{toc}}
\makeatother

and then add \pagestyle{fancy} immediately after the first \chapter{} (or whatever causes the next newpage after the ToC has ended) so that it goes back to your fancy style.

///Peter
 
Reply all
Reply to author
Forward
0 new messages