Document Classes[Glossaries] Making acronym entries link to glossary entries

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
robbiie
Posts: 3
Joined: Wed Nov 05, 2008 5:22 pm

[Glossaries] Making acronym entries link to glossary entries

Post by robbiie »

Hi all,

since a few days I busy myself in trying to find a solution to the following problem:

I'm using the glossaries package for creating a glossary and a list of acronyms in my document.

Code: Select all

\usepackage[style=altlist,
nonumberlist,
numberedsection,
acronym,
toc]
{glossaries}
I defined an acronym, e.g.

Code: Select all

\newacronym{POS}{POS}{Part Of Speech}
and a separate glossary entry, e.g.

Code: Select all

\newglossaryentry{pos}{name=Part Of Speech,description={"`Part of speech"' Description}}
Now, what I would like to have, is the following:

When I reference an acronym in my text using

Code: Select all

\gls{pos}
I would like it to be added in the list of acronyms stating that pos stands for "PART OF SPEECH", which is no problem. But, at the same time, I would like the "PART OF SPEECH" description to link to the glossary entry of "pos".

I don't find any clue on how to do this - neither in the documentation, nor in the FAQs of glossaries.

Can anyone help, please?
Thanks,
Robbiie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Re: [Glossaries] Making acronym entries link to glossary entries

Post by nlct »

Hi,

Try

\newacronym{POS}{POS\glsadd{pos}}{Part Of Speech}

Regards
Nicola Talbot
robbiie
Posts: 3
Joined: Wed Nov 05, 2008 5:22 pm

[Glossaries] Making acronym entries link to glossary entries

Post by robbiie »

Hi Nicola,

very nice of you to answer yourself. Thanks :)

If I understand your documentation correcty, \glsadd means just to statically add an entry to the glossary without any hyper links. Unfortunately that's not what I want. I'd rather have the following:

Code: Select all

\newacronym{POS}{POS}{\glslink{pos}{Part of Speech}}
or

Code: Select all

\newacronym{POS}{\glslink{pos}{POS}}{Part of Speech}
so that I can follow a link from the table of acronyms to the according glossary entry. Trying both statements results in compile errors, since - i guess - it's not possible to nest \glslink in any other command.

Regards,
Robbiie
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

[Glossaries] Making acronym entries link to glossary entries

Post by nlct »

Hi,

sorry I misunderstood. Is the following what you want?

Code: Select all

\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage[style=altlist,
nonumberlist,
numberedsection,
acronym,
toc]
{glossaries}

\makeglossaries

\newglossaryentry{pos}{name=\glslink{POS}{Part Of Speech},text=Part of Speech,description={``Part of Speech''
 Description}}
\newacronym[description={\glslink{pos}{Part of Speech}}]{POS}{POS}{Part Of
 Speech}

\begin{document}

\gls{POS}

\printglossaries

\end{document}
Note that for the above example you will need to do:

pdflatex filename
makeglossaries filename
pdflatex filename
makeglossaries filename
pdflatex filename

to get the completed document. (This is because pos isn't referenced in the main body of the document, so it won't be referenced until the list of acronyms is present.)

Regards
Nicola Talbot
robbiie
Posts: 3
Joined: Wed Nov 05, 2008 5:22 pm

Re: [Glossaries] Making acronym entries link to glossary entries

Post by robbiie »

Hi Nicola,

that's exactly what I wanted! Thanks a lot!!!! :D
amarradi
Posts: 1
Joined: Sat Sep 19, 2009 10:48 am

Re: [Glossaries] Making acronym entries link to glossary entries

Post by amarradi »

Hallo together,

thats a cool board, Thanks. I need help.
I use this tutorial and it runs very well. How can i sort my glossary, tike the Acronym-List?

Many greeting from germany

Bye amarradi
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

[Glossaries] Making acronym entries link to glossary entries

Post by nlct »

amarradi wrote:How can i sort my glossary, tike the Acronym-List?
You need to use an external indexing application to sort the glossary. You can either use makeindex or xindy. If you have Perl installed, you can just run the makeglossaries script with the name of your document without the .tex extension.

Regards
Nicola Talbot
TeddyNall
Posts: 1
Joined: Mon Apr 25, 2011 6:27 pm

[Glossaries] Making acronym entries link to glossary entries

Post by TeddyNall »

can u give me a zithromax link to the perl script?
Last edited by TeddyNall on Tue May 10, 2011 5:45 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

[Glossaries] Making acronym entries link to glossary entries

Post by localghost »

TeddyNall wrote:can u give me a link to the perl script?
The Perl script is part of the glossaries package. Install it by the package manager of your TeX distribution. With Strawberry Perl you can install a free interpreter for Wind0ws.


Best regards and welcome to the board
Thorsten
Post Reply