Page LayoutTitles of ToC, LoF and LoT

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
foist
Posts: 5
Joined: Sat Aug 13, 2011 3:42 am

Titles of ToC, LoF and LoT

Post by foist »

Hi there. I'm new to this community and have searched the forum but have not found a solution to my problem - unless I missed it. I'm trying to format titles in the TOC such that "Contents" is "TABLE OF CONTENTS". Additionally, I need "List of Figures" and "List of Tables" to be in uppercase. A .pdf example of the correct toc format is here: http://gradschool.unc.edu/etdguide/pdf/ ... ntents.pdf

Here's the code I'm working with:

Code: Select all

\documentclass[12pt,notitlepage]{report}
\usepackage[english]{babel}
\usepackage{tocloft} %change table of contents
    \renewcommand{\cftbeforesecskip}{0em}
    \renewcommand{\contentsname}{TABLE OF CONTENTS}
    \renewcommand{\cfttoctitlefont}{\hfill\normalsize\textbf}
    \renewcommand{\cftaftertoctitle}{\hfill}

    \renewcommand{\listfigurename}{\normalsize\textbf{LIST OF FIGURES}}
    \renewcommand{\cftloftitlefont}{\hfill\normalsize\textbf}
    \renewcommand{\cftafterloftitle}{\hfill}

    \renewcommand{\listtablename}{\normalsize\textbf{LIST OF TABLES}}
    \renewcommand{\cftlottitlefont}{\hfill\normalsize\textbf}
    \renewcommand{\cftafterlottitle}{\hfill}

    \renewcommand{\cftchapfont}{\normalfont} %chapters are not bolded
    \renewcommand{\cftchapdotsep}{\cftdotsep} %chapters with dots to pg. number

    \cftpagenumbersoff{part}


\begin{document}
\tableofcontents
    \cleardoublepage
    \addcontentsline{toc}{chapter}{\normalfont{LIST OF FIGURES}}
    \cleardoublepage
    \addcontentsline{toc}{chapter}{\normalfont{LIST OF TABLES}}
    \addcontentsline{toc}{part}{\normalsize\normalfont{Chapter}}

\clearpage \newpage
 \listoffigures
 \clearpage \newpage
 \listoftables
 \clearpage \newpage
With the code above, I get "Contents" instead of "TABLE OF CONTEXTS", "List of Figures" instead of "LIST OF FIGURES", and "List of Tables" instead of "LIST OF TABLES". Additionally, the page numbers for the lot is incorrect even with using \cleardoublepage.

Any advice would be greatly appreciated!
Last edited by foist on Wed Aug 24, 2011 7:16 pm, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Titles of ToC, LoF and LoT

Post by Stefan Kottwitz »

Hi foist,

welcome to the board!

The babel package redefines some of the common names, such as \contentsname. However, it provides a macro \addto which you can use for overwriting. Instead of directly redefining the following names, modify your preamble this way:

Code: Select all

\addto{\captionsenglish}{ %
  \renewcommand{\contentsname}{TABLE OF CONTENTS}
  \renewcommand{\listfigurename}{\normalsize\textbf{LIST OF FIGURES}}
  \renewcommand{\listtablename}{\normalsize\textbf{LIST OF TABLES}}
}
Stefan
LaTeX.org admin
foist
Posts: 5
Joined: Sat Aug 13, 2011 3:42 am

Re: Titles of ToC, LoF and LoT

Post by foist »

Thank you so much. The code you provided works great!

I do have one remaining small little bug to sort out.
The page numbers for the list of tables and list of figures on the toc are the same although I used \cleardoublepage before the \addcontentsline{toc}.

In particular, the page number for the lot and lof are the same, with the page number for lot being correct. The page number for lof is off by a page.

Is there anything I should do to sort this out?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Titles of ToC, LoF and LoT

Post by Stefan Kottwitz »

Use \addcontentsline exactly on that page which should be displayed in the table of contents. I.e. write

Code: Select all

\cleardoublepage
\addcontentsline{toc}{chapter}{\normalfont LIST OF TABLES}
\listoftables
\cleardoublepage
\addcontentsline{toc}{chapter}{\normalfont LIST OF FIGURES}
\listoffigures
Stefan
LaTeX.org admin
foist
Posts: 5
Joined: Sat Aug 13, 2011 3:42 am

Re: Titles of ToC, LoF and LoT

Post by foist »

Great! It works perfectly.
Thank you so much!!!

My mistake was to assume that the code had to be placed in the order which the pages run.
Post Reply