Generalglossaries | Problem with Xindy

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
raminjj
Posts: 2
Joined: Fri Jul 08, 2011 2:57 am

glossaries | Problem with Xindy

Post by raminjj »

There is a problem with the page number when the Xindy option is active in glossaries package. As you see in the minimal example, the page number is incorrect in the glossary. But it will be OK if you remove [xindy] option. I think the problem is related to the fact that \thepage counter returns wrong number in the first paragraph of the page. Anyone knows who to solve the problem?
Attachments
a.pdf
(6.31 KiB) Downloaded 184 times
a.tex
(619 Bytes) Downloaded 234 times
Last edited by raminjj on Sat Jul 16, 2011 7:01 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

raminjj
Posts: 2
Joined: Fri Jul 08, 2011 2:57 am

glossaries | Problem with Xindy

Post by raminjj »

I got the following email from Dr. Nicola Talbot. I appreciate her help.
thanks for your message. It will be fixed in the next version. For now, you should be able to do a temporary fix with the following:

Code: Select all

\makeatletter
\renewcommand{\@do@wrglossary}[1]{%
  \protected@edef\@glslocref{\theglsentrycounter}%
  \@gls@checkmkidxchars\@glslocref
  \expandafter\ifx\theHglsentrycounter\theglsentrycounter
    \def\@glo@counterprefix{}%
  \else
    \protected@edef\@glsHlocref{\theHglsentrycounter}%
    \@gls@checkmkidxchars\@glsHlocref
    \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix
      {\@glslocref}{\@glsHlocref}%
    }%
    \@do@gls@getcounterprefix
  \fi
\ifglsxindy
  \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil
  \def\@glo@range{}%
  \expandafter\if\@glo@prefix(\relax
    \def\@glo@range{:open-range}%
  \else
    \expandafter\if\@glo@prefix)\relax
      \def\@glo@range{:close-range}%
    \fi
  \fi
  \glossary[\csname glo@#1@type\endcsname]{%
  (indexentry :tkey (\csname glo@#1@index\endcsname)
    :locref \string"{\@glo@counterprefix}{\theglsentrycounter}\string" %
    :attr \string"\@gls@counter\@glo@suffix\string"
    \@glo@range
  )
  }%
\else
  \@set@glo@numformat{\@glo@numfmt}{\@gls@counter}{\@glsnumberformat}%
    {\@glo@counterprefix}%
  \glossary[\csname glo@#1@type\endcsname]{%
  \string\glossaryentry{\csname glo@#1@index\endcsname
    \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}%
\fi
}
\makeatother
Post Reply