What I do have, is grouped frontmatter entries (chapter-like) in ToC, and the rest of the chapters have larger vertical space.
What I want is to change the
font style of the grouped part to, say, normalfont or italics while keeping
the rest of the entries unchanged. How do I do this?
(In the future I might change entries of the chapters 1 to 3 to small caps or to something other format...)
\documentclass{memoir}
\usepackage{etoolbox}
\setlength{\cftbeforesectionskip}{4pt}
\begin{document}
\tableofcontents
\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\pretocmd{\chapter}{\addtocontents{toc}{\addvspace{16pt}}}{}{}
\chapter{Chapter One}
\section{Section One One}
\section{Section One Two}
\section{Section One Three}
\section{Section One Four}
\chapter{Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\section{Section Two Three}
\chapter{Chapter Three}
\section{Section Three One}
\section{Section Three Two}
\section{Section Three Three}
\section{Section Three Four}
\section{Section Three Five}
\end{document}
This is continuation to the question Change vertical space of chapters temporarly in Table of Contents.
Package etoolbox
is for the grouping the front matter entries.
\renewcommand*{\cftchapterfont}{}
to the preamble and change the\pretocmd...
to\pretocmd{\chapter}{\addtocontents{toc}{\addvspace{16pt}\bfseries}}{}{}
. Only problem is that if the grouped entries should be italics and the rest not, it won't work.