0

The acro's documentation tells us:

When acro is used together with the package hyperref [ORT21] then you can make use of the following option:

make-links = true|false If this is activated then every short or alternative appearance of an acronym will be linked to its description in the list of acronyms.

And that is indeed the case in the following example:

\documentclass{article}
\usepackage{acro}
\usepackage{hyperref}

\acsetup{
  make-links = true,
  % link-only-first = true
}

\DeclareAcronym{cd}{
  short = CD ,
  long = compact disc
}

\begin{document}
\ac{cd}
\newpage
\printacronyms
\newpage
Foo.
\end{document}

Next, the documentation tells us:

link-only-first = true|false

If this is activated in addition to make-links then only the first short or alternative appearance of an acronym will be linked to its description in the list of acronyms.

But, as soon as the link-only-first option is uncommented in the example above, the (first) short appearance of the acronym is linked:

  • to the last page of the document,
  • not to its description in the list of acronyms.

Interestingly enough, the .aux files are the same in both cases.

Do you understand what's going on and how to circumvent this problem?

1 Answer 1

1

it is imho a bug in acro. It uses the same code inside the \printacronym to set the targets, and with the link-only-first boolean set to true the target is suppressed there too.

\documentclass{article}
\usepackage{acro}
\usepackage{hyperref}

\acsetup{
  make-links = true,
  link-only-first = true
}

\DeclareAcronym{cd}{
  short = CD ,
  long = compact disc
}


\begin{document}
\ac{cd}
\newpage
\ExplSyntaxOn
\bool_set_false:N\l__acro_link_only_first_bool
\ExplSyntaxOff
\printacronyms
\newpage
Foo.
\end{document}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .