I like to have my chapter, section and subsection headings in small caps with no capitalised first letters, e.g. written as 'chapter heading name' rather than 'Chapter Heading Name' in the code itself. However, using default settings this translates in the table of contents as, obviously, 'chapter heading name'.
I am aware I could likewise use small caps in the table of contents but I wish to revert back to normal, capitalised text. I am having trouble doing this. I found that you can use \usepackage{mfirstuc} and then use the command \capitalisewords in the \titlecontents{chapter}, \titlecontents{section} and \titlecontents{subsection} options of the titletoc package.
However, the first letter of the first word is not capitalised in the table of contents, yet the other first letters on each subsequent word are! Bizarrely, if I capitalise the first letter of the first word of my chapter, section and subsection headings in the text, then the first letter of the first word of each chapter, section and subsection in the table of contents is now indeed capitalised.
I feel this is something fundamental to how TeX works and I need to tweak something else.
See MWE below:
\documentclass[10pt,a4paper]{book}
\usepackage{titlesec,titletoc}
% In the following I ensure chapter, section and subsection headings are small caps via \scshape command
\titleformat{\chapter}[display]{\sf}{Chapter \thechapter}{2mm}{\scshape}
\titleformat{\section}[hang]{\rm\scshape}{\thesection}{4mm}{}
\titleformat{\subsection}[hang]{\rm\scshape}{\thesubsection}{4mm}{}
\usepackage{mfirstuc} % <--- this package used to capitalise first words via \capitalisewords command
\titlecontents{chapter}
[0pt]
{}
{\contentsmargin{0pt}
\thecontentslabel\enspace
\capitalisewords} % <---
{\contentsmargin{0pt}\large}
{\titlerule*[.5pc]{.}\contentspage}
[]
\titlecontents{section}
[0pt]
{}
{\contentsmargin{0pt}
\thecontentslabel\enspace
\capitalisewords} % <---
{\contentsmargin{0pt}\large}
{\titlerule*[.5pc]{.}\contentspage}
[]
\titlecontents{subsection}
[0pt]
{}
{\contentsmargin{0pt}
\thecontentslabel\enspace
\capitalisewords} % <---
{\contentsmargin{0pt}\large}
{\titlerule*[.5pc]{.}\contentspage}
[]
\begin{document}
\tableofcontents
\chapter{my first chapter} % if changed to 'My first chapter' then it works
\section{my first section} % if changed to 'My first section' then it works
\subsection{my first subsection} % if changed to 'My first subsection' then it works
\end{document}

