# single option breaks cite if the acronym is only used once

Issue #70 resolved
Daniel Bosk
created an issue

When the single option is used and an acronym is only used once, then the citation doesn't happen. However, if the acronym is used more than once (or single is not used) then the citation appears as expected. I expect the citation to always appear on the first use, even if I use it only once.

I suspect that the printing of the citation is connected to the printing of the acronym, and when the acronym doesn't happen the citation doesn't happen either.

Minimal working example:

\documentclass{article}

\usepackage[single]{acro}
\DeclareAcronym{TAG}{%
short = {TAG},
long = {the awesome group},
cite = {TAG},
}

\usepackage[backend=bibtexu]{biblatex}

\begin{filecontents}{\jobname.bib}
@online{TAG,
author = {The Awesome Group},
URL = {https://foo.bar/}
}
\end{filecontents}

\begin{document}
Testing \ac{TAG} \dots

\printbibliography{}
\end{document}


It's tested against the master branch.

1. repo owner

Maybe it isn't clear enough from the manual: a single appearance is not the same as the first appearance. Since the default setting is cite = first a single appearance gets no citation. The citation is there with cite = all.

\documentclass{article}

\usepackage{acro}
\acsetup{
single ,
cite = all
}

\DeclareAcronym{TAG}{
short = {TAG},
long = {the awesome group},
cite = {knuth:ct}
}

\usepackage{biblatex}

\begin{document}

Testing \ac{TAG}

\printbibliography

\end{document}


If you don't want to switch to cite = all you can redefine \acro_single:n:

\documentclass{article}

\usepackage{acro}
\acsetup{
single ,
cite = first
}

\DeclareAcronym{TAG}{
short = {TAG},
long = {the awesome group},
cite = {knuth:ct}
}

\usepackage{biblatex}

\ExplSyntaxOn
\cs_set_protected:Npn \acro_single:n #1
{
\acro_cite: % <<<< this is added
\acro_single_form:nV {#1} \l__acro_single_form_tl
\acro_after:n {#1}
}
\ExplSyntaxOff

\begin{document}

Testing \ac{TAG}

\printbibliography

\end{document}


One might argue, though, that a single appearance should be the same as a first appearance with respect to citations. I might change the behaviour…

2. reporter

Great answer, thanks! Yes, that they are the same is what I intuitively expected.

3. repo owner

I sent v2.4b to CTAN today. There the behaviour will be as expected. (It's now documented, too)

4. reporter

Great, thanks! That was very quick :-)