4

How to set the right footer of the ToC to empty?

I've tried this way, but it hasn't resolve the issue :

\documentclass[12pt,english]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\makeatletter
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@
    {\raggedleft \reset@font
    \scshape \vphantom{\@chapapp{} \thechapter}
    \par\nobreak}%
  \par\nobreak
  \vspace*{30\p@}
  \interlinepenalty\@M
  \usefont{OT1}{ptm}{b}{n}
  {\raggedright \Huge #1}%
  \par\nobreak
  \par\nobreak
  \vskip 45\p@
}}
\makeatother

\rfoot{\thepage}
\begin{document}
\thispagestyle{empty}\tableofcontents{}
\thispagestyle{empty}\listoffigures
\thispagestyle{empty}\listoftables
\end{document}

Any brilliant idea, please?

dgs
  • 1,637

2 Answers2

4

The problem is that you need to \pagestyle{empty} for the ToCs, and as well to suppress the effect of \thispagestyle of the command \chapter* called by them:

\documentclass[12pt,english]{report}
\usepackage{fancyhdr}
\makeatletter
\def\@makeschapterhead#1{%
  \vspace*{10\p@}%
  {\parindent \z@
    {\raggedleft \reset@font
    \scshape \vphantom{\@chapapp{} \thechapter}
    \par\nobreak}%
  \par\nobreak
  \vspace*{30\p@}
  \interlinepenalty\@M
  \usefont{OT1}{ptm}{b}{n}
  {\raggedright \Huge #1}%
  \par\nobreak
  \par\nobreak
  \vskip 45\p@
}}
\makeatother
\fancyfoot{}
\fancyfoot[R]{\thepage}
\begin{document}

\pagestyle{empty}
\begingroup % make the following \let local
\makeatletter
\let\thispagestyle\@gobble % suppress \thispagestyle
\makeatother
\tableofcontents
\listoffigures
\listoftables
\endgroup
\clearpage % to make the following \pagestyle effective at the right page
\pagestyle{fancy}

\chapter{First chapter}
Dummy text.

\end{document}
yo'
  • 51,322
4

If you load the tocloft package, you could issue the command

\tocloftpagestyle{empty}

to suppress the display of page numbers in the table of contents, list of figures, and list of tables.

You can load the tocloft package with the option titles to leave the form of the headers of the ToC, the LoF, and the LoT unaffected:

\usepackage[titles]{tocloft}
\tocloftpagestyle{empty}
Mico
  • 506,678
  • sorry but that will change my toc's customized style and it hasn't solved my issue. – dgs May 03 '14 at 16:49
  • I'm sorry (I was talking about the font style and size.) – dgs May 03 '14 at 16:52
  • @dgs Load the package like this: \usepackage[titles]{tocloft}. – Gonzalo Medina May 03 '14 at 16:55
  • @GonzaloMedina - Thanks. I've added this information in the body of my answer. – Mico May 03 '14 at 16:58
  • I'm quite unhappy about this answer not getting accepted. – yo' May 03 '14 at 17:16
  • @tohecz - Thanks. The OP may have been anxious to accept the first answer that more or less met all objectives. In my initial answer I just mentioned the \tocloftpagestyle{empty} as the page numbering issue seemed to be the main concern. It wasn't until after the OP mentioned in a follow-up comment the need to preserve his/her customizations of the \@makeschapterhead macro that I added the part about using the option titles when loading tocloft. – Mico May 03 '14 at 18:17