7

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".

2 Answers 2

8

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}
8

You can simply redefine \thepage using the page counter and prepending a new counter represented using Roman numerals:

\documentclass{article}
\usepackage{lipsum}

\newcounter{mycntr}
\stepcounter{mycntr}
\renewcommand\thepage{\Roman{mycntr}.\arabic{page}}

\begin{document}
\pageref{sec:one} \pageref{sec:two} \pageref{sec:three} \pageref{sec:four}

\section{Test}\label{sec:one}
\lipsum[1-6]

\section{Test}\label{sec:two}
\lipsum[1-6]

\stepcounter{mycntr}
\section{Test}\label{sec:three}
\lipsum[1-6]

\stepcounter{page}
\section{Test}\label{sec:four}
\lipsum[1-6]

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .