10

I would like to use a footnote in the full name of an acronym. Here is the minimal (not) working example:

\documentclass{report} 
\usepackage{acronym} 
\usepackage{footnote}
\begin{document} 
    \begin{acronym}[ABC] 
        \acro{ABC}{Alphabet\footnote{this does not work}}
    \end{acronym} 
    The \ac{ABC}\footnote{this works}.
\end{document} 

I'm already using the acronym package to link acronyms with publications:

\acro{ABC}{Alphabet\cite{publication2013abc}}

But sometimes there is either no publication or a web site is more appropriate:

\acro{ABC}{Alphabet\footnote{\url{http://website-for-abc.example.org}}}

Any hints?


Edit: Based on the feedback blow, this is another working minimal example:

\documentclass{report}
\usepackage{acronym}
\usepackage{hyperref}

\newcounter{mycount}
\newcounter{savefoot}

\makeatletter
\newcommand\acrofoot[3]{%
  \acro{#1}{#2\protect\footnote{#3}\setcounter{mycount}{\value{footnote}}}%
}
\let\acorig\ac
\renewcommand\ac[1]{%
  \begingroup%
  \setcounter{savefoot}{\value{footnote}}%
  \setcounter{footnote}{\value{mycount}}%
  \addtocounter{footnote}{-1}%
  \renewcommand\@makefntext[1]{}%
  \acorig{#1}%
  \setcounter{footnote}{\value{savefoot}}%
  \endgroup%
}
\makeatother


\begin{document}
    \begin{acronym}[ABC]
        \acrofoot{ABC}{Alphabet}{\url{http://abc.example.org}}
        \acro{XYZ}{The End}
        \acrofoot{Foo}{Bar}{\url{http://foo.example.org}}
    \end{acronym}
    The \ac{ABC}\footnote{this works}. Also see \ac{XYZ} and \ac{Foo}.
\end{document} 

Issue: As you can see in the following picture, the footnote numbering is wrong. Foo

Best regards, Alex

8
  • 1
    Welcome to TeX.sx! \protect\footnote might work, \footnote is not robust. By the way: this would work out of the box with the acro package (which also has a built-in mechanism to associate citations with acronyms by the way)
    – cgnieder
    Aug 24, 2013 at 11:47
  • @Alex I copy you code and run the case with \protect right before \footnote{this does not work} and I get 3 footnotes on the bottom of that page. Is this what you seek?
    – Jesse
    Aug 24, 2013 at 11:48
  • @Jesse: that's to be expected: once in the list, the second time when the acronym is used the first time and the third is the explicit \footnote in the text
    – cgnieder
    Aug 24, 2013 at 12:08
  • @cgnieder Thanks. Also \protect works. But produces multiple footnotes for the same acronym.
    – Alex
    Sep 12, 2013 at 7:56
  • @Jesse It's a good starting point but indeed not what I'm heading to.
    – Alex
    Sep 12, 2013 at 7:58

1 Answer 1

4

If you don't mind to create a new command \acfoot and use it instead of \ac in these cases, here is a solution:

\documentclass{report}
\usepackage{acronym}
%\usepackage{footnote}

\newcounter{mycount}
\newcounter{savefoot}

\makeatletter
\newcommand\acfoot[1]{%
  \begingroup%
  \setcounter{savefoot}{\value{footnote}}%
  \setcounter{footnote}{\value{mycount}}%
  \addtocounter{footnote}{-1}%
  \renewcommand\@makefntext[1]{}%
  \ac{#1}%
  \setcounter{footnote}{\value{savefoot}}%
  \endgroup%
}
\makeatother

\begin{document}
    \begin{acronym}[ABC]
        \acro{ABC}{Alphabet\protect\footnote{this works}\setcounter{mycount}{\value{footnote}}}
    \end{acronym}
    The \acfoot{ABC}\footnote{this works, too}.
\end{document} 

Output:

enter image description here

Note that you can also define a new command \acrofoot

\newcommand\acrofoot[3]{%
  \acro{#1}{#2\protect\footnote{#3}\setcounter{mycount}{\value{footnote}}}%
}

and use it instead of \acro giving the footnote text as the third argument:

\acrofoot{ABC}{Alphabet}{this works}

Addendum

This solution works better, but has its limitations (for example you can't use numbers in acronym definitions):

\documentclass{report}
\usepackage{acronym}
\usepackage[colorlinks]{hyperref}

\newcounter{savefoot}

\makeatletter
\newcommand\acfoot[1]{%
  \begingroup%
  \setcounter{savefoot}{\value{footnote}}%
  \setcounter{footnote}{\value{#1count}}%
  \addtocounter{footnote}{-1}%
  \renewcommand\@makefntext[1]{}%
  \ac{#1}%
  \setcounter{footnote}{\value{savefoot}}%
  \endgroup%
}
\makeatother

\newcommand\acrofoot[3]{%
  \newcounter{#1count}\acro{#1}{#2\protect\footnote{#3}\setcounter{#1count}{\value{footnote}}}%
}


\begin{document}
    \begin{acronym}[ABC]
        \acrofoot{ABC}{Alphabet}{\url{http://abc.example.org}}
        \acro{XYZ}{The End}
        \acrofoot{Foo}{Bar}{\url{http://foo.example.org}}
    \end{acronym}

    The \acfoot{ABC}\footnote{this works}. Also see \ac{XYZ} and \acfoot{Foo}.
\end{document} 

Output:

enter image description here

The trick is to define a new counter for each \acrofoot and use that one for numbering footnotes.

2
  • Good starting point. I updated my question and stated my issue with this solution up there.
    – Alex
    Sep 12, 2013 at 8:31
  • Thanks for the update. Looks good. Unfortunately, I don't really want to know whether I've to use ac or acfoot while writing. So at the end, my goal was to use footnotes in acronyms that do not repeat all the time. I started to play around with the cleverref package a bit - but and at the end I might decide to use normal references again.
    – Alex
    Sep 13, 2013 at 7:45

You must log in to answer this question.

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