[Tex/LaTex] tocloft change font size of “List of Figures”

page-breakingspacingtable of contentstitlesectocloft

I am using tocloft for the first time, and I want to make the "List of Figures" and "List of Tables" font smaller and appear on the same page, directly after the table of contents. I want list titles to be the same size as the chapter entries in the Table of Contents. For example, in the MWE below, I want the text "List of Tables" and "List of Figures" to have the same formatting as the text "1 Stuff" and "2 More Stuff", and to appear on page 1, immediately after the table of contents.

    \documentclass[10pt,oneside]{book}
    \usepackage[titles]{tocloft} % To adjust the typography of the List of Figures and List of Tables
    \usepackage{lipsum}
    \usepackage{xcolor} % To change color of hyperlinks

    \usepackage{helvet}
    \usepackage{titlesec}

    \titleformat{\chapter}[display]
    {\color{teal}\normalfont\sffamily\huge\bfseries}
    {\color{teal}\chaptertitlename\ \thechapter}{20pt}{\Huge}

    \titleformat{\section}
    {\color{teal}\normalfont\sffamily\Large\bfseries}
    {\color{teal}\thesection}{1em}{}

    \usepackage{hyperref}
    \hypersetup{colorlinks=true,linkbordercolor=red,linkcolor=teal,citecolor=teal,urlcolor=teal}

    \begin{document}


    \tableofcontents
    \addcontentsline{toc}{section}{Table of Contents}

    \listoftables
    \addcontentsline{toc}{section}{List of Tables}

    \listoffigures
    \addcontentsline{toc}{section}{List of Figures}


    \chapter{Stuff}
    \section{A section}

    \lipsum[65]

    \begin{table}[h!]
    \centering
    \caption{This is my first table.}
    \begin{tabular}{c c}
    \hline
    \hline
    Names & Ages \\
    \hline
    Margaret & 26 \\
    John & 45 \\
    Mary & 34 \\
    \hline
    \end{tabular}
    \end{table}

    \begin{table}[h!]
    \centering
    \caption{This is my second table.}
    \begin{tabular}{c c}
    \hline
    \hline
    Names & Ages \\
    \hline
    Paul & 85 \\
    George & 13 \\
    Stephanie & 56 \\
    \hline
    \end{tabular}
    \end{table}

    \section{Another section}

    \lipsum[65]

    \chapter{More Stuff}
    \section{A section again}
    \lipsum[65]

    \begin{figure}[h!]
    \caption{Figure caption here.}
    \end{figure}

    \end{document}

enter image description here

Best Answer

I want list titles to be the same size as the chapter entries in the Table of Contents.

Then add the elements to the ToC using a chapter type, not section.

I want to make the "List of Figures" and "List of Tables" [...] appear on the same page, directly after the Table of Contents.

Since you're using titlesec as well, it overrides the way tocloft manages the ToC/LoF/LoT title construction. You'll have to revert back to using titlesec's \titlespacing{\chapter}{<left>}{<before>}{<after>}[<right>] to set the way \chapters are spaced; note that the ToC/LoF/LoT are all set as \chapters (the starred version).

Additionally, you'll have to set \clearpage to \relax to avoid a page break. See How to show \listoffigures and \listoftables on one page and in the ToC?


Here is your minimal example:

enter image description here

\documentclass{book}

\usepackage[titles]{tocloft} % To adjust the typography of the List of Figures and List of Tables

\usepackage{lipsum}
\usepackage{xcolor} % To change color of hyperlinks

\usepackage{helvet}
\usepackage{titlesec}

\titleformat{\chapter}[display]
  {\color{teal}\normalfont\sffamily\huge\bfseries}
  {\color{teal}\chaptertitlename\ \thechapter}{20pt}{\Huge}

\titleformat{\section}
  {\color{teal}\normalfont\sffamily\Large\bfseries}
  {\color{teal}\thesection}{1em}{}

\usepackage{hyperref}
\hypersetup{colorlinks=true,linkbordercolor=red,linkcolor=teal,citecolor=teal,urlcolor=teal}

\begin{document}

\begingroup
\titlespacing*{\chapter}{0pt}{20pt}{5pt}

\tableofcontents
\addcontentsline{toc}{chapter}{Table of Contents}

\let\clearpage\relax
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}

\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}

\endgroup

\chapter{Stuff}
\section{A section}

\lipsum[65]

\begin{table}[h!]
  \centering
  \caption{This is my first table.}
  \begin{tabular}{c c}
    \hline \hline
    Names    & Ages \\
    \hline
    Margaret & 26 \\
    John     & 45 \\
    Mary     & 34 \\
    \hline
  \end{tabular}
\end{table}

\begin{table}[h!]
  \centering
  \caption{This is my second table.}
  \begin{tabular}{c c}
    \hline \hline
    Names     & Ages \\
    \hline
    Paul      & 85 \\
    George    & 13 \\
    Stephanie & 56 \\
    \hline
  \end{tabular}
\end{table}

\section{Another section}
\lipsum[65]

\chapter{More Stuff}
\section{A section again}
\lipsum[65]

\begin{figure}[h!]
  \caption{Figure caption here.}
\end{figure}

\end{document}