0

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}
  • 1
    No, \mainmatter resets the counter. However you have a \part, and that's your page 1. – campa Aug 2 '19 at 8:29
  • @campa thanks, I didn't realize there's probably no need anyway for \mainmatter and \frontmatter… However, even after removing the two commands it seems that the numbering starts from the titlepage. Now the first ‘content page’ is the 13th page, but the page number says 11. – bp99 Aug 2 '19 at 8:42
  • 1
    Front matter stuff is on pages which are usually numbered with roman figures, and arabic figures start with the "real" content. Your present setup is in my opinion quite correct. The only nuisance are the numbered empty pages, but there are lots of similar questions for that here on the site. – campa Aug 2 '19 at 8:51
  • @campa perhaps this is common in American/English typography, but none of the books I checked followed this format. I am writing my book in Hungarian. – bp99 Aug 2 '19 at 12:13
  • 1
    Ah, well, that was a relevant piece of information :-) – campa Aug 2 '19 at 12:49
2

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.

  • This indeed does the trick, thank you. I only use titling to get the \thetitle and \theauthor macros—is that stupid? Also, I see that you prefer \clearpage to \newpage—why is it better to use the latter? – bp99 Aug 2 '19 at 12:32
1

You could use \setcounter{page}{"any number of your choice"} to manually set the page number of the first page with a page number, see:

https://stackoverflow.com/questions/2377684/manually-define-page-numbers-in-latex

  • Thank you. I did consider this, however it seems to be an unclean, hacky solution. – bp99 Aug 2 '19 at 12:11

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.