[Tex/LaTex] Page numbering with a mixed Roman numeral-Arabic numeral format

page-numberingroman numerals

How can I create page numbers with a mixed Roman numeral-Arabic numeral (<Roman numeral>.<Arabic numeral>) format?

  • They increment as: "I.1", "I.2", "I.3", etc.
  • The Roman numerals change only when I manually specify an increase.
  • I can manually increment the Roman numeral, without changing the Arabic numeral: "I.30", \stepcounter{pageroman} "II.31", "II.32", "II.33", \stepcounter{pageroman}, "III.34", etc.
  • The Arabic numerals behave just like the page counter (increasing on each page automatically).
  • I can manually change the Arabic numeral, without changing the Roman numeral: "IV.1", "IV.2", \setcounter{pagearabic}{20} "IV.20", "IV.21", etc.
  • Cross-references with pageref display "I.30".

Best Answer

And a bit more LaTeX-y solution, using \pagenumbering (how many people know about this command?)

\documentclass{article}

\makeatletter

\newcounter{pageroman}
\stepcounter{pageroman}

\def\@pageromanarabic{\@Roman\c@pageroman.\@arabic}
\pagenumbering{pageromanarabic}

\makeatother

\begin{document}

lorem ipsum\label{first}\newpage
lorem ipsum\newpage
lorem ipsum\newpage
lorem ipsum\newpage
\stepcounter{pageroman}
lorem ipsum\newpage
lorem ipsum, go to page \pageref{first}\newpage
\end{document}