Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
    
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. –  Benny Neugebauer Mar 7 '13 at 16:58
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
It worked. Thank you!! –  Benny Neugebauer Mar 7 '13 at 8:59
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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