Currently, I'm using the acronym
package to keep my thesis clear and understandable, because it is quite heavy on the use of acronyms in some parts. Because of this, some pages have so many acronyms, that they more or less look like someone went haywire with a blue text coloring tool.
So my question is: is it possible for either the acronym
package, or the hyperref
package, to only use one hyperref per acronym per page? So if one encounters an acronym for the first time on a page, he will be able to click on it and taken to the acronym definition list. The rest of the same acronyms on the same page will be printed without link.
I do not know if it is even possible for LaTeX
to have this kind of 'reflection' on pages and links while compiling the document. Searching on this provided no results, which is why I'm resorting to the gurus over here.
Best Answer
I don't know how to achieve what you want with the
acronym
package, but here's a solution that usesglossaries
. In order to get it as close as possible to theacronym
package, I've used theshortcuts
,nonumberlist
,nogroupskip
andnopostdot
package options and used new commands introduced inglossaries
version 4.04 that allow you to create the list of acronyms without the need to usemakeindex
orxindy
. You just need to usepdflatex
twice to make the list of acronyms appear.First page:
Second page:
Third page:
The only drawback with this approach is the old problem of the page number not getting updated until the page-spanning paragraph has been completed. (See Page number is wrong at start of page.) It would require a bit of trickery with writing the page number to the aux file to fix it.
Edit:
I've just uploaded
glossaries
version 4.06 to CTAN. (It make take a few days to get across all the mirrors and into the TeX distributions.) This version introduces a new command (\glsifhyper
) that can be used within the acronym style to determine if the starred or non-starred version of commands like\ac
was used. This means you can force off the hyperlink for individual entries (although you might want to wait until the final version of your document before you make such manual adjustments).Updated MWE:
The second page looks like:
Update:
Here's a solution using
glossaries-extra
(at least v1.08). It's slightly different from the above in that it has a hyperlink on first use, whereas with the above examples the first hyperlink is the first subsequent use. (The problem with the page-spanning paragraph is still present.) Theglossaries-extra
package automatically implements thenopostdot
option, so I've omitted it from the option list.This uses the entry-counting mechanism to switch off the hyperlink. It also uses a new command
\printunsrtglossary
rather than the\makenoidxglossaries
and\printnoidxglossary
combination. The\printunsrtglossary
command is the closest match to theacronym
package as it doesn't sort or produce a location list, but simply lists the terms in the order of definition. This means you only need to usepdflatex
once to make the list appear.Start of first page:
Second page: