A kind of two numberings of pages

Let's say I have the following .tex file :

\documentclass[titlepage]{amsart}
\begin{document}
\title{The title}
\author{The author}
\maketitle
\tableofcontents
\setcounter{secnumdepth}{3} % to keep track of subsubsections
\setcounter{section}{-1} % to number sections starting from 0
\newpage
\section{Introduction} % the 0 section

Blah blah

\section{First section} % the second section

Blah blah 2

\end{document}


The page numbering start from the page title with arabic numbers, and I would rather like it this way : no numbering up the the first page of the first section (the 0 section), then at this page starts (from 1) a roman numbering which ends at the last page of this 0 section, and after, and until the end, an arabic numeration (starting from 1 at the first page of the second section).

• \texttt{} with a non text does not make sense. – Sigur Feb 23 '15 at 19:04
• Which as nothing to do with my question, but I will remove it anyway, to avoid digressions. – Olorin Feb 23 '15 at 19:06
• Could you requirement be simplified: No page numbers before the start of section 0. From first page of section 0, start with page number i (roman) until the end of the document? Or do you want to restart from i (roman) with every new section? – Werner Feb 23 '15 at 19:08
• @Werner, I understood that the OP wants to change from roman to arabic at the last page of section 0. – Sigur Feb 23 '15 at 19:10
• @Werner Sigur perfectly understood. Roman up to the (an included) last page of section 0 and then (until the end) arabic. As I wrote. – Olorin Feb 23 '15 at 19:16

You can use combinations of \pagenumbering{<style>} \setcounter{page}{1} to adjust the setting of the page number (and reset it to 1 with every new style):

\documentclass[titlepage]{amsart}
\usepackage{lipsum}% Just for this example
\begin{document}
\pagenumbering{gobble}% No page numbering

\title{The title}
\author{The author}
\maketitle

\tableofcontents

\clearpage

\pagenumbering{roman}% roman page numbering
\section{Introduction} % the 0 section

\lipsum[1-50]

\clearpage

\pagenumbering{arabic}% Arabic page numbering
\section{First section} % the second section

\lipsum[1-50]

\end{document}


Note that this might cause problems if you're using hyperref, as you may have duplicate destinations with regards to the title and ToC pages. To keep hyperref happy, you could use the following setup:

\documentclass[titlepage]{amsart}
\usepackage[pdfpagelabels]{hyperref}
\usepackage{graphicx,etoolbox}
\usepackage{lipsum}% Just for this example

\begin{document}
\setcounter{page}{-1}
\title{The title}
\author{The author}
\begingroup
\makeatletter
\let\ps@firstpage\ps@empty
\maketitle

\tableofcontents

\clearpage
\endgroup

\pagenumbering{roman}
\setcounter{page}{1}
\section{Introduction} % the 0 section

\lipsum[1-50]

\clearpage

\pagenumbering{arabic}
\setcounter{page}{1}
\section{First section} % the second section

\lipsum[1-50]

\end{document}


While \pagenumbering{gobble} will gobble \thepage from the visible page numbering, hyperref still uses \thepage for referencing purposes. So, we start the page numbering at a number that will naturally increase to i (roman) at the start of the first section; that is, -1 in this case, and just remove \thepage from the header.

• Thx a lot ! But... (as there's always a but) I'm using hyperref... How would you tweak your code to take a proper use of it into account then ? – Olorin Feb 23 '15 at 19:23
• Thx again ! Works perfectly. – Olorin Feb 23 '15 at 19:45
• @RobertGreen: I'm fixing something with this solution, but will update as soon as possible (and the references to this question). – Werner Feb 23 '15 at 19:46
• Ok, perfect, thx. (Prefered to separate this initial question into itself "edited", and the new one you saw.) – Olorin Feb 23 '15 at 19:47
• Doesn't \pagenumbering always reset the page-counter to 1? – Johannes_B Feb 23 '15 at 20:26