General ⇒ no page number in table of contents
Re: no page number in table of contents
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
no page number in table of contents
so use both:
Code: Select all
\pagestyle{empty}
\addtocontents{toc}{\protect\thispagestyle{empty}}
\tableofcontents
Stefan
no page number in table of contents
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: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
no page number in table of contents
Code: Select all
\tableofcontents
\cleardoublepage
\pagestyle{fancy}
Stefan
Re: no page number in table of contents
With the addition of \cleardoublepage everything worked perfectly. Thank you very much for your suggestions! Best regards,
Giacomo