# How to make the term “page” show in the Glossary list?

I have recently started to use the package glossaries.

When I make the Glossary list, the page numbers show up at the end of the description. So far so good.

I have found information about how to not show the page numbers.

I have found one solution in How to add the word "page" or "pages" in the Glossary how to add the words "page" or "pages". But it had some issues:

1. The previously existing cross-references disappeared. It used to look like

.

So my question is, can you include the words "page" or "pages" without losing the clickable cross-references?

2. Another problem with the found solution is that it tends to repeat the term "page"

instead of just using it once.

The second issue seems to be solved

in the proposed solution of Problem with inserting "page" in Glossary, but I was not sure how to implement the proposed solution. At least I got error codes when trying to add the

% Columns in acronym table
\newglossarystyle{mylong}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}%
{\begin{longtable}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{0.8\hsize}}}%
{\end{longtable}}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\glossentrydesc{##1}\glspostdescription\space
\pagesfalse
\usepagestag{##1}\space
##2%
\ifpages
\savepagestag{##1}{pages}%
\else
\savepagestag{##1}{page}%
\fi
\tabularnewline
}%
}


code block from Problem with inserting "page" in Glossary to my .tex document.

Can anyone help me out with this?

/Lars

• Please do never post screenshots of code, but real code. – TeXnician Apr 20 '17 at 11:00
• It is NOT. Please read our guidelines. It looks good. – TeXnician Apr 20 '17 at 11:03
• It did not look good, but probably someone fixed it. – Lars Abrahamsson Apr 20 '17 at 14:31

The simplest method is to use the extension package glossaries-extra which provides \GlsXtrEnablePreLocationTag.

\documentclass{article}

\usepackage[postdot]{glossaries-extra}

\makeglossaries

\GlsXtrEnablePreLocationTag{Page: }{Pages: }

\newglossaryentry{sample1}{name={sample1},description={first example}}
\newglossaryentry{sample2}{name={sample2},description={second example}}

\begin{document}
\gls{sample1}, \gls{sample2}.

\newpage

\gls{sample2}.

\newpage

\printglossaries

\end{document}


The build process is latex, makeglossaries, latex, latex (replace latex with pdflatex, xelatex or lualatex as appropriate).