0

This question is about making the glossary numbered, and referring to it by that number.

I'm instead asking about referring to the page where the unnumbered glossary starts. Since I'm using \printglossaries to print it, there's no label I can refer to in a \pageref command.

I'm assuming the solution should work for such a simple example document.

Enlico
  • 2,592

1 Answers1

2

Try this code using hyperref's \autopageref.

a

\documentclass[12pt]{article}

\usepackage[ toc, section, numberedsection = autolabel, automake, ]{glossaries} \glstoctrue

\makeglossaries %makeglossaries %

\newacronym{vae}{VAE}{variational auto-encoder} \makeglossaries

\usepackage[hidelinks]{hyperref}% added <<<<<<<<<<<< \begin{document}

\tableofcontents

\section{Abstract}
\acrshort{vae}. 

Please, refer to section \ref{main}.

Please, refer to \autopageref{main}. 

\newpage \setcounter{page}{5}

\printglossary[type=main]

\end{document}

For an unnumbered glossary

b

\documentclass[12pt]{article}

\usepackage[ toc, section, ]{glossaries} \glstoctrue

\renewcommand*{\glossarypreamble}{%https://tex.stackexchange.com/a/49780/161015 \label{\currentglossary}% }

\newacronym{vae}{VAE}{variational auto-encoder} \makeglossaries

\begin{document}

\tableofcontents

\section{Abstract}
\acrshort{vae}. 

The glossary starts on page~\pageref{main}.

\newpage \setcounter{page}{5}

\printglossary

\end{document}

OR

\documentclass[12pt]{article}

\usepackage[ toc, section, ]{glossaries} \glstoctrue

\newacronym{vae}{VAE}{variational auto-encoder} \makeglossaries

\begin{document}

\tableofcontents

\section{Abstract}
\acrshort{vae}. 

The glossary starts on page~\pageref{main}.

\newpage \setcounter{page}{5}

\printglossary[title={List of Acronyms\label{main}}]

\end{document}

Simon Dispa
  • 39,141