Page LayoutMaking Number Page disappear

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Making Number Page disappear

Post by marie2011 »

Dear forum members,

I was wondering if you could help me with the next problem I encountered. The page number in the first page (Parte I / Estado de la cuestión) should not appear. I have been trying to solve the problem with \thispagestyle{empty} // \pagestyle{empty}, but unfortunately it does not work. Here you have my minimal working example:

Code: Select all

\documentclass[
  12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
  bib=totoc,        % <= recommended
  toc=listof,
  numbers=noenddot
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{natbib}
\usepackage{emptypage}
\begin{document}
\part{Estado de la cuestión}
\label{part:estado-de-la}
\section*{Introducción}
\label{sec:introduccion-13}
In einem Land, in dem trotz Wirtschaftsbooms
jedes zweite Kind unter fünf Jahren unterernährt ist, brach dieser
Film das Tabu des Unglücks der Glückseligen. 
\end{document}
Many thanks in advance.

Regards,

Marie

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Making Number Page disappear

Post by Stefan Kottwitz »

Hi Marie,

you can redefine the part page style:

Code: Select all

\renewcommand*{\partpagestyle}{empty}
Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Re: Making Number Page disappear

Post by marie2011 »

Hello Stefan,

Many thanks for your prompt answer. Everything works fine now. I was wondering if it is possible to make the page number disappear in the main index.

Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Making Number Page disappear

Post by Stefan Kottwitz »

Do you mean the table of contents? Or the keyword index?

It should work with \pagestyle{empty} before. And in case of the TOC, additionally write

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{empty}}
at the beginning to change also the first (plain) page.

Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Making Number Page disappear

Post by marie2011 »

Hello Stefan,

Sorry, I meant the TOC.

That is what I did, but I assume I am doing something wrong since it does not work.

Code: Select all

\documentclass[
  12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
  bib=totoc,        % <= recommended
  toc=listof,
  numbers=noenddot
]{scrreprt}


\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{natbib}
\usepackage{emptypage}



\addto\captionsspanish{%
%\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand*{\partpagestyle}{empty}}



\pagenumbering{arabic}
 \ifpdf
  \tableofcontents



\begin{document}
\part{Estado de la cuestión}
\label{part:estado-de-la}

\addtocontents{toc}{\protect\thispagestyle{empty}}

\section*{Introducción}
\label{sec:introduccion-13}
In einem Land, in dem trotz Wirtschaftsbooms
jedes zweite Kind unter fünf Jahren unterernährt ist, brach dieser
Film das Tabu des Unglücks der Glückseligen. Das sind jene, die sich
nach etlichen Schuljahren ganztägigen Paukens, zusätzlichen
abendlichen coaching classes und zwei Jahren disziplinierter
Vorbereitung durch einen engen Flaschenhals quetschen: die
Abschlussprüfung an der Schule und die fast gleichzeitige
Aufnahmeprüfung für eine Karriere an den Technologie-Instituten oder
in der Bürokratie.
\end{document}

Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Making Number Page disappear

Post by Stefan Kottwitz »

The MWE is not compilable, as \ifpdf is unknown and \tableofcontents is in the preamble, where it doesn't work. Very good that you post an MWE, but always test it yourself to see if it's relevant.

I meant it this way:

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{empty}}
\pagestyle{empty}% switching to empty
\tableofcontents
\pagestyle{scrheadings}% or whatever, back to normal
Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Making Number Page disappear

Post by marie2011 »

Hello Stefan,

Many thanks for your answer. Sorry, this MWE works. I assume I am doing something wrong, since I am not getting what I was expecting. That is what I have:

Code: Select all

\documentclass[
  12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
  bib=totoc,        % <= recommended
  toc=listof,
  numbers=noenddot
]{scrreprt}


\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{natbib}
\usepackage{emptypage}


\begin{document}




\tableofcontents


\part{Estado de la cuestión}
\label{part:estado-de-la}

\addtocontents{toc}{\protect\thispagestyle{empty}}
\pagestyle{empty}% switching to empty
\tableofcontents
\pagestyle{plain}

\section*{Introducción}
\label{sec:introduccion-13}


In einem Land, in dem trotz Wirtschaftsbooms
jedes zweite Kind unter fünf Jahren unterernährt ist, brach dieser
Film das Tabu des Unglücks der Glückseligen. Das sind jene, die sich
nach etlichen Schuljahren ganztägigen Paukens, zusätzlichen
abendlichen coaching classes und zwei Jahren disziplinierter
Vorbereitung durch einen engen Flaschenhals quetschen: die
Abschlussprüfung an der Schule und die fast gleichzeitige
Aufnahmeprüfung für eine Karriere an den Technologie-Instituten oder
in der Bürokratie.








\cleardoublepage



\chapter{Example}
\label{cha:example}


In einem Land, in dem trotz Wirtschaftsbooms
jedes zweite Kind unter fünf Jahren unterernährt ist, brach dieser
Film das Tabu des Unglücks der Glückseligen. Das sind jene, die sich
nach etlichen Schuljahren ganztägigen Paukens, zusätzlichen
abendlichen coaching classes und zwei Jahren disziplinierter
Vorbereitung durch einen engen Flaschenhals quetschen: die
Abschlussprüfung an der Schule und die fast gleichzeitige
Aufnahmeprüfung für eine Karriere an den Technologie-Instituten oder
in der Bürokratie.
\end{document}
The number in "Estado de la cuestión" of the TOC should not appear. I was wondering if you know if there is something missing.


Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Making Number Page disappear

Post by Stefan Kottwitz »

Now I understand: you don't just want to remove the page number of the TOC pages, but you would like to remove all page numbers in the TOC entries - is this correct?

Btw. it's a bit strange to me - a TOC is for lookup, that's why there are page numbers. It's usually not a simple list ("look what sections I've done but I don't tell you where you find it in the book") but it's for finding the sections. Take 10 books from your shelf - how many of them have a TOC without page numbers for the entries?

Stefan
LaTeX.org admin
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Making Number Page disappear

Post by marie2011 »

Hello Stefan,

Many thanks for your answer. I do not want to remove all pages in the TOC, only the one which appears with "Estado de la cuestión". The other ones will not be deleted.

Many thanks in advance.

Regards,

Marie
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Making Number Page disappear

Post by Stefan Kottwitz »

A quick trick for hiding part entry page numbers:

Code: Select all

\makeatletter
\setkomafont{partentrypagenumber}{\hspace*{\fill}\@gobble}
\makeatother
Stefan
LaTeX.org admin
Post Reply