4

I want to start the page numbers with 1 on my table of contents, but I do not want to show page numbers.

I can do this with \pagenumbering{gobble}.

After the toc, I want to show the numbers with arabic numerals but I do not want to reset the page count. How can I do this?

I have a book on latex that tells me to set the page counter to some other value if I want to start with another value, like so:

\setcounter{page}{some_number_here}

But this doesn't work, because the counter, that holds the value to which I want to set the page counter is the page counter itself, which just got reset to 1.

How can I start showing page numbers without resetting their value?

minimal working example:

\documentclass[a4paper, 12pt, titlepage]{article}

\usepackage[utf8]{inputenc}
\usepackage[german]{babel}

\begin{document}
\pagenumbering{gobble}
\tableofcontents
There is no page number on this page, great!
\clearpage
\pagenumbering{arabic}
\section{A}
This should not be the first page, 
just the first page that displays the numbers.
In this example, this should be page 2
\clearpage
\section{B}
text
\clearpage
\section{C}
text
\end{document}
  • \renewcommand{\thepage}{\arabic{page}} at the right place should do – user31729 Jun 8 '15 at 19:19
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jun 8 '15 at 19:27
  • 2
    Hiding the page number is best done with page styles. You'll have big problems with hyperref if you use \pagenumbering{gobble}. What document class are you using? – egreg Jun 8 '15 at 19:32
  • @ChristianHupfer thank you. You already answered my question, please post it as an answer. I'm rather new here and agree and understand that an MWE is necessary, so I added it to my question. Is that how an MWE should look like? Should I include what software I use to compile it? Also greetings to Black Forest, if only I had a teacher who taught me tex back in the day when I was in school... – null Jun 8 '15 at 19:44
  • @null: Alright ... but egreg is right: Hidding/displaying should be done with \pagestyle, not with gobble – user31729 Jun 8 '15 at 19:47
3

Hidding/displaying page numbers/headers/footers should be done with page styles, such as empty or plain (or more sophisticated ones).

If article class is used, then no explicit redefinition of \thepage to \arabic{page} is necessary, but in the case of book and \frontmatter, the ToC would be displayed with roman figures, so this redefinition might be necessary.

\pagenumbering{...} always resets the page counter.

\documentclass[a4paper, 12pt, titlepage]{article}

\usepackage[utf8]{inputenc}
\usepackage[german]{babel}

\begin{document}
\pagestyle{empty}  % No page numbers/headers/footers
\tableofcontents
There is no page number on this page, great!
\clearpage
\pagestyle{plain} % restore the plain style
%\renewcommand{\thepage}{\arabic{page}}  % Setting the page output to arabic   -- not necessary, unless `book` class and `\frontmatter` is used.

\section{A}
This should not be the first page, 
just the first page that displays the numbers.
In this example, this should be page 2
\clearpage
\section{B}
text
\clearpage
\section{C}
text
\end{document}

enter image description here

  • 2
    There's no need to redefine \thepage – egreg Jun 8 '15 at 19:52
  • @egreg: Right... I confused it with the case when roman/Roman figures were used for the ToC. – user31729 Jun 8 '15 at 19:54
  • I was a little worried already that \pagenumbering{gobble} which I found online isn't included in the big LaTex book I have. \pagestyle seems to be a very clean and standard way to achieve my goal. – null Jun 8 '15 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.