[Tex/LaTex] How to make page numbers in a nomenclature hyperref links

hyperrefnomenclature

I want to create a nomenclature for a very large document using the nomencl.

MWE:

\documentclass{article}

\usepackage[refpage]{nomencl}
\usepackage{hyperref}

\makenomenclature

\begin{document}

\nomenclature[N]{$N$}{some number}

\printnomenclature

\end{document}

This correctly creates the Output:

output

Is it possible to make nomencl understand that hyperref is available such that 'page 1' or just '1' is a hyperlink you can click on and are actually referred to page 1?

Best Answer

You have to redefine the command \pagedeclaration defined by \nomencl. Please note that the original definition of \pagedeclaration depends on your selected language.

\documentclass{article}

\usepackage[refpage]{nomencl}
\usepackage[pageanchor]{hyperref}
\def\pagedeclaration#1{, \hyperlink{page.#1}{page\nobreakspace#1}}
\makenomenclature

\begin{document}
a
\clearpage
b
\nomenclature[N]{$N$}{some number}
\clearpage
\printnomenclature

\end{document}
Related Question