0

I am using the glossaries package. In the document, I would like to say "Please, refer to section \ref{my-glossary}". How can I do that?

Here's an example.

In the file notes.tex

\documentclass[12pt]{article}

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

\makeglossaries

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

\begin{document}

%\maketitle

\tableofcontents

\section{Abstract}
\acrshort{vae}.

Please, refer to section \ref{my-glossar}. 

\clearpage
\printglossary[type=\acronymtype]\label{my-glossar}

\bibliography{biblio}
\bibliographystyle{plain}

\end{document}
  • Have you added a \label{my-glossar} after the corresponding section/chapter? – Dr. Manuel Kuehner May 26 at 17:34
  • @Dr.ManuelKuehner The section is generated automatically using the command \printglossary, so I don't know how to add \label. – nbro May 26 at 17:36
  • Try to add ist right after the ` \printglossary` command. – Dr. Manuel Kuehner May 26 at 17:37
  • @Dr.ManuelKuehner I did that, but it refers to the section before the glossary. – nbro May 26 at 17:38
  • See answer (untested, no MWE from your side). – Dr. Manuel Kuehner May 26 at 17:39
1

Solved by trial and error: reading the manual and looking at Using Texmaker with glossaries on Windows.

\documentclass[12pt]{article}

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

\makeglossaries %makeglossaries %

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

\tableofcontents

\section{Abstract}
\acrshort{vae}. 

Please, refer to section \ref{main}. 

\printglossary[type=main]

\end{document}

enter image description here

  • The glossary now appears in the table of contents, but \ref refers to the previous section before the glossary, in my case, section 5. – nbro May 26 at 17:43
  • 1
    @nbro Add a good MWE and I am pretty sure, that this will help to help. – Dr. Manuel Kuehner May 26 at 17:44
  • Using your new solution, now the glossary is numbered, but I would like to refer to the whole glossary and not single entries. I am already able to refer to single entries of the glossary. – nbro May 26 at 17:51
  • @nbro I have never used the package before. The manual has an extra section about this topic (see my answer). It looks a bit complicated to me at first. Without a MWE from your side (it's your 21st question!), I am not willing to build the MWE on my own. – Dr. Manuel Kuehner May 26 at 17:55
  • I didn't think an MWE was needed in this case. Anyway, I have just added one to my question. Have a look at it. – nbro May 26 at 18:05

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.