[Tex/LaTex] Different Page Number Styles

page-numbering

I would like to use roman page numbers (i, ii, iii, etc.) at the beginning of a report I am writing. In the main area of the report, I would like to use Arabic page numbers in the page of pages (1 of XX, 2 of XX, etc.) I am using the article class. I have seen articles of how to use both roman and Arabic format but not with the changes in page numbers. Is this possible?

Best Answer

The article document class, by design, does not provide the convenient directives \frontmatter and mainmatter. However, it's not too difficult to create your desired setup by loading the packages fancyhdr and pageslts.

\documentclass{article}
\usepackage{lipsum} % for filler text

\usepackage{pageslts}
\usepackage{fancyhdr}
\pagestyle{fancy} 
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}

\begin{document}
\pagenumbering{roman} % switch to roman numerals
\cfoot{\thepage} % place page number centered in footer line

\section*{AAA}
\lipsum[1-15] % 2+ pages of filler text

\clearpage % start a new page
\pagenumbering{arabic} % switch to arabic numerals, start over at "1"
\cfoot{\thepage\ of \lastpageref{pagesLTS.arabic}}
% (Use \lastpageref*` if also using the `hyperref` package.)

\section{BBB}
\lipsum[1-20] % 3+ pages of filler text
\end{document}