[Tex/LaTex] multiple footnotes using footmisc within author/thanks context

footmiscfootnotestitles

I'm working on a paper with a large list of authors, hence I've switched to numeric author indices as illustrated at http://www.latex-community.org/viewtopic.php?f=5&t=1517&view=next . Now I want to make sure that multiple affiliations for a single author are properly set off by commas, which should most obviously be handled by \usepackage[multiple]{footmisc}. Unfortunately, as shown below, this seems (?) to fail in the \author context (i.e., although other footnotes in the test document look OK, the ones in the author list are squished together)? (I was originally using \thanks for the affiliations but tried switching in this example to \footnote — I don't have any footnotes in the paper so I don't care about using a separate counter …)

(In my real example I've also got affiliations shared by multiple authors as in Using \author and \thanks for authors with common affiliations ; I generate the appropriate \footnotemark references using some R code …)

\documentclass{article}
\usepackage{scrtime}
\usepackage[multiple]{footmisc}
\makeatletter
\renewcommand*\@fnsymbol[1]{\the#1}  %% change footnotes to numeric superscripts
\makeatother
\author{Joe Schmo\footnote{first address}\footnote{second address} 
   \and Fred Blow \footnote{third address}\footnote{fourth address}}
\title{Test}
\date{\today @ \thistime}
\textheight=8cm
\begin{document}
\maketitle
Also try some footnotes: this\footnote{yes} and that\footnote{no}\footnote{maybe}
\end{document}

And the (disappointing) results (cropped with pdfcrop: a bit fuzzy, but I think it's clear even from this that the footnotes within the text are properly delimited while ones from within \author{} are not …):

[first question I've posted on tex.stackexchange.com : feel free to suggest improvements to the question / critical information I left out …]

enter image description here

Best Answer

This is because \maketitle redefines \@makefnmark:

\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}

You can undo this using etoolbox's \patchcmd:

\patchcmd\maketitle{%
  \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}}{}{}{}

So my complete solution would be as follows (also using fnpct instead of footmisc for once because I like it and second because it allows using \thanks, too):

\documentclass{article}
\usepackage{scrtime}
% fnpct instead of footmisc:
\usepackage[dont-mess-around]{fnpct}

% patch \maketitle:
\usepackage{etoolbox}
\makeatletter
% undo counter resetting in case there are more footnotes:
\patchcmd\maketitle{\setcounter{footnote}{0}}{}{}{}
% undo \@fnsymbol, add adapting of \thanks:
\patchcmd\maketitle{%
  \renewcommand\thefootnote{\@fnsymbol\c@footnote}}{\AdaptNote\thanks\multthanks}{}{}
% undo redefinition of \@makefnmark:
\patchcmd\maketitle{%
  \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}}{}{}{}
\makeatother

% both \footnote and \thanks work:
\author{Joe Schmo\footnote{first address}\footnote{second address} 
  \and Fred Blow\thanks{third address}\thanks{fourth address}}
\title{Test}
\date{\today\ @ \thistime}
\textheight=8cm

\begin{document}
\maketitle
Also try some footnotes: this\footnote{yes} and that\footnote{no}\footnote{maybe}

\end{document}

enter image description here


Update 2021, v1.0 of fnpct

The code below goves the same output as before.

\documentclass{article}
\usepackage{scrtime}
\usepackage{fnpct}

% patch \maketitle:
\usepackage{etoolbox}
\makeatletter
% undo counter resetting in case there are more footnotes:
\patchcmd\maketitle
  {\setcounter{footnote}{0}}
  {}{}{}

% undo \@fnsymbol:
\patchcmd\maketitle
  {\renewcommand\thefootnote{\@fnsymbol\c@footnote}}
  {}{}{}

% % undo redefinition of \@makefnmark:
\AdaptNote\thanks{+m}{\let\rlap\@firstofone #NOTE{#1}}
\makeatother

% both \footnote and \thanks work:
\author{Joe Schmo\footnote{first address}\footnote{second address} 
  \and Fred Blow\thanks{third address}\thanks{fourth address}}
\title{Test}
\date{\today\ @ \thistime}
\textheight=8cm

\begin{document}
\maketitle
Also try some footnotes: this\footnote{yes} and that\footnote{no}\footnote{maybe}

\end{document}