Page LayoutLoF in ToC but with "Figures" as Heading

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
charvey1
Posts: 7
Joined: Wed Nov 04, 2009 12:08 pm

LoF in ToC but with "Figures" as Heading

Post by charvey1 »

Hello,

I'm typesetting my thesis using what is essentially the book document class. I am also referring to "New Hart's Rules: The Handbook of Style for Writers and Editors" and following it wherever possible.

The style guide says under §1.2.11 (Contents):
Lists in the prelims are referred to on the contents page as List of Illustrations, List of Abbreviations, etc. even though their headings are best formulated simply as Illustrations, Abbreviations, etc.
This means that I need the heading for my List of Tables and my List of Figures to say one thing, but the item in the contents table to say something else.

I've tried several methods to achieve this. None have worked for me.

1) Using

Code: Select all

\usepackage[nottoc,notlof,notlot]{tocbibind}
so that the lists aren't automatically added to the tables. Then

Code: Select all

\renewcommand*\listfigurename{Figures}
to change the heading for the list of figures (same for tables) and then using

Code: Select all

\addcontentsline{toc}{chapter}{List of Figures}
to add the item to the contents with the correct text.

This didn't work properly. The page numbers on the contents page for each list were either for the page for or the page after. Also the hyperref link linked to the wrong page. This makes sense because the

Code: Select all

\addcontentsline
command has to go either before or after the

Code: Select all

\listoffigures
command, which outputs both the heading and the list.

2) I tried to modify the my Thesis class (which is basically the same as Book class, but with some modifications), so that if I specify

Code: Select all

\renewcommand*\listfigurename{Figures}
then when it creates a chapter* for the figures and tables list, it prefixes "List of". This didn't work. It changed the text both in the heading and in the contents page and not just for the heading.

This approach seemed inelegant to me, so I didn't pursue it.

3) Finally, I tried to find a way to give the List of Figures/Tables a short title (for the contents page) and a long title (for the heading), much like you can for chapters.
\chapter*[short title]{long title}
I couldn't find anything. I looked at trying to modify the class to accept this, but it look very complicated. I again considered it an inelegant solution and figured there must be a better way.

Does anyone know of the best way (or just a way) to do this please? I've been scouring google for a solution for hours. If someone's done it before, then I must have been using rubbish search terms.

Many thanks,

Chris

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

LoF in ToC but with "Figures" as Heading

Post by Stefan Kottwitz »

charvey1 wrote:and then using

Code: Select all

\addcontentsline{toc}{chapter}{List of Figures}
to add the item to the contents with the correct text.

This didn't work properly. The page numbers on the contents page for each list were either for the page for or the page after. Also the hyperref link linked to the wrong page. This makes sense because the

Code: Select all

\addcontentsline
command has to go either before or after the

Code: Select all

\listoffigures
command, which outputs both the heading and the list.
In such cases, end the page before and set an anchor for hyperref. The order matters, such as

Code: Select all

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures
Stefan
LaTeX.org admin
charvey1
Posts: 7
Joined: Wed Nov 04, 2009 12:08 pm

LoF in ToC but with "Figures" as Heading

Post by charvey1 »

Thank you Stefan! :) It works perfectly. Better than I'd hoped for.

The hyperref links even link to just above the prelim headings now (like they do for normal chapters), whereas previously they'd linked to just below, which slightly irritated me.

I did actually try

Code: Select all

\phantomsection
once earlier today and it didn't work, but I see now it's because I didn't think to do a

Code: Select all

\cleardoublepage
first.

Thanks again.

Chris
Post Reply