Hi Stefan,
thank you very much for your answer! Unfortunately I gave you a misleading explanation of my problem: I was referring to the bottompage numbering of the TOC! Usually in the standard text I solve the problem with the
\pagestyle{empty}
syntax but in the case of TOC it doesn't work. I then tried with the command line you suggested
\addtocontents{toc}{\protect\thispagestyle{empty}}
and it works indeed but only for the bottompage numbering of the first two pages (of four) of the TOC. I would like, if possible, to remove the bottompage numbering for all the four pages of the TOC.
Sorry for the misunderstanding,
Giacomo
General ⇒ no page number in table of contents
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
no page number in table of contents
Hi Giacomo,
so use both:
\pagestyle cares for all pages except the first one, the first one has usually plain page style, as chapter starting pages, \thispagestyle cares for this first page.
Stefan
so use both:
Code: Select all
\pagestyle{empty}
\addtocontents{toc}{\protect\thispagestyle{empty}}
\tableofcontents
Stefan
LaTeX.org admin
no page number in table of contents
Hi Stefan,
I tried the code you suggested me but it did not work... I'm writing here my entire code, I'm likely to be doing something wrong without realizing:
Thank you very much,
Giacomo
I tried the code you suggested me but it did not work... I'm writing here my entire code, I'm likely to be doing something wrong without realizing:
Code: Select all
\documentclass[12pt,openright]{book}
\usepackage{times}
\usepackage[a4paper,margin=1in,twoside,nohead]{geometry}
\geometry{lmargin=1.5in}
%(...) Other packages here
\onehalfspacing %Serve per interlinea 1.5
\begin{document}
\pagestyle{empty}
\makeatletter
\renewcommand\part{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
\makeatother
\pagestyle{empty} \addtocontents{toc}{\protect\thispagestyle{empty}}
%Does not work!
\tableofcontents
\pagestyle{fancy}
\renewcommand\headrulewidth{0pt}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhead{} \fancyfoot{} \fancyfoot[CO,CE]{\bfseries\thepage}
\frontmatter
\include{Intro}
\mainmatter
%...etc
Giacomo
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
no page number in table of contents
In that code part \pagestyle{fancy} affects the last page of the table of contents. Begin a new page before you change the pagestyle, such as
If that doesn't work for you, post a compilable example which produces the undesired numbering, as the code above cannot be tested, when I make it testable it works fine after \cleardoublepage or \clearpage between \tableofcontents and \pagestyle{fancy}.
Stefan
Code: Select all
\tableofcontents
\cleardoublepage
\pagestyle{fancy}
Stefan
LaTeX.org admin
Re: no page number in table of contents
Hi Stefan!
With the addition of \cleardoublepage everything worked perfectly. Thank you very much for your suggestions! Best regards,
Giacomo
With the addition of \cleardoublepage everything worked perfectly. Thank you very much for your suggestions! Best regards,
Giacomo