1

Well, I think it's all in the title. But for the sake of perfect clarity, I would like to renew both \gls and \glspl command so I can print a back ref to the defintion page in the output. Is there any sort of \glspage{entry} kinda command?

(Maybe this is a duplicate.)

3

As from version 4.16 you can use the hook \glspostlinkhook that's used by commands like \gls:

\documentclass{article}

\usepackage[entrycounter]{glossaries}

\makeglossaries

\renewcommand*{\glsentrycounterlabel}{}%

\renewcommand*{\glspostlinkhook}{\textsuperscript{\pageref{glsentry-\glslabel}}}

\newglossaryentry{term}{name=term,description={an example}}

\begin{document}
\gls{term}.

\newpage

\glspl{term}.

\newpage

\printglossaries
\end{document}

This requires an extra LaTeX run to ensure the cross-references are up-to-date:

pdflatex filename
makeglossaries filename
pdflatex filename
pdflatex filename
  • That's a recent and very pleased update (from last week), so I had to update my texlive, but it works. – nadous Jul 13 '15 at 11:15
0

You can define the entry like this

\newglossaryentry{foo}{%
name={Name\label{foo}}, text={Name},
description={bla bla bla}}

or

\newglossaryentry{foo}{%
name={Name},
description={bla bla bla\label{foo}}}

then you can use \pageref{foo}

  • Is there no hooks in glossary that could automate this? Because in that scenario, I have to edit every entry of my glossary and add a label. Plus I'll have to add 4 labels if if wanted to automate, at least, the output by renewing the gls, glpl, Gls, Glspl command. – nadous Jul 13 '15 at 6:31

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.