cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
40 stars 9 forks source link

Using make-links also makes indefinite article part of link #242

Open dcebulla opened 2 years ago

dcebulla commented 2 years ago

Dear all,

please consider the following example:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{acro}
\acsetup{
  make-links,
}

\usepackage{hyperref}

\DeclareAcronym{mpm}{
short=MPM,
long=mobile phase modulator,
short-indefinite=an,
long-indefinite=a,
}

\begin{document}
\iac{mpm} \par \iac{mpm}
\end{document}

In my case, the second call of \iac{mpm} leads to the result an MPM, as one would expect, but the hyperlink spreads both over the indefinite article, as well as the acronym. However, I think that only the acronym should be a link. So my question is, whether this is intended, or if this is a bug, and in any case if there is a way to "remove" indefinite articles from the hyperlinks.

Cheers, Dominik

cgnieder commented 2 years ago

It's not a bug and also not explicitly intended. It more less “happened”. The articles are determined and possibly written by \__acro_write:nn or more precisely by \__acro_write_acronym:nn which is completely embedded in \__acro_make_link:nnn (see the definition of \acro_write:nn).

Separating this is probably possible but not a task done in a few minutes…