GeneralPage number in ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
krz
Posts: 63
Joined: Thu Jul 22, 2010 5:03 pm

Page number in ToC

Post by krz »

Hi!
I have another problem with my document. The number of the page appears on the first page of ToC (I don't want it, of course), but only when I have at last two page of ToC. When ToC takes only one page, footer and header is clear, but when I extend it on another page the page number appears in the footer.
I use {titlesec} and {fancyhdr}

Code: Select all

\documentclass{book}

\usepackage[
  centering,
  %showframe,
  top=14mm,
  headheight=11pt,
  headsep=12pt,
  includeheadfoot,
  papersize={148mm,210mm},
  text={90mm,150mm},
  dvips=false,
  pdftex=false,
  vtex=false
]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\newcommand{\TheAuthor}{} 
\newcommand{\Author}[1]{\renewcommand{\TheAuthor}{#1}} 
\rhead{\small\TheAuthor}
\newcommand{\TheTitle}{} 
\newcommand{\Title}[1]{\renewcommand{\TheTitle}{#1}} 
\lhead{\small\scshape\TheTitle}
\fancyfoot{}
\fancyhead[RO,LE]{\thepage} 

\usepackage{titlesec}
\titleformat{\chapter}{\normalfont\Large\scshape}{\thechapter}{1em}{}[\vspace{6pt}]

\usepackage{lipsum}


%-------------------------------------------------------------------------

\begin{document}


\newpage
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author1} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author1} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author1}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author2} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author2} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author2}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author3} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author3} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author3}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author4} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author4} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author4}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author5} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author5} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author5}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author6} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author6} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author6}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author7} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author7} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author7}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author8} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author8} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author8}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author9} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author9} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author9}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author10} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author10} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author10}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\setcounter{footnote} {0}\chapter*{{\fontsize{11}{14}\selectfont \normalfont{Author11} \\
{\scshape\Large Title}}}
\addcontentsline{toc}{chapter}{\normalsize\normalfont{Author11} \\ \normalfont\scshape{Title}}
\thispagestyle{empty}
\Author{Author11}
\Title{Title}
\lipsum
\newpage
\thispagestyle{empty}


\end{document}
Thanks for any help.

krz

Recommended reading 2024:

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

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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Page number in ToC

Post by kaiserkarl13 »

Here's why:

Code: Select all

\newpage
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\newpage
\thispagestyle{empty}
The command \thispagestyle only tells LaTeX to stop generating page numbers on the current page. As soon as TeX starts a new page, it reverts. If you want the whole table of contents on unnumbered pages, try this:

Code: Select all

\pagestyle{empty}
\tableofcontents
\clearpage
\pagestyle{plain} % or whatever it was originally
Post Reply