0

The numbering of my pdf does not begin with the roman number which, in principle, corresponds to the frontmatter. How could I fix that? This is my MWE:

\documentclass[hidelinks,12pt,twoside,openright,a4paper]{book}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{setspace}
\usepackage{lipsum}

\usepackage{tocloft}

%%%% center part titles
\renewcommand{\cftpartfont}{\hfil\bfseries}
\renewcommand{\cftpartleader}{\hfil}

\setlength{\cftbeforechapskip}{3pt}%espace entre chapitres
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{fancyhdr}

\pagestyle{fancy}
% We don’t want chapter and section numbers
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{} % sets both header and footer to nothing
\fancyfoot{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[CE]{\textit{A title}} % even pages: chapter title
\fancyhead[CO]{\textit\leftmark} % odd pages: book title

\setlength{\headheight}{15pt} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\title{A title}
\author{A name}
\date{}
\maketitle

\tableofcontents
    
\frontmatter
\chapter{A chapter}
\lipsum
    
\mainmatter
\part{How to customize a part section?}
\chapter{Another chapter}
\lipsum

\backmatter

\chapter{A chapter}

\end{document}
1
  • 1
    Don't you want \frontmatter before \maketitle?
    – egreg
    Jul 14, 2022 at 16:05

1 Answer 1

1

As @egreg suggested it rightly, the \frontmatter has to be placed before \maketitle.

1
  • It would be good if you acknowledged the input from @egreg. Jul 14, 2022 at 17:34

You must log in to answer this question.

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