LaTeX specific issues not fitting into one of the other forums of this category.
beyma
Posts: 2
Joined: Tue Feb 26, 2008 5:53 pm

Hi all,

I'm desperate with this issue... My document follows the hepthesis class.
I would like to eliminate the bottom page numbering in the first page of toc, lof and lot.
I've tried \thispagestyle{empty} without success !!

\documentclass[bind,twoside,ams,booktabs,a4paper]{hepthesis}\begin{document} \begin{abstract}\thispagestyle{empty}This is the abstract.\end{abstract}\cleardoublepage % first page of contents always has page number on bottom\tableofcontents\thispagestyle{empty}\cleardoublepage \begin{mainmatter}\pagestyle{fancy}\pagenumbering{arabic}\input{chap1}\input{chap2}\end{mainmatter} \listoffigures\listoftables \bibliographystyle{unsrt}\bibliography{biblio} \end{document}

Any ideas will be highly appreciated !!

Cheers,
Sergio
Last edited by Stefan Kottwitz on Thu Dec 08, 2011 11:54 am, edited 2 times in total.
Reason: code marked

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Refer to the documentation of the fancyhdr package and search for the redefinition oft the plain style (Section 7 - Redefining plain style, p. 7f).

Best regards
ThorstenÂ¹
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

beyma
Posts: 2
Joined: Tue Feb 26, 2008 5:53 pm
Dear Thorsten,

many thanks for the precise hint ! It worked wonderfully.

Regards,
Sergio

stinkinrich88
Posts: 52
Joined: Sat Jun 07, 2008 11:56 am
great, could you let us know how you did it?

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
stinkinrich88 wrote:great, could you let us know how you did it?

That is described in detail in the section of the documentation I mentioned above.

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

stinkinrich88
Posts: 52
Joined: Sat Jun 07, 2008 11:56 am
I meant it would've been really great if beyma had posted his / her solution to help other people and save people's time. Anyway, that document wasn't very specific about the problem---more of a general guide---so here's what I came up with:

\pagestyle{empty} %get rid of header/footer for toc page
\tableofcontents %put toc in
\cleardoublepage %start new page
\pagestyle{plain} % put headers/footers back on
\setcounter{page}{1} %reset the page counter

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
stinkinrich88 wrote:[...] Anyway, that document wasn't very specific about the problem---more of a general guide---so here's what I came up with: [...]

The documentation is very specific about that. Right in the section I mentioned. And the more convenient way would be to follow the suggestions of the fancyhdr documentation.

In principal this is some kind of empty page style.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

just some explanation about the behaviour of the code in the first posting: if the toc has more than one page, a following \thispagestyle cannot affect its first page, only the last. However \thispagestyle can be used in the toc like this:
\addtocontents{toc}{\protect\thispagestyle{empty}}

This way you could do other things too, for example place a pagebreak in the toc, enlarge a toc page or even embed \addcontentsline with \addtocontents inside a list of tables and so on.

Further, if I don't want to use the plain pagestyle but empty instead, I just write
\let\ps@plain\ps@empty

If you want to use that, don't forget \makeatletter ... \makeatother around the line.

Stefan

Dott_JJ
Posts: 4
Joined: Sat Dec 03, 2011 5:44 pm
Hi everybody,

what about deleting ALL the page numbers in TOC? I tried all of your suggestions but they are only useful for the first page. My TOC is at the moment 4 pages long...

Thank you guys

Giacomo

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi Giacomo!

\contentsline produces the page numbers for the table of contents entries, it calles further macros \l@chapter, \l@section etc. It is called like this, in the .toc file:

\contentsline {section}{\numberline {1.1}section title}{page number}

So you could redefine it, doing nothing with that third argument. Just add to your preamble:

\renewcommand*{\contentsline}[3]{\csname l@#1\endcsname{#2}{}}

Stefan