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@[email protected]{%
\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).
\documentclass{article} \begin{document} \title{} \thanks{A star was born} \maketitle \end{document}
\thanks: macro:#1->\footnotemark \protected@xdef \@thanks {\@thanks \protect \footnotetext [\the \c@footnote ]{#1}}
\protected@edef
is a “cumulative” definition:\@thanks
gets what it contained before along with the text of the new footnote.