In the following MWE,
\documentclass[12pt]{book}
\usepackage{afterpage}
\usepackage{epigraph}
\usepackage{fancyhdr}
\setlength{\headheight}{27.15pt}
\pagestyle{fancy}
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{-1}%
\newpage}
\newcounter{mycounter}
\setcounter{mycounter}{0}
\begin{document}
\begin{titlepage}
A title\
and its subtitle
\afterpage{\blankpage}
\end{titlepage}
\afterpage{\blankpage}
\pagenumbering{roman}
\indent Copyright \textcopyright\ 2023 The author All rights reserved.
\frontmatter
\newpage
\begin{center}
(\mathit{for \ my \ partner})
\end{center}
\chapter{Preface}
\newpage
\chapter{Acknowledgements}
\newpage
\thispagestyle{empty}
\tableofcontents
\setcounter{tocdepth}{2}
\chapter{Introduction }
\medskip
\setlength{\epigraphwidth}{0.16\textwidth}
\epigraph{An epigraph}
\mainmatter
\chapter{The formal language}
\end{document}
the pagination of the front matter is divided into two groups, and the pattern of counting all pages and paginating only odd pages is not maintained.
How may these problems be resolved?
I would prefer it if all pages in front matter were paginated.
I would like all pages to be with small Roman numeral.
– Frode Alfson Bjørdal May 27 '23 at 21:52\pagenumbering{roman}before\frontmatter, which does again\pagenumbering{roman}. – egreg May 27 '23 at 22:00