## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ List of Figures Topic is solved

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Shamson
Posts: 8
Joined: Tue Dec 26, 2017 6:33 pm

### List of Figures

Dear community members,
I could add text "Figure" to the List of figures (\listoffigures), but the problem is that hyperref can not cover those extra text "Figure"s. Can you please suggest a solution for this?

Thanks a lot.

Stefan Kottwitz
Posts: 8733
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Shamson,

welcome to the forum!

It depends on how you add it. What are you doing, can you show code? With document class and preamble please, so we can test and fix it.

Stefan

Shamson
Posts: 8
Joined: Tue Dec 26, 2017 6:33 pm
Dear Stefan,
I just saw your answer. Thanks, I hope this community is strongly supported by experts.

So, \listoffigures generate list of figures. Then I use \renewcommand{\cftfigfont}{Figure} .

but the problem is that hyperref can not cover those extra text "Figure"s. Can you please suggest a solution for this?

Thanks a lot.

Stefan Kottwitz
Posts: 8733
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Shamson!

Redefining \cftfigfont is a just a quick hack, I guess you read it on some web site. \cftfigfont is a macro for the figure font name, for example one writes \renewcommand{\cftfigfont}{\bfseries} to get bold figure numbers. That hack sets Figure instead of \bfseries right before a figure number, so it seems to work in the text but hyperref cannot see this to extend the hyperlink.

A correct way would be:

1. \usepackage{tocloft}
2. \usepackage{hyperref}
3. \renewcommand{\cftfigpresnum}{Figure\ }
4.
5. \newlength{\figlen}
6. \settowidth{\figlen}{\cftfigpresnum}
7. \setlength{\cftfignumwidth}{\dimexpr\figlen+1.5em}

Stefan

Shamson
Posts: 8
Joined: Tue Dec 26, 2017 6:33 pm
Dear Stefan,
You did a great job.
Thank you very much.

Return to “MakeIndex, Nomenclature, Glossaries and Acronyms”

### Who is online

Users browsing this forum: No registered users and 2 guests