![如何用罗马数字开始前言?](https://linux22.com/image/452498/%E5%A6%82%E4%BD%95%E7%94%A8%E7%BD%97%E9%A9%AC%E6%95%B0%E5%AD%97%E5%BC%80%E5%A7%8B%E5%89%8D%E8%A8%80%EF%BC%9F.png)
我的 pdf 的编号不是以罗马数字开头的,原则上,罗马数字与前言相对应。我该如何解决这个问题?这是我的 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
正如@egreg 正确建议的那样,\frontmatter 必须放在 \maketitle 之前。