0

I want to reuse footnotes. The problem is that it is inside \authors, and some solutions won't work.

I tried first the fixfoot package, but it gives an error, and the package is not being updated for 4 years now.

This fantastic answer I found here at TeX Stackexchange works just fine, but I'm interested in understanding and creating a simple tweak.

1st: how it is working

\documentclass{article}

\newcommand{\setfoot}[2]{% \footnote{#2}% \newcounter{#1}% \setcounter{#1}{\value{footnote}}% }

\newcommand{\getfoot}[1]{% \footnotemark[\value{#1}]% }

\title{Comparing two solutions}

\author{Last1, A.\setfoot{unia}{University of Pedramburguer}\ a1@some.dd\and Last2, B.\getfoot{unia}\ email1@some.dd \and Last3, C.\getfoot{unia}\ email3@some.dd \and Last4, D.\setfoot{unib}{University of Martalface}\ email4@some.dd}

\begin{document}

\maketitle

body...

\end{document}

Current Solution

2nd: how I would like it to work

\documentclass{article}

\newcommand{\setfoot}[2]{% \footnote{#2}% <<<<<<<<<<<< error when you \newcounter{#1}% \setcounter{#1}{\value{footnote}}% }

\newcommand{\getfoot}[1]{% \footnotemark[\value{#1}]% }

\title{Comparing two solutions}

\setfoot{unia}{University of Pedramburguer} %<<<<<<<<<<< try to set it out \setfoot{unib}{University of Martalface} %<<<<<<<<<<< of begin document

\author{Last1, A.\getfoot{unia}\ a1@some.dd\and Last2, B.\getfoot{unia}\ email1@some.dd \and Last3, C.\getfoot{unia}\ email3@some.dd \and Last4, D.\getfoot{unib}\ email4@some.dd}

\begin{document}

\maketitle

body...

\end{document}

So, to be able to set the foot with command \setfoot out of the \begin{document} it is necessary some TeX magic. Any help on this specific example? Thanks.

jarnosc
  • 4,266
DrBeco
  • 237

1 Answers1

1

This is closer to what your want. Note that \maketitle resets the footnote counter and changes the definition of \thefootnote to use asterisk etc. Also, author is formatted inside an environment, and you can't put footnotes inside any environment. Instead, it stores \footnotetext in a global macro \@thanks for later expansion.

A misspelled label in \getfoot will produce a ?.

\documentclass{article}

\title{Comparing two solutions}

\makeatletter \newcommand{\setfoot}[2]{% #1=label, #2=footnote text \stepcounter{footnote}% \expandafter\xdef\csname fn@#1\endcsname{\thefootnote}% create global macro \protected@xdef@thanks{@thanks \protect\footnotetext[\the\c@footnote]{#2}}% \ignorespaces} \newcommand{\getfoot}[1]% #1=label {@ifundefined{fn@#1}{?}{\textsuperscript{\csname fn@#1\endcsname}}} \makeatother

\author{\setfoot{unia}{University of Pedramburguer} \setfoot{unib}{University of Martalface} Last1, A.\getfoot{unia}\ a1@some.dd\and Last2, B.\getfoot{unia}\ email1@some.dd \and Last3, C.\getfoot{unia}\ email3@some.dd \and Last4, D.\getfoot{unib}\ email4@some.dd}

\begin{document}

\maketitle

body...

\end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120