11

I am trying to insert a \label in the footnote (\thanks) of the author's field with the following code

\author{Gopal \thanks{XYZ university\label{auth1}}}

However, LaTeX keeps giving the error \@xfootnotemark doesn't match its definition.

If I remove the label, then there are no errors.

Why am I trying to use a label? Two authors have the same affiliation and I want to refer the existing affiliation for the second author. I am also using hyperref enabled for pdf.

I tried to look up on net for this solution but could not find one. Any help would be greatly appreciated.

3 Answers 3

7

You could save the footnote counter and use it for the second author in the following way:

\documentclass{article}
\newcounter{savecntr}% Save footnote counter
\newcounter{restorecntr}% Restore footnote counter
\author{Gopal \setcounter{savecntr}{\value{footnote}}\thanks{XYZ University} ,
Someone else \thanks{ABC University} ,
Another \setcounter{restorecntr}{\value{footnote}}%
  \setcounter{footnote}{\value{savecntr}}\footnotemark% Print footnotemark
  \setcounter{footnote}{\value{restorecntr}} ,
Last author \thanks{IJK College}}
\title{My title}
\begin{document}

\maketitle

Here is some text.
\end{document}
​

Two different authors, same affiliation

The idea here is to store the footnote counter before reusing the affiliation, and then to restore it after you've used it so that subsequent authors receive a different (unique) \footnotemark.

Since you are using hyperref, using \footnotes as well and wanting to reference them is tricky. On the one hand, the regular titling command \author does one of two things, neither of which helps with footnotes: It typesets the contents in a tabular - a known issue that traps footnotes - and temporarily redefines the way \footnote works (by executing \let\footnote\thanks). On top of this, the hyperref README suggests the downside when "re-using a \footnotemark out of order/sequence":

The footnote support is rather limited. It is beyond the scope to use \footnotemark and \footnotetext out of order or reusing \footnotemark. Here you can either disable hyperref's footnote support by hyperfootnotes=false or fiddle with internal macros, nasty examples...

The example that follows works with modifying both the traditional footnote counter, as well as hyperref's internal Hfootnote counter. The "nasty example" makes things work, but it remains "nasty":

\documentclass{article}
\usepackage[hyperfootnotes]{hyperref}% http://ctan.org/pkg/hyperref
\newcounter{savecntr}% Save footnote counter
\newcounter{restcntr}% Restore footnote counter
\newcounter{Hsavecntr}% Save Hfootnote counter
\newcounter{Hrestcntr}% Restore Hfootnote counter

\begin{document}

