I am writing happily on my thesis with latex but found a problem with glossaries package returning wrong page number reference links in the glossaries index.
Instead of referencing page 5, the glossary index points to page 3 with memoir, with book class, the difference is only one page.
After quite some tests and trials I found the minimum requirements for reproduction on my system - hope you can reproduce them, too. Please excuse the large number of chapters and sections but it seems necessary that the TOC spans more than one page for the number issue to show up.
The problem both shows up with standard book class as well as memoir class. Both need the a4paper option enabled for this problem to occur.
Here you find the MWE together with notes on the requirements. Here a link to the pdf file I created using texstudio: pdf file using memoir class and the tex file.
%\documentclass[12pt,a4paper,openany]{book} % for book class, both a4paper and openany must be given as parameters for the bug to show up
\documentclass[12pt,a4paper]{memoir} % for memoir, only a4paper is necessary; but the bug only shows up, when a title page is there with a pagebreak afterwards
\usepackage[latin1]{inputenc}
\usepackage[bookmarks, colorlinks]{hyperref}
\usepackage[toc]{glossaries}
\makeglossaries
\newglossaryentry{test}{name={Testing test},description={test description},first={Test (test)}}
\begin{document}
\title{Test} % titepage and pagebreak are only necessary for reproducing the bug with memoir class
\maketitle
\pagebreak
\tableofcontents{} % needed lots of chapter because the wrong number only shows up when the toc is longer than one page
\chapter{chapter 1}
\gls{test}
\section{title 2 - possibly with a very very long title creating a new line indeed}
\section{title 3}
\chapter{chapter inbetween}
\section{title 5}
\section{title 6}
\section{title 8}
\chapter{chapter 2}
\section{title 10 - possibly with a very very long title creating a new line indeed}
\section{title 11}
\section{title 12 - possibly with a very very long title creating a new line indeed}
\section{title 13}
\chapter{chapter 3}
\section{title 15}
\chapter{chapter 4}
\section{title 17}
\section{title 18 - possibly with a long title creating a new line}
\chapter{chapter 5}
\chapter{chapter 6}
\section{title 21}
\section{title 22}
\section{title 23}
\printglossaries
\end{document}
In TexStudio I use the following build sequence, in case that is relevant:
txs:///latex | txs:///latex | txs:///latex | txs:///makeglossary | txs:///latex | txs:///bibtex | txs:///latex | txs:///quick
Probably a bit too often running latex but as far as I understand that can only help, no?
Hope you can help me with this problem, since I love the ease of using LaTeX otherwise :)
If you need anything else, tell me please!
memoirand to page 4 withbook, which is expected, because you're passing theopenanyoption tobook. The glossary term falls anyway in the referenced page. What TeX distribution are you using? – egreg Sep 26 '12 at 11:54