Page Numbering with Roman and Arabic Numerals in LaTeX

November 27, 2011 in LaTeX

Working on a university course final hand-in the other day I discussed with a couple of friends at uni how one would go about the following in LaTeX:

  • not numbering the frontpage
  • numbering the table of contents (TOC) with roman numerals
  • numbering the remaining pages with arabic numerals

That evening I got an e-mail from one of them (Jørgen) who has now done some research. His master thesis template does this “automatically”. It simply defines where the \frontmatter{} begins and where the \mainmatter{} begins.

Trying this in my own article LaTeX threw errors at me. It didn’t know these commands. Some googling made me realise that these are only available in book-like document types, ergo not in the article type. So if you’re using a type that supports this, well then you can stop reading right about now!

If not, then you might be interested in what I found out on google when investigating this further. I’m simply going to put this out there in code which should be pretty self-explanatory:

% frontpage:
\thispagestyle{empty} % to avoid numbering the current page
% note that the page is still counted, so you need to reset the counter properly if that is not intended. If you use \pagestyle, the style will be set for the entire document. Then you will need to set it back with something like \pagestyle{plain} (or something more exotic)

% TOC:
\pagenumbering{roman} % roman numerals
\setcounter{page}{1}  % reset counter

% Regular content:
\pagenumbering{arabic} % arabic numerals}
\setcounter{page}{1} % reset counter

And this works! You can do the same with sections too, but it requires a different approach. Setting the counter value is the same, just replace page by section/subsection/subsubsection. To define the numerals to be used with sections you need to do this redefinition:

\renewcommand \thesection{\roman{section}}
\renewcommand \thesubsection{\roman{section}.\roman{subsection}}
\renewcommand \thesubsubsection{\roman{section}.\roman{subsection}.\roman{subsubsection}}

Et voilà!

Note that if you want big roman numerals (e.g. VI instead of vi) you can use Roman instead of roman.