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
lockstep
  • 250,273
Benny Code
  • 3,042

2 Answers2

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.

Werner
  • 603,163
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.

e-birk
  • 4,373