我想要一个居中对齐的目录。我的 MWE 按照我想要的方式格式化章节,但没有格式化简介?我该如何格式化简介以匹配?
\documentclass{memoir}
\let\ordinal\relax
% TOC title
\makeatletter
\renewcommand{\printtoctitle}[1]{\centering\HUGE\textit{Contents}}
% Chapter
\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterfillnum}[1]{\hspace*{10pt}\huge#1\cftparfillskip\par}
\renewcommand*{\cftchapterfont}{}
\renewcommand\chapternumberline[1]{\hfil\Large\emph{#1}%
\hfil\strut\huge\par\nopagebreak\hfil}
% Document
\begin{document}
\tableofcontents*
\chapter*[Introduction]{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\chapter{Where it All Began}
\chapter{Some More Beginning}
\chapter{Some Drawn-Out Diatribe}
\chapter{Starting to Wrapup}
\chapter{The Insightful Conclusion}
\end{document}
答案1
尝试一下这个代码。
\documentclass{memoir}
\let\ordinal\relax
% TOC title
%\makeatletter
\renewcommand{\printtoctitle}[1]{\centering\HUGE\textit{Contents}}
% Chapter
\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}
\renewcommand{\cftchapterleader}{}
\renewcommand{\cftchapterfillnum}[1]{\hspace*{10pt}\huge#1\cftparfillskip\par}
\renewcommand*{\cftchapterfont}{}
\renewcommand\chapternumberline[1]{\hfil\Large\emph{#1}%
\hfil\strut\huge\par\nopagebreak\hfil}
% Document
\begin{document}
\tableofcontents*
\chapter*[Introduction]{Introduction}
\addcontentsline{toc}{chapter}{\protect\chapternumberline{}Introduction}% changed <<<<<
\chapter{Where it All Began}
\chapter{Some More Beginning}
\chapter{Some Drawn-Out Diatribe}
\chapter{Starting to Wrapup}
\chapter{The Insightful Conclusion}
\end{document}