[Tex/LaTex] Capitalize ‘List of Tables’ and ‘List of Figures’ in Table of Contents

capitalizationtable of contents

In my Table of Contents, the first two entries are List of Tables and List of Figures with the roman page numbers referring to where these lists actually are. I need to make these two entries all capitalized like LIST OF TABLES and LIST OF FIGURES. Thanks in advance.

Best Answer

By default there is a difference in what is passed as a contents-related entry and what is set within the document. Since you have little control over this when setting \listoffigures and \listoftables, the example below intervenes by passing the LoF/LoT entries using \MakeUppercase:

enter image description here

\documentclass{article}

\usepackage{tocbibind}

\let\oldaddcontentsline\addcontentsline
\newcommand{\ADDCONTENTSLINE}[3]{%
  \oldaddcontentsline{#1}{#2}{\MakeUppercase{#3}}%
}
\newcommand{\CAPinToC}{\let\addcontentsline\ADDCONTENTSLINE}
\newcommand{\noCAPinToC}{\let\addcontentsline\oldaddcontentsline}

\begin{document}

\tableofcontents

\CAPinToC% All entries in ToC will be CAPITALIZED from here on
\listoftables

\listoffigures

\noCAPinToC% Rever to original \addcontentsline formatting
\section{A section}

\begin{figure}\caption{A figure}\end{figure}
\begin{table}\caption{A table}\end{table}

\end{document}

You can activate this type of ToC-related formatting using \CAPinToC (or revert back to the original definition using \noCAPinToC).