4

In my table of contents the glossary and the list of figures have the same page number. However, these two areas are not on the same page. Can anyone help me to get the correct number of pages set?

My glossary is called "Akronyme" because it is in German. enter image description here

Here is my code:

\printglossary[type=\acronymtype,style=dontgroup]
\addcontentsline{toc}{chapter}{List of figures}
\listoffigures
2
  • There would be another way... Are you using the package hyperref?
    – e-birk
    Mar 7 '13 at 16:38
  • Yipp! I use it on the top of my document. Mar 7 '13 at 16:58
4

Your issuing of

\addcontentsline{toc}{chapter}{List of figures}

comes too soon, since \listoffigures sets a new chapter (perhaps starred) that initiates itself with a page break. Inserting this page break as \clearpage before \addcontentsline flushes all unprocessed floats, inserts the appropriate page for the ToC while avoiding the default \clearpage issued by \chapter (from \listoffigures). So, your document structure should instead resemble:

\printglossary[type=\acronymtype,style=dontgroup]
\clearpage
\addcontentsline{toc}{chapter}{List of figures}
\listoffigures

If you're running in twoside mode use \cleardoublepage.

The above suggestion should work for most document classes.

0
1

To extend @Werner's answers I come about the case that using \cleardoublepage (or \clearpage) did not help. Here the package "hyperref" is apparently involved. Page references could still be wrong because the command \addcontentsline refers to a wrong location. The documentation of the package "hyperref" states

\addcontentsline refers to the latest previous location where an anchor is set.

This behavior can be corrected by using \phantomsection.

\printglossary[type=\acronymtype,style=dontgroup]
\clearpage
\phantomsection
\addcontentsline{toc}{chapter}{List of figures}
\listoffigures

See also: When do I need to invoke \phantomsection? or this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.