\makeatletter
\begingroup
  \let\footnotesize\small \let\footnoterule\relax% Set footnote parameters
  \renewcommand\thefootnote{\@fnsymbol\c@footnote}% Style of footnotes: symbols
  \vskip 60\p@
  \begin{center}%
    {\LARGE My title \par}%
    \vskip 3em%
    {\large
      \lineskip .75em%
      \setcounter{savecntr}{\value{footnote}} \setcounter{Hsavecntr}{\value{Hfootnote}}% Save counters
      Gopal \footnote{XYZ University} ,% First author
      Someone else \footnote{ABC University} ,% Second author
      \setcounter{restcntr}{\value{footnote}} \setcounter{Hrestcntr}{\value{Hfootnote}}% Save restore counters
      \setcounter{footnote}{\value{savecntr}} \setcounter{Hfootnote}{\value{Hsavecntr}}% Restore similar counter
      Another \footnotemark ,% Print footnotemark with third author
      \setcounter{footnote}{\value{restcntr}} \setcounter{Hfootnote}{\value{Hrestcntr}}% Restore original counters
      Last author \footnote{IJK College}% Last author
    \par}%
  \vskip 1.5em%
  {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
\endgroup
\setcounter{footnote}{0}%
\makeatother

Here is some text.\footnote{Here's a footnote.}
\end{document}

The definition of the title, author and date was taken from article.cls

Correct hyperlinks from authors to footnotes/affiliations

3
  • It works but the super-scripted symbols after the names of the authors are not hyperlinked. Thanks Commented Sep 7, 2011 at 22:46
  • 1
    That's because the \author command traps the footnotes (or \thanks). I would suggest typesetting your own title then rather than using the \maketitle command.
    – Werner
    Commented Sep 7, 2011 at 23:23
  • Thank you very much for the detailed explanation and taking the trouble of putting up the complex example. Needless to say, this answers my query. Commented Sep 8, 2011 at 13:03
5

As noted in the other answer, LaTeX not only uses symbols rather than numbers to produce footnote marks in the title area (i.e, title, author(s), and date) but also "gobbles" some relevant information when producing the footnotes. This makes it impossible for the hyperref package to create hyperlinks from the footnote marks to the corresponding footnotes.

If you have several co-authors and all you are trying to achieve is to avoid repeated footnotes indicating the same affiliation(s) for two or more of the co-authors, it's not worth it (IMHO) to go to a lot of trouble to program up LaTeX's footnote markers. Instead, something like the following MWE should satisfy nearly all needs. The example employs the fact that in LaTeX the first symbolic footnote mark is a raised asterisk (*) and the second is a \dagger.

The MWE also demonstrates that the \footnote and \thanks commands both generate symbolic footnotes in the title area. Once you're past the title area, footnote numbering uses arabic numerals, as expected. Happy TeXing!

enter image description here

\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\setlength\textheight{5.5cm} % just for this example

\title{Some Title}
\author{AuthOne\footnote{University A.} % note use of "\footnote"
  \and AuthTwo\thanks{University B.} 
  \and AuthThree$^*$ 
  \and AuthFour$^\dagger$}
\date{} % suppress 'date'

\begin{document}
\maketitle   
Hello World.\footnote{More random text.}
\end{document}
2
  • This is how I addressed this issue. Thank you a lot for the trick! Commented Jun 1, 2019 at 8:14
  • @lllllllllllll - You're most welcome.
    – Mico
    Commented Jun 1, 2019 at 8:21
0

First assume that we did not have the hyperref enabled. Just define the footnote that contains a label outside of the \author{}'s braces using \footnotetext and then using a \footnoteref which you can add it by \newcommand bring it inside the \author. Of course there are things to care about such as the index of footnotes being changed between integers and symbols and their counter. I included one example below which I guess explain all of its technicalities explicitly.

\documentclass[10pt,a4paper]{article}

% LaTeX will use symbols instead of integers to index the footnotes in author section.
% We are going to have a manual footnote for the author section but defining it outside of \author{}. Then LaTeX will use integers and not symbols for indexing it.
% To keep things consistent, we use the following line to ask LaTeX to use symbols for indexing footnotes even outside of the author section. Later we will turn it back to the integers.
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

% Defining a foornoteref command to refer to the labels we define for footnotes.
\makeatletter
\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
\makeatother

% Let us assume that there are two authors with the same affiliation and we do not like to have two lines of footnotes which are exact copy of each other. So we will define this footnote outside manually once using footnotetext and then by footnoteref we put it in author section for both authors.
\footnotetext[1]{\label{foot:affiliation}Royal Persian Society of Science, Isfahan, Kingdom of Persia}

% Put the last index number of the above footnotetexts below. Otherwise the index of the footnotes in the author section will start from beginning again.
\setcounter{footnote}{1}

\author{
    AmirHosein Sadeghimanesh\footnoteref{foot:affiliation} \footnote{[email protected].??}
    and
    My Collaborator\footnoteref{foot:affiliation} \footnote{[email protected].??}
}

\title{How to have labels in footnotes in author section of a paper in \LaTeX without using a package}

\date{Mehr 28, 2581}

% Telling LaTeX that now it can start indexing footnotes with integers instead of symbols.
\renewcommand{\thefootnote}{\arabic{footnote}}

\begin{document}
    \maketitle
    
    Here we just write a sentence and give it a footnote to see that the index of footnotes are back to integers.\footnote{Just a footnote.}
    
\end{document}

And here is how the output looks like.

enter image description here

Now let us enable the hyperref. You may get the following error (at least I got).

Argument of \Hy@setref@link has an extra }.

To solve the issue, we need to move the footnotetext after \begin{document} (thanks to @UlrikeFischer ). Here is how the new code look like.

\documentclass[10pt,a4paper]{article}
\usepackage{hyperref}

% LaTeX will use symbols instead of integers to index the footnotes in author section.
% We are going to have a manual footnote for the author section but defined outside of \author{}. So LaTeX will use integers and not symbols for indexing those.
% To keep things consistent, we use the following line to ask LaTeX to use symbols for indexing footnotes even if they are defined outside of the author's braces. Later we will turn the indexing back to the integers.
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

% Defining a foornoteref command to refer to the labels we define for footnotes.
\makeatletter
\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
\makeatother

\author{
    AmirHosein Sadeghimanesh%
    \footnoteref{foot:affiliation} \footnote{[email protected].??}
    and
    My Collaborator%
    \footnoteref{foot:affiliation} \footnote{[email protected].??}
}

\title{How to have labels in footnotes in author section of a paper in \LaTeX without using a package}

\date{Mehr 28, 2581}

\begin{document}
    
    % Let us assume that there are two authors with the same affiliation and we do not like to have two lines of footnotes which are exact copy of each other. So we will define this footnote outside manually once using footnotetext and then by footnoteref we put it in author section for both authors.
    \footnotetext[1]{\label{foot:affiliation}Royal Persian Society of Science, Isfahan, Kingdom of Persia}
    
    % Put the last index number of the above footnotetexts below. Otherwise the index of the footnotes in the author section will start from beginning again.
    \setcounter{footnote}{1}
    
    
    %\begin{NoHyper}
        \maketitle
    %\end{NoHyper}
    
    % Telling LaTeX that now it can start indexing footnotes with integers instead of symbols.
    \renewcommand{\thefootnote}{\arabic{footnote}}
    
    Here we just write a sentence and give it a footnote to see that the index of footnotes are back to integers.\footnote{Just a footnote.}
    
\end{document}

And here is the output pdf.

enter image description here

Similar output as before, but now the asterisks are clickable and linked to the affiliation footnote.

You must log in to answer this question.

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