Closed cgnieder closed 4 years ago
Original comment by Alexander Willner (Bitbucket: [Alexander Willner](https://bitbucket.org/Alexander Willner), ).
Probably just add:
\RenewAcroCommand\ac%
{
\acro_if_acronym_used:nF {#1}
{ \acrousefootnotetrue\acro_cite: }
\acro_use:n {#1}
}
\RenewAcroCommand\Ac%
{
\acro_if_acronym_used:nF {#1}
{ \acrousefootnotetrue\acro_cite: }
\acro_first_upper:
\acro_use:n {#1}
}
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
I don't quite understand your question – why don't you just use the normal \footnote
command? \acfootnote
obviously is a command created for a special purpose!
#!latex
\DeclareAcronym{foo}{
short = {foo} ,
long = {foo bar baz},
long-post = {\footnote{\url{http://example.org` ,
}
Original comment by Alexander Willner (Bitbucket: [Alexander Willner](https://bitbucket.org/Alexander Willner), ).
I clarified the issue a bit:
#!latex
\documentclass{article}
% for demonstration purposes only: make the page small!
\usepackage[paperheight=20\baselineskip]{geometry}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Smar1992,
author = {Smarr, Larry and Catlett, Charles E},
journal = {Communications of the ACM},
number = {6},
pages = {44--52},
publisher = {ACM},
title = {Metacomputing},
volume = {35},
year = {1992}
}
\end{filecontents*}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage{url}
\usepackage{acro}
\acsetup{single,sort}
% make \normaltnote and \url robust commands, needs package `etoolbox':
\robustify\footnote
\robustify\url
\ExplSyntaxOn
\NewAcroCommand \aclu
{
\acro_is_used:nF {#1}
{ \acro_cite: }
\acro_long:n {#1}
}
\NewAcroCommand \Aclu
{
\acro_if_acronym_used:nF {#1}
{ \acro_cite: }
\acro_first_upper:
\acro_long:n {#1}
}
\ExplSyntaxOff
\DeclareAcronym{special}{
short = {special} ,
long = {special acronym} ,
long-post = {\footnote{\url{http://example.org` ,
cite = {Smar1992} ,
class = exclude
}
\DeclareAcronym{normal}{
short = {normal} ,
long = {normal acronym},
long-post = {\footnote{\url{http://myexample.org` ,
}
\begin{document}
This is a \ac{normal}. When \ac{normal} is used again, the footnotes work fine.
This is a \aclu{special} that is being used to include for example default footnotes and references.
When \aclu{special} is used a second time, analog to the reference, the footnote should only be shown once.
\printacronyms[exclude-classes=exclude]
\end{document}
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
I understand now. The example is a bit incorrect, though. The footnote is also repeated in the “normal” case (use \acl{normal}
to see this – the footnote is appended to every call of the long form).
Probably a new property similar to the cite
property is needed…
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
BTW: as as intermediate solution a combination of \footnote
and \acfootnote
could be used:
\newif\ifacrousefootnote
\newcommand\acfootnote[1]{\ifacrousefootnote\footnote{#1}\fi}
\ExplSyntaxOn
\NewAcroCommand \aclu
{
\acro_is_used:nF {#1}
{ \acrousefootnotetrue \acro_cite: }
\acro_long:n {#1}
}
\NewAcroCommand \Aclu
{
\acro_if_acronym_used:nF {#1}
{ \acrousefootnotetrue \acro_cite: }
\acro_first_upper:
\acro_long:n {#1}
}
\ExplSyntaxOff
\DeclareAcronym{special}{
short = {special} ,
long = {special acronym} ,
long-post = {\acfootnote{\url{http://example.org` , % <<<
cite = {Smar1992} ,
class = exclude
}
\DeclareAcronym{normal}{
short = {normal} ,
long = {normal acronym},
long-post = {\footnote{\url{http://myexample.org` % <<<
}
Original comment by Clemens Niederberger (Bitbucket: cgnieder, GitHub: cgnieder).
Starting with version 2.11 (to be released today or tomorrow) there will be a property before-citation
which can then be used:
\documentclass{article}
% for demonstration purposes only: make the page small!
\usepackage[paperheight=20\baselineskip]{geometry}
\begin{filecontents*}{\jobname.bib}
@article{Smar1992,
author = {Smarr, Larry and Catlett, Charles E},
journal = {Communications of the ACM},
number = {6},
pages = {44--52},
publisher = {ACM},
title = {Metacomputing},
volume = {35},
year = {1992}
}
\end{filecontents*}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage{url}
\usepackage{acro}
\acsetup{single,sort}
\ExplSyntaxOn
\NewAcroCommand \aclu
{
\acro_is_used:nF {#1}
{ \acro_cite: }
\acro_long:n {#1}
}
\NewAcroCommand \Aclu
{
\acro_if_acronym_used:nF {#1}
{ \acro_cite: }
\acro_first_upper:
\acro_long:n {#1}
}
\ExplSyntaxOff
\DeclareAcronym{special}{
short = {special} ,
long = {special acronym} ,
before-citation = {\footnote{\url{http://example.org` ,
cite = {Smar1992} ,
class = exclude
}
\DeclareAcronym{normal}{
short = {normal} ,
long = {normal acronym},
long-post = {\footnote{\url{http://myexample.org` ,
}
\begin{document}
This is a \ac{normal}. When \ac{normal} is used again, the footnotes work
fine. This is a \aclu{special} that is being used to include for example
default footnotes and references. When \aclu{special} is used a second time,
analog to the reference, the footnote should only be shown once.
\printacronyms[exclude-classes=exclude]
\end{document}
Original comment by Alexander Willner (Bitbucket: [Alexander Willner](https://bitbucket.org/Alexander Willner), ).
Thank you. However, with version `2.11`
your MWE above results in
Missing number, treated as zero.
<to be read again>
\g__acro_#3_used_bool
l.38 }
In version 3 I'd use it this way:
\documentclass{article}
\usepackage[T1]{fontenc}
% for demonstration purposes only: make the page small!
\usepackage[paperheight=20\baselineskip]{geometry}
\begin{filecontents*}{\jobname.bib}
@article{Smar1992,
author = {Smarr, Larry and Catlett, Charles E},
journal = {Communications of the ACM},
number = {6},
pages = {44--52},
publisher = {ACM},
title = {Metacomputing},
volume = {35},
year = {1992}
}
\end{filecontents*}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\usepackage{url}
\usepackage{acro}
\DeclareAcronym{special}{
short = {special} ,
long = {special acronym} ,
long-post = {\acroiffirstT{\footnote{\url{http://special.org}}}} ,
cite = {Smar1992} ,
first-style = long ,
tag = exclude
}
\DeclareAcronym{normal}{
short = {normal} ,
long = {normal acronym},
long-post = {\acroiffirstT{\footnote{\url{http://normal.org}}}}
}
\begin{document}
This is a \ac{normal}. When \ac{normal} or \acl{normal} are used again, the
footnotes work fine. This is a \ac{special} that is being used to include for
example default footnotes and references. When \ac{special} is used a second
time, analog to the reference, the footnote should only be shown once.
\printacronyms[exclude=exclude]
\end{document}
Now that I found this issue again, #161 might be a duplicate. The new MWE here seems to work for me.
Original report by Anonymous.
The MWE from http://tex.stackexchange.com/questions/236362 does not support footnotes in
normal
acronyms. See: