While generating Table of Contents (ToC) and bookmarks for hyperref package, latex uses the anchors created while generating the document. However, the problem is that list of figures, list of tables, and bibliography created autometically by latex do not have any anchors. Therefore, it is not possible normally to have them in the ToC. However, sometimes it is required that they be in the ToC as well as in the bookmarks list. One way to make them appear in the ToC is to put a manual entry in the source file, such as:

\listoffigures

However, more often than not (especially when the list is more than one page) this creates wrong page numbering in the ToC. This is because there is actually no hard anchor in the beginning of the list of figures. So, latex uses the last defined anchor which may not be the original beginning of the list.

To resolve this situation, we need to put an anchor at the beginning of the list. One way to do that is to put a phantomsection before it.

\phantomsection \label{listoffig}
\listoffigures

However, the problem with this is that, if the previous page before the list is not full, then the anchor is created at the middle of the previous page and the page numbering is again wrong. This observation brings a new solution which works perfectly:

\newpage
\phantomsection \label{listoffig}
\listoffigures

So, create a newpage first, this ensures you are in a completely new page. And then create an anchor using phantomsection. Then add the contentsline which generates correct link to the list. 🙂

June 29, 2009 3:02 pm

Hi

I think you should mention that \phantomsection is included in the hyperref package and therefore it needs t be included at the beginning of the document

cheers for the help anyway, it was really usefull 🙂 !!

July 2, 2009 10:14 am

Thanks Lorenzo! I guess your comment already done the job of mentioning 🙂 Hope the post helped.

//sumanta

December 11, 2009 4:10 am

I think that if you use \cleardoublepage before the \addcontentsline works too and it will make sure the list of figures starts in a new page, odd if using twoside. Anyone knows how to determine if a figure exists before calling the \addcontentsline?

• January 26, 2010 9:56 am

Thanks! That really helped. The hyperref package was creating problems for me.

November 9, 2010 2:43 am

Thanks. Your solution worked perfect for me, but the one that uses \phantomsection doesn’t work for some reason

This works!
\cleardoublepage
\listoffigures

Thanks soooooooo much 🙂

November 9, 2010 2:45 am

Note that I defined \listoffigures as List of Figures….Just for others to know.

February 16, 2010 4:33 pm

Your insights are really helpful. Thank you. I have one question: Do you really need the “\phantomsection \label{listoffig}”?

Anyway, if you are only interested in making them bookmarks for hyperref package, it is sufficient to use
\newpage
\currentpdfbookmark{List of Figures}{bm:listoffigures}
\listoffigures

February 16, 2010 4:41 pm

thanks! I really didn’t know about currentpdfbookmark tag. phantomsection was required to make an anchor at that position so that its possible to jump to exact that position from table of contents. Otherwise, the jump was going to wrong place.

April 14, 2010 7:05 pm

Almost. This works for putting in a link to the lof in the toc, but it also prevents the minitoc from printing at the beginning of each chapter. Any ideas on how to get around this?

April 15, 2010 12:28 am

errrrr, not really….haven’t been in touch with latex since finishing my thesis. Hopefully you would find a solution pretty soon…and share it here.

October 6, 2010 4:07 pm

Hi, my question is the opposite, how to exclude LoF and LoT refs from ToC? I tried \usepackage[notlot,notlof]{tocbibind}, but faced a ton of compilation errors due to bibliography, so I gave up. Is there a quick and easy way to doing this?

Thanks

October 7, 2010 1:34 pm

Hi,

Thanks for the comment. I am away from writing anything using latex for quite a long time now and so am somewhat out of touch with it. Sorry I couldn’t help you out of my head to solve the problem but please come back and post a solution if you can figure it out.

November 19, 2010 9:17 am

Hi, I got a problem,in List of figures, lines are overlapping one another and become a block of mess. Can anyone help me in how to make this work?

7. August 7, 2011 4:21 am

Dears,

I have something worried, when i used \listoffigures , it continues for many paper after the figures ended ? any idea ?

September 5, 2011 12:14 pm

Hi,
I would like to start the count of citations from Chapter 1 of my Thesis.
Up to now, it starts counting from List of Figures and List of Tables.

Can anyone comment on this?
Thank you

9. January 12, 2012 2:49 pm

My solution was:

\usepackage{hyperref}

\tableofcontents %generale

\cleardoublepage
\phantomsection
\listoffigures

December 19, 2012 1:05 am

Thanks a lot, really helped! End of master thesis in sight 😉