Text Formattingtocbibind | Capitalized Heading of LoF in ToC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Ile
Posts: 7
Joined: Fri Aug 05, 2011 2:17 am

tocbibind | Capitalized Heading of LoF in ToC

Post by Ile »

Hi,

I have to put \usepackage[nottoc]{tocbibind} in the preamble of my thesis to get the correct page numbers for the lof and bib in the toc. Now the lof appears as "List of Figures" in the toc, but I want it to be "LIST OF FIGURES."

Is there an option to do that?
Last edited by Ile on Thu Aug 11, 2011 9:09 pm, edited 1 time 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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: tocbibind | Capitalized Heading of LoF in ToC

Post by localghost »

Shall the format of the actual heading for the LoF be maintained? What about the entries of the LoT and the bibliography in the ToC? What's the used document class?


Thorsten
Ile
Posts: 7
Joined: Fri Aug 05, 2011 2:17 am

Re: tocbibind | Capitalized Heading of LoF in ToC

Post by Ile »

Hi,


I am using \documentclass[12pt]{report}. I want both the heading of lof and its entry in ToC to be uppercase. I don't have any tables, but the same would apply to that.

I have noticed that the bibliography was changed to "REFERENCES" in the ToC using this command in the style file:
\renewcommand{\bibname}{REFERENCES}
When I comment this line out, both the heading and the entry in the ToC reverts to "Bibliography. "

Perhaps some similar command would work for lof?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tocbibind | Capitalized Heading of LoF in ToC

Post by localghost »

Ile wrote:[…] I have noticed that the bibliography was changed to "REFERENCES" in the ToC using this command in the style file:
\renewcommand{\bibname}{REFERENCES}
When I comment this line out, both the heading and the entry in the ToC reverts to "Bibliography. " […]
Then do it correspondingly for the LoF (and LoT if needed).

Code: Select all

\renewcommand{\listfigurename}{LIST OF FIGURES}
\renewcommand{\listtablename}{LIST OF TABLES}
Ile
Posts: 7
Joined: Fri Aug 05, 2011 2:17 am

tocbibind | Capitalized Heading of LoF in ToC

Post by Ile »

Hi,
Thank you. That solved the uppercase problem. I had tried something similar, but didn't have the correct wording.

I just discovered that using tocbibind has given me another problem to solve.

If I use

Code: Select all

\usepackage{MYthesis}
\usepackage[nottoc]{tocbibind} 
then I have correct page numbers in ToC for LoF but the list of figures page looks like this:

LIST OF FIGURES

1. Figure 1............................1
2. Figure 2............................2

If I use the packages in this order

Code: Select all

\usepackage[nottoc]{tocbibind}
\usepackage{MYthesis}
then

Code: Select all

\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{LIST OF FIGURES}%\@mkboth{LIST OF FIGURES}{LIST OF FIGURES}}
% {\large{\bf Number}\hfill{\bf Page}}%\newline
  \@starttoc{lof}\if@restonecol
 \twocolumn\fi
 \addtocontents{lof}{{\vspace{12pt}}\hspace{12pt} Figure\hfill Page{\vspace{12pt}}\par}}
the code in MYthesis above gives me the following list of figures format, except that now I have wrong page number for the LoF in the ToC.
LIST OF FIGURES

Figure-------------------------------Page

1. Figure 1............................1
2. Figure 2............................2

How can I add the "Figure-------------------Page" line to work with the first example?

Ile
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tocbibind | Capitalized Heading of LoF in ToC

Post by localghost »

Ile wrote:[…] then

Code: Select all

\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{LIST OF FIGURES}%\@mkboth{LIST OF FIGURES}{LIST OF FIGURES}}
% {\large{\bf Number}\hfill{\bf Page}}%\newline
  \@starttoc{lof}\if@restonecol
 \twocolumn\fi
 \addtocontents{lof}{{\vspace{12pt}}\hspace{12pt} Figure\hfill Page{\vspace{12pt}}\par}}
the code in MYthesis above gives me the following list of figures format, […]
I don't understand why this redefinition of \listoffigures happens at all. Compared to the original stuff from the class code it does nothing substantially different. At the moment you redefine \listfigurename and \bibname to capitalize the headings and ToC entries. So I suggest to replace this code block with the following.

Code: Select all

\AtBeginDocument{%
  \addtocontents{lof}{\vspace{12pt}\hspace{12pt} Figure\hfill Page\vspace{12pt}\par}
}
This will insert the stuff into the LoF right at the beginning of the document body and should not depend on the load sequence of tocloft and your own package.

Since I have this package not present, there is no guarantee for success and side effects cannot be ruled out.
Ile
Posts: 7
Joined: Fri Aug 05, 2011 2:17 am

Re: tocbibind | Capitalized Heading of LoF in ToC

Post by Ile »

I don't understand much of this style document either. It came with the thesis template and was supposed to make things simpler, except it hasn't been updated in years. I only know some of the things it does by reverse engineering.

Many thanks. Your solution works perfectly and without side effects.

Ile
Post Reply