1

I am trying to reproduce the ToC style of The Legrand Orange Book with memoir class. I am not an expert in memoir class and managed to look similar except ToC title and Part.

ToC

my MWE goes like this

\documentclass[twoside,openright]{memoir}
% color definition
\usepackage{xcolor}
\definecolor{ocre}{RGB}{243,102,25}

% ToC depth
\setsecnumdepth{subsection}
\maxtocdepth{subsection}

% page style for ToC
\makepagestyle{toc}
\makeevenfoot{toc}{}{}{}
\makeoddfoot{toc}{}{}{}
\makeevenhead{toc}{}{}{}
\makeoddhead{toc}{}{}{}

% New name for title of ToC
\renewcommand{\contentsname}{Contents}
% apply necessary setup before \tableofcontents
\addtodef{\tableofcontents}{\clearpage\pagestyle{toc}}{}

% begin of ToC setup
%% distance between toctitle and the first item of list
\renewcommand*{\aftertoctitle}{\thispagestyle{plain}%
  \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}

%% setup for part
\renewcommand*{\cftpartfont}{\bfseries\Large}
% \renewcommand*{\partnumberline}[1]{\colorbox{ocre!20}{\strut\parbox[c][.7cm]{1.5cm}{\color{ocre!70}\Large\sffamily \bfseries\centering#1}}}
\cftsetindents{part}{0em}{5.0em}

%% setup for chapter
\renewcommand*{\cftchapterfont}{\color{ocre}\bfseries}
\renewcommand*{\cftchapterpagefont}{\color{ocre!60}\bfseries}
\renewcommand*{\cftchapterleader}{%
  \color{ocre!60}\cftdotfill{\cftchapterdotsep}}
\renewcommand*{\cftchapterdotsep}{\cftdotsep}
\cftsetindents{chapter}{0em}{5.0em}

%% setup for section
\renewcommand*{\cftsectionfont}{\bfseries}
\renewcommand*{\cftsectionpagefont}{\bfseries}
% \renewcommand*{\cftsectionleader}{%
%   \cftsectionfont\cftdotfill{\cftsectiondotsep}}
% \renewcommand*{\cftsectiondotsep}{\cftdotsep}
\cftsetindents{section}{0em}{5.0em}

%% setup for subsection
\renewcommand*{\cftsubsectionfont}{\normalfont}
\renewcommand*{\cftsubsectionpagefont}{\normalfont}
% \renewcommand*{\cftsubsectionleader}{%
%   \cftchapterfont\cftdotfill{\cftchapterdotsep}}
% \renewcommand*{\cftsubsectiondotsep}{\cftdotsep}
\cftsetindents{subsection}{0em}{5.0em}


\begin{document}

\frontmatter
\begin{KeepFromToc}
\tableofcontents
\end{KeepFromToc}

\mainmatter

\part{Part One}
\chapter{Text Chapter}
\section{Paragraphs of Text}
\section{Citation}
\section{Lists}
\subsection{Numbered List}
\subsection{Bullet Points}
\subsection{Descriptions and Definitions}

\part{Part Two}

\part{Part Three}

\end{document}

enter image description here

Any advice would be helpful.

0

I have made some additions to your MWE to approach what you appear to want.

% orangetocprob.tex SE 536302 ToC styled like Legrand Orange book

\documentclass[twoside,openright]{memoir}
% color definition
\usepackage{xcolor}
\definecolor{ocre}{RGB}{243,102,25}

% ToC depth
\setsecnumdepth{subsection}
\maxtocdepth{subsection}

% page style for ToC
\makepagestyle{toc}
\makeevenfoot{toc}{}{}{}
\makeoddfoot{toc}{}{}{}
\makeevenhead{toc}{}{}{}
\makeoddhead{toc}{}{}{}

% New name for title of ToC
\renewcommand{\contentsname}{Contents}
% apply necessary setup before \tableofcontents
\addtodef{\tableofcontents}{\clearpage\pagestyle{toc}}{}

% begin of ToC setup
%% distance between toctitle and the first item of list
\renewcommand*{\aftertoctitle}{\thispagestyle{plain}%
  \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}

%% setup for part
\renewcommand*{\cftpartfont}{\bfseries\Large}
% \renewcommand*{\partnumberline}[1]{\colorbox{ocre!20}{\strut\parbox[c][.7cm]{1.5cm}{\color{ocre!70}\Large\sffamily \bfseries\centering#1}}}
\cftsetindents{part}{0em}{5.0em}
\cftpagenumbersoff{part} % PW added
\renewcommand{\cftpartaftersnumb}{\hfil} % PW added

%% setup for chapter
\renewcommand*{\cftchapterfont}{\color{ocre}\bfseries}
\renewcommand*{\cftchapterpagefont}{\color{ocre!60}\bfseries}
\renewcommand*{\cftchapterleader}{%
  \color{ocre!60}\cftdotfill{\cftchapterdotsep}}
\renewcommand*{\cftchapterdotsep}{\cftdotsep}
\cftsetindents{chapter}{0em}{5.0em}

%% setup for section
\renewcommand*{\cftsectionfont}{\bfseries}
\renewcommand*{\cftsectionpagefont}{\bfseries}
% \renewcommand*{\cftsectionleader}{%
%   \cftsectionfont\cftdotfill{\cftsectiondotsep}}
% \renewcommand*{\cftsectiondotsep}{\cftdotsep}
\cftsetindents{section}{0em}{5.0em}
\renewcommand{\cftsectiondotsep}{\cftnodots}  % PW added

%% setup for subsection
\renewcommand*{\cftsubsectionfont}{\normalfont}
\renewcommand*{\cftsubsectionpagefont}{\normalfont}
% \renewcommand*{\cftsubsectionleader}{%
%   \cftchapterfont\cftdotfill{\cftchapterdotsep}}
% \renewcommand*{\cftsubsectiondotsep}{\cftdotsep}
\cftsetindents{subsection}{0em}{5.0em}


\begin{document}

\frontmatter
\begin{KeepFromToc}
\tableofcontents
\end{KeepFromToc}

\mainmatter

\part{Part One}
\chapter{Text Chapter}
\section{Paragraphs of Text}
\section{Citation}
\section{Lists}
\subsection{Numbered List}
\subsection{Bullet Points}
\subsection{Descriptions and Definitions}

\part{Part Two}

\part{Part Three}

\end{document}

I have marked my additions by % PW added.

For part entries I have centered the title and removed the page number. For section entries I have removed the dotted line.

Your Legrand Orange book example does not include Page above the page numbers but you have added it in your MWE. I'm not at all sure how accurately you want to follow the example you gave.

I am colourblind and don't do anything fancy so I leave anything else up to you.

0

This is a memoir-style copy of the part entries for the ToC. The chapter and section entries can be taken from your own code, the first answer or the memoir manual of course. Below is a figure of the output.

enter image description here

\newcommand{\TOCind}{40pt}% indent lmarg-nr

%-----------------------------------------------------------%
%                           PART                            %
\makeatletter%
\setlength{\cftbeforepartskip}%
    {55\p@ \@plus 50\p@ \@minus 20\p@}% vertical sep before part boxes
\newlength{\psep}
    \setlength{\psep}{5pt}% horizontal sep between part-boxes
\cftpagenumbersoff{part}% no pagenr part

\cftsetindents{part}{0pt}{0pt}% indent, numwidth
\renewcommand{\cftpartfont}{\LARGE\sffamily\bfseries\centering}% font chapter

\newcommand{\@mypartnumtocformat}[2]{% #1 number, #2 part title
        \noindent\fboxsep=0pt\fboxrule=0pt%
     {\colorbox{orange!40}{\parbox[c][33pt][c]{\TOCind-\psep}%
        {\cftpartfont\textcolor{orange}{#1}}}% I, II (part nr)
  \hspace*{\psep}% horizontal sep between part-boxes
     \colorbox{orange!80}{\parbox[c][33pt][c]{\textwidth-\TOCind}%
        {\cftpartfont\textcolor{white}% Part I - Title
            {\partname\space\,#1\enspace\textemdash\enspace#2}}}}\par}%

\patchcmd{\@part}%
    {\addcontentsline{toc}{part}%
        {\protect\partnumberline{\thepart}\f@rtoc}}% code to replace
    {\phantomsection\addcontentsline{toc}{part}{\texorpdfstring%
        {\protect\@mypartnumtocformat{\thepart}{\f@rtoc}}%
        {\partname~\thepart---#2}}}{}{}% new code with new part toc format

\makeatother%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.