[Tex/LaTex] Format fonts for TOC/LOF/LOT with tocloft

formattingsectioningtable of contentstitlesectocloft

my publisher requires me to change the way TOC/LOT/LOF and sections are formatted. Sadly my grasp on LaTeX and possibly on the English language is not firm enough to make heads or tails from the titlesec documentation.

In short I am tasked to have:

  • Chapter titles in Uppercase, 11.2pt, centred
  • Section titles in Uppercase, 10.2pt, centred
  • Subsection titles in normal case 10.2pt, centred
  • Subsubsection titles in normal case, 10.2pt, italics

TOC/LOT/LOF

  • Each name (Table of Content,…) in Uppercase, 11.2pt
  • Chapter titles in Uppercase, 11.2pt
  • Section titles in Uppercase, 10.2pt
  • Subsection titles in normal case 10.2pt
  • Subsubsection titles in normal case, 10.2pt, italics

And a MWE reflecting on what I tried – I have reached the limit of my insights into LaTeX and cannot understand why the changes I undertook seem to be to no avail.

Help is very appreciated.

\documentclass[12pt,a4paper,twoside,openright]{report}
\usepackage[latin1]{inputenc}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{amsmath, amsfonts,amssymb}
\usepackage[titles]{tocloft}
\usepackage[explicit]{titlesec}

%Set depth in TOC
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

%Format of text font size and line spacing
\fontsize{10.2}{11.9}\selectfont

%TODO This is meant to be 11.2 in Uppercase   
\renewcommand{\cftchapfont}{\MakeUppercase{\fontsize{11.9}{11.9}}}

%TODO This is meant to be 10.2 in Uppercase
\renewcommand{\cftsecfont}{\MakeUppercase{\fontsize{10.2}{11.9}}}

%TOOO: This is meant to be 10.2 normal font
\renewcommand{\cftsubsecfont}{\fontsize{10.2}{11.9}} 

%TOOO: This is meant to be 10.2 normal font to be cursive 10.2
\renewcommand{\cftsubsubsecfont}{\fontsize{10.2}{11.9}} 

%TODO: This is meant to be 10.2 normal font to be cursive 10.2
\renewcommand{\cftloftitlefont} {\MakeUppercase{\fontsize{11.9}{11.9} \selectfont}}
\renewcommand{\cftlottitlefont} {\MakeUppercase{\fontsize{11.9}{11.9} \selectfont}}

%Filling lines w/ dots.
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}

\makeatletter
\def\@makechapterhead#1{%
    %%%%\vspace*{50\p@}% %%% removed!
    {\vskip 71.4\p@ %3x(11.9+11.9)
        \parindent \z@ \raggedright \fontsize{11.9}{11.9} \selectfont
        \ifnum \c@secnumdepth >\m@ne
        \fontsize{11.9}{11.9} \centering \selectfont \MakeUppercase{\@chapapp\space \thechapter}:
        %\par
        \nobreak
        %\vskip 11.9\p@
        \fi
        \interlinepenalty\@M
        \fontsize{11.9}{11.9} \MakeUppercase{#1}\par\nobreak
        \vskip 23.8\p@
}}
\def\@makeschapterhead#1{%
    %%%%%\vspace*{50\p@}% %%% removed!
    {\parindent \z@ \raggedright
        \fontsize{11.9}{11.9} \selectfont
        \interlinepenalty\@M
        \fontsize{11.9}{11.9} \selectfont  #1\par\nobreak
        \vskip 23.8\p@
}}


\renewcommand\section{\@startsection {section}{1}{\z@}%
    {44.2pt}% 2x(10.2+11.9)
    {22.1pt}%
    {\centering \fontsize{10.2}{11.9} \selectfont}}% from \Large

\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
    {44.2pt}% 2x(10.2+11.9)
    {22.1pt}%
    {\centering\fontsize{10.2}{11.9} \selectfont}}% from \Large

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
    {44.2pt}% 2x(10.2+11.9)
    {22.1pt}%
    %\noindent
    {\centering \fontsize{10.2}{11.9} \selectfont}}% from \Large
\makeatother



\begin{document}
    % TODO: The headline should be in the same format as chapter font (11.2, uppercase)     
    \tableofcontents 

    % TODO: The headline should be in the same format as chapter font (11.2, uppercase)
    \listoffigures 

    % TODO: The headline should be in the same format as chapter font (11.2, uppercase)
    \listoftables 


    %The following is just filling the document for the TOC/LOT/LOF
    \chapter{Chapter One Title}
    \lipsum[1-4]
    \begin{figure}
        \caption[Figure 1 in chapter 1]{This is figure 1.2}
    \end{figure}
    \lipsum[1-2]
    \section{Section One}
    \lipsum[1-2]
    \subsection{Subsection One}
    \lipsum[1-2]
    \subsubsection{Subsubsection One}
    \lipsum[1-2]
    \begin{table}
        \caption[Table 1 in Chapter 1]{This is table 1.1}
        \begin{tabular}{ l c r }
            1 & 2 & 3 \\
            4 & 5 & 6 \\
            7 & 8 & 9 \\
        \end{tabular}
    \end{table}
    \lipsum
    \begin{figure}
        \caption[Figure 2 in chapter 1]{This is figure 1.2}
    \end{figure}
    \lipsum[1-4]
    \chapter{Chapter Two Title}
    \lipsum
    \chapter{Chapter Three Title}
    \lipsum
\end{document}

Best Answer

As has been mentioned in the comments, you really shouldn't use titlesec and tocloft together. The tocloft package is designed to work with the standard classes, but not with titles modified by titlesec. Since you are using titlesec to format the titles, you should use the accompanying titletoc package (by the same author) to format the TOCs.

Here's a sample document that does roughly what you want, and should be enough for you to modify as you need. You didn't specify any vertical spacing and I didn't dig through your code so I just kept the standard report class values. You also didn't specify if any of the headings were supposed to be bold, but you can add \bfseries as needed to the titling definitions.

Since you requested exactly 11.2 and 10.2 sizes I created two commands for those sizes, but since the main fontsize is not either of these, I don't quite know how they relate to the 12pt document class option.

\documentclass[12pt]{report}
\usepackage{kantlipsum}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\newcommand{\elevenpt}{\fontsize{11.2}{12}\selectfont}
\newcommand{\tenpt}{\fontsize{10.2}{11}\selectfont}
\titleformat{\chapter}[block]{\elevenpt\filcenter}{\MakeUppercase\chaptertitlename\ \thechapter}{20pt}{\MakeUppercase{#1}}
\titleformat{\section}[block]{\tenpt\filcenter}{\thesection}{1em}{\MakeUppercase{#1}}
\titleformat{\subsection}[block]{\tenpt\filcenter}{\thesubsection}{1em}{#1}
\titleformat{\subsubsection}[hang]{\tenpt\itshape}{\thesubsubsection}{1em}{#1}
\titlespacing*{\chapter}{0pt}{50pt}{40pt}
\titlespacing*{\section}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlecontents{chapter}
              [3em] 
              {}
              {\elevenpt\contentslabel{2em}\MakeUppercase}
              {\hspace*{-2em}}
              {\titlerule*[1pc]{.}\contentspage}
\titlecontents{section}
              [5em]
              {}
              {\tenpt\contentslabel{2.3em}\MakeUppercase}
              {\hspace*{-2.3em}}
              {\titlerule*[1pc]{.}\contentspage}
\titlecontents{subsection}
              [7em] 
              {}
              {\tenpt\contentslabel{2.8em}}
              {\hspace*{-2.8em}}
              {\titlerule*[1pc]{.}\contentspage}
\titlecontents{subsubsection}
              [7em] 
              {}
              {\tenpt\itshape\contentslabel{3.5em}}
              {\tenpt\itshape\contentslabel{3.5em}}
              {\titlerule*[1pc]{.}\contentspage}
\setcounter{tocdepth}{4}
\begin{document}
\tableofcontents
\listoffigures
\chapter{A chapter level heading}
\kant[1]
\section{A section level heading}
\kant[2]
\subsection{A subsection level heading}
\kant[3]
\subsubsection{A subsubsection level heading}
\kant[4]
\begin{figure}
\caption{A figure}
\end{figure}
\end{document}

output of TOC code sample headings

Related Question