I am trying to figure out how it happens that \thanks
in the standard LaTeX article class (with no options specified) is typeset with an asterisk for the footnote mark.
I got lost trying to trace the definitions and redefinitions of \@thanks
and \footnotemark
and \c@footnote
through article.cls
and latex.ltx
. I also tried grepping all the LaTeX base files for \\ast
, thinking that this must be used somewhere to redefine the footnote mark, but I couldn't find anything.
(This question came up because I would like to convert the \thanks
footnote to an endnote for journal submission, but my question is about the mechanics of this command.)
MWE:
\documentclass{article}
\begin{document}
\title{Example}
\author{Name\thanks{Affiliation, e-mail}}
\maketitle
\end{document}
Here's what I have been able to figure out:
The definition of \maketitle
in article.cls
:
\newcommand\maketitle{\par
\begingroup
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
\long\def\@makefntext##1{\parindent 1em\noindent
\hb@xt@1.8em{%
\hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
I see that the footnotemark is redefined in some way, and that \@thanks
is called at the end. But \thanks
and \@thanks
are not defined in this file.
Here are the definitions of \thanks
and \@thanks
in latex.ltx
:
\def\thanks#1{\footnotemark
\protected@xdef\@thanks{\@thanks
\protect\footnotetext[\the\c@footnote]{#1}}%
}
\let\@thanks\@empty
It seems like \thanks
redefines \@thanks
to be \@thanks
plus a footnote containing its argument. It looks like \thec@footnote
would produce the value of a footnote counter and typeset a numeral, not an asterisk. The article class calls \@thefnmark
in \maketitle
but never redefines it to an asterisk (that I can tell).
Best Answer
Let's look at some definitions:
\thanks
withinarticle.cls
:This macro sets a footnote mark -
\footnotemark
. Then it adds the footnote text to\@thanks
using\protected@xdef\@thanks{\@thanks <new footnote text>}
.\maketitle
inarticle.cls
:Inside
\maketitle
, a number of redefinitions of the footnote mechanism occurs within a group\begingroup
...\endgroup
.Firstly, the footnote numbering is changed to
\@fnsymbol
- the regular*
,†
,‡
,§
,¶
,‖
,**
,††
,‡‡
, (error) sequence:Secondly, an update is made to the way the
f
ootn
otemark
andtext
is set - that is, the macros\@makefnmark
and\@makefntext
are updated. These updates (redefinitions) are very minimal in the sense that they really are very similar to the original definitions outside the\maketitle
usage (also taken fromlatex.ltx
:The only major difference is that the footnote mark is set using
\rlap
. This is because within the list of\author
s, you'd typically separate with a,
, for which this redefinition allows the footnote mark to overlap with.Thirdly the actual title is set using
\@maketitle
:The setting of the
\thanks
marks (footnote marks) as well as the collection into\@thanks
occurs with the setting of\@author
.Finally, at the end of
\maketitle
,\@thanks
is called, which "releases" the accumulated footnote texts collected with\@author
.Since
\@thanks
carries content globally (due to\protected@xdef
), it's cleared at the end of\maketitle
(outside the\begingroup
...\endgroup
scope), together with other macros.Now let's look at an example:
Note how the overlapping occurs of the footnote marks with the punctuation after
Author1
.With the addition of
to the preamble we can see the
.log
outputs the sequence of accumulate footnote texts stemming from the\thanks
inside\@author
:These are set immediately at the end of
\maketitle
as mentioned above.