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
andtocloft
together. Thetocloft
package is designed to work with the standard classes, but not with titles modified bytitlesec
. Since you are usingtitlesec
to format the titles, you should use the accompanyingtitletoc
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.