[Tex/LaTex] Italic roman page numbering in frontmatter

front-matteritalicmemoirpage-numbering

I'm using the memoir documentclass, and I would like to have roman page numbering, in the front matter, in italic. Does anyone know how to do it or can reference me something to read?

P.S. I am looking just for italicising the roman page numbering of the preface and not for patching multiple things (I'd like to add only what I understand, and since I am a newby, I understand just a little)

Best Answer

A simple way to make this happen is to redefine \thepage with \textit{...} command inside \frontmatter and reset to upright after \mainmatter command. See below example:

\documentclass{memoir}

\usepackage{lipsum}

\begin{document}

\frontmatter
%% Making italic page number in frontmatter
\def\thepage{\textit{\roman{page}}}

\chapter{Preface}
\lipsum

\mainmatter
%% Making upright page number in mainmatter
\def\thepage{\arabic{page}}

\chapter{One}
\lipsum
\end{document}