3

I'm trying to supress page numbering in the table of contents, list of figures and list of tables. If they have more than one page, subsequent pages should have no page numbering also, but they must still count as pages, for when page numbering actually starts.

I was hoping if you guys could help me out. Since I had no success until now, I don't even have an MWE, but here are some of the things I've already tried:

\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}{\pagestyle{empty}\oldtableofcontents}

or, with the tocloft package:

\renewcommand{\cfttoctitlefont}{\pagestyle{empty}\clearpage}
\renewcommand{\cftloftitlefont}{\pagestyle{empty}\clearpage}
\renewcommand{\cftlottitlefont}{\pagestyle{empty}\clearpage}

Edit: I am trying to add this as part of my university's TeX class, which is hosted on CTAN and our GitHub page (I suggest you check the latter, I just fixed it). All the documentation is written in Portuguese, but you can see the cls and the manual, which was done using the class file. It is based on the report class.

I was able to fix some things by implementing Gonzalo's answer, i.e. by adding

\tocloftpagestyle{empty}

to the class and surrounding the calls for my lists with a call for \pagestyle{empty}. But the ToC still shows the page numbers after the first page (you can see it in our GitHub manual, page 15).

  • 1
    If an MWE required success, what would be the point of ever posting one in a question? An MWE shows what you've tried and provides a starting point for helpers. It doesn't need to solve the problem you are asking about. The lack of one here makes it more difficult for people to provide good answers. (Which class you are using is highly relevant, for example.) – cfr Feb 2 '15 at 2:26
6

Using tocloft, add

\tocloftpagestyle{empty}

to have the first page of the ToC, LoF and LoT with empty style; use \pagestyle{empty} in a group containing the lists for successive pages:

\documentclass{report}
\usepackage{tocloft}

\tocloftpagestyle{empty}

\begin{document}

\clearpage    
{
\pagestyle{empty}
\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage
}

\section{Test section}
\subsection{Test subsection}
\section{Test section}
\subsection{Test subsection}
\section{Test section}

\end{document}

Without packages, one can do something like

\documentclass{report}

\makeatletter
\let\ps@mystyle\ps@plain %HERE
\let\ps@plain\ps@empty
\makeatother

\begin{document}

\pagestyle{empty}
\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage

\makeatletter
\let\ps@plain\ps@mystyle %HERE
\makeatother
\pagestyle{plain}

\section{Test section}
\subsection{Test subsection}
\section{Test section}
\subsection{Test subsection}
\section{Test section}

\end{document}

In the lines marked % HERE, change plain to the default page style for "regular" pages.

  • Thanks, that worked for all my lists that have only one page. I just edited the question to show the results for more than one page. – Douglas De Rizzo Meneghetti Feb 2 '15 at 6:03
0

I was able to fix my problem by following the steps in this answer.

Since I am creating a class, I renewed the \tableofcontents command to look like the following:

\renewcommand{\tableofcontents}{\part*{\contentsname}\pagestyle{empty}\@starttoc{toc}\clearpage\pagestyle{fancy}}

(You can ignore \part*{\contentsname}, it's part of my class' style.)

  • \pagestyle{empty} removes page numbering;
  • \@starttoc{toc} prints my table of contents (or whichever list I want to print);
  • \clearpage flushes everything that hasn't already been printed. Every command that comes after this iwll take effect in a new, blank page;
  • \pagestyle{fancy} reinstates the fancy style I created using the fancyhdr package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.