[Tex/LaTex] Start page numbering from first page

page-numberingtitling

I have found that in books, there are a bunch of pages before the start of the actual content, such as a half-title, a copyright page, the table of contents, perhaps a dedication, etc.

I tried to create such a book with LaTeX, but the page numbering got me. In the real books I checked, these pages are also counted and the first page of the first chapter corresponds to this number.

However, in this MWE, the first chapter's page has number 3. I suppose this is because the titlepage environment resets the counter? Also, all empty pages before have numbering (unless I manage to explicityle set \thispagestyle{empty}), but using lower-case roman numbers.

What is the proper way to do this? Sorry for the ugly code. Thank you in advance!

\documentclass[12pt]{book}

\usepackage{titling}

\title{Minimal Working Example}
\author{John Doe}

\begin{document}

%%% FRONT MATTER %%%
\frontmatter

% half-title
\thispagestyle{empty}
\begin{center}
    \Large
    \thetitle
\end{center}

% empty page
\newpage
\thispagestyle{empty}

% full title
\begin{titlepage}
    \begin{center}
        \vspace*{5em}

        \Large\theauthor

        \vspace*{2em}

        \Huge\thetitle

        \vspace*{\fill}
    \end{center}
\end{titlepage}

% copyright
\thispagestyle{empty}
\vspace*{\fill}
\copyright\ \theauthor, \the\year

% dedication
\newpage
\thispagestyle{empty}
\begin{center}
    \itshape
    \vspace*{5em}
    To Jane Doe.
\end{center}

% table of contents
\tableofcontents

% preface
\chapter*{Preface}

This is some preface text.


%%% MAIN MATTER %%%
\mainmatter

\part{First Part}

\chapter{First Chapter}

This is the first chapter.

\chapter{Second Chapter}

Another chapter.

\end{document}

Best Answer

You have to make a few changes:

  1. make \frontmatter to use arabic numbers;
  2. make \mainmatter not to reset numbering;
  3. avoid titlepage, because it resets the page numbering.
\documentclass[12pt]{book}

\usepackage{titling,emptypage}

\makeatletter
% don't use roman numbers in the front matter
\renewcommand{\frontmatter}{\cleardoublepage\@mainmatterfalse\pagenumbering{arabic}}
% don't reset page numbering at \mainmatter
\renewcommand{\mainmatter}{\cleardoublepage\@mainmattertrue}
\makeatother


\begin{document}

\title{Minimal Working Example}
\author{John Doe}

%%% FRONT MATTER %%%
\frontmatter

% half-title
\thispagestyle{empty}
\begin{center}
    \Large
    \thetitle
\end{center}

% empty page
\cleardoublepage

% full title
\begin{center}
\thispagestyle{empty}

\vspace*{5em}

\Large\theauthor

\vspace*{2em}

\Huge\thetitle

\vspace*{\fill}

\end{center}

% copyright
\clearpage
\thispagestyle{empty}
\vspace*{\fill}
\copyright\ \theauthor, \the\year

% dedication
\clearpage
\thispagestyle{empty}
\begin{center}
    \itshape
    \vspace*{5em}
    To Jane Doe.
\end{center}

% table of contents
\tableofcontents

% preface
\chapter*{Preface}

This is some preface text.


%%% MAIN MATTER %%%
\mainmatter

\part{First Part}

\chapter{First Chapter}

This is the first chapter.

\chapter{Second Chapter}

Another chapter.

\end{document}

Now the first chapter has page number 13.

enter image description here

If you really need titling and titlepage, you also need to modify titlepage so it doesn't reset the numbering. However, titlepage does essentially nothing, except doing \cleardoublepage, setting one column format, issuing \thispagestyle{empty} and resetting the page number at start and end.