Preliminaries: I have read through the memoir manual section on ToC many times. While I was able to get many things I wanted done, I was not able to fix the last piece.
I also have consulted prior questions/answers (and there are several on trying to get \part entries formatted in various ways, particularly centered) they have not given me an answer. I do not believe this is a duplicate, despite question title similarity. The other questions/answers include: Centering part entries in toc using memoir, How can I properly center my table of contents?, Customize TOC, center align and italics in memoir, How to center part entries in toc with memoir?, and Memoir: Part contents in TOC in two lines.
The issue: Each part entry should be centered under the ToC heading ("Contents" in bold + italics). I can't get the entries centered.
Each part entry includes the prefix "Part", the part number, a colon, a line break, the title of the part, a space, a centered period, a space, the page number. The word "Part" should be in small caps and the "Part"/space/part number/colon should be in normal font. The part title/centered period/page number should be in boldface. The part title may be multiline. The following image shows the desired end state:
The MWE: This is my current working MWE:
\documentclass[smallroyalvopaper,11pt,twoside]{memoir}
\title{\HUGE{\textbf{Name of Book} \\ \LARGE{\textit{Subtitle of book}}}}
\author{\Large{Author's Name}}
\date{Date Written}
\makeatletter
\renewcommand{\printtoctitle}[1]{\centering\Large\textit{\textbf{Contents}}}
\setpnumwidth{2em}
\setrmarg{4em}
\setlength{\cftpartnumwidth}{0em}
\setlength{\cftpartindent}{0em}
\setlength{\cftbeforepartskip}{12pt}
\renewcommand{\cftpartleader}{}
\cftsetindents{part}{\cftpartindent}{\@pnumwidth}
\renewcommand*{\cftpartname}{}%
\renewcommand*{\cftpartfont}{\normalsize\scshape}%
\renewcommand*{\cftpartaftersnum}{}%
\renewcommand*{\cftpartaftersnumb}{\\}%
\renewcommand*{\cftpartformatpnum}[1]{%
\cftpartformatpnumhook{#1}%
\hbox to \@pnumwidth{\enspace\textperiodcentered\enspace{\cftpartpagefont #1}\hfil}}%
\renewcommand{\cftpartafterpnum}{\cftparfillskip}%
\long\def\@part[#1]#2{%
\M@gettitle{#1}%
\def\f@rtoc{\hfil\bfseries{#1}}
\@nameuse{part@f@rtoc@before@write@hook}%
\phantomsection
\mempreaddparttotochook
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}%
{\protect\partnumberline{\hspace*{5em}\hfil Part~\thepart :\hfil\\}\f@rtoc}%
\mempartinfo{\thepart}{\f@rtoc}{#2}%
\else
\addcontentsline{toc}{part}{\f@rtoc}%
\mempartinfo{}{\f@rtoc}{#2}%
\fi
\mempostaddparttotochook
\partmark{#1}%
{\centering
\interlinepenalty \@M
\parskip\z@
\normalfont
\ifnum \c@secnumdepth >-2\relax
\printpartname \partnamenum \printpartnum
\midpartskip
\fi
\printparttitle{#2}\par}%
\@endpart}
\makeatother
\begin{document}
\maketitle
\clearpage
\tableofcontents*
\mainmatter
\part{This is the First Part Heading}
\part{This is the Second Part Heading which is a Long Heading to Check for Wrap Formatting}
\part{This is the Third Part Heading}
\end{document}
I have tried permutations, iterations, and combinations of the answers in the similar questions. Obviously, none of those have worked: the entries do not center. The current MWE produces the following result:
(Note: hspace is set at 5em based on one of the other questions. tocrmarg = 4em plus 1em for the gap memoir inserts between number and title.) As a side note, the ToC format I'm trying to achieve was used by Jacques Barzun in his book, From Dawn to Decadence. Finally, while there may be places where things could be condensed, if condensing doesn't affect the end result it just "cleans up" the code, I would appreciate it if you would refrain from making those changes. Ultimately, this code is part of a larger project that will be used for pedagogical purposes so being able to walk through line-by-line helps.
Thanks for your assistance.
\LARGE
does not take arguments. thus after\LARGE{text}
the size is still\LARGE
.