# Automatically refer to n-th author

I'm writing a paper with many people, and to be honest, at this point I'm not even sure who will be listed as an author in the final version. In the text, I would like to write things like "the forty-second author conjectured" but without knowing '42' in advance (okay, I must admit that in reality we are not that many).

Is there a way to label the authors to achieve this?

This is not a pure LaTeX solution, but if you use R, with knitr there are an easy way:

\documentclass{article}
\usepackage{parskip}
<<theverylonglistofauthors,echo=F>>=
authors <- c(
"Davy Jones ",
"Hannibal Lecter",
"Norman Bates",
"Freddy Krueger",
"Jack Torrance",
"James Moriarty"
)
@
\title{We are legion}
\author{\Sexpr{combine_words(authors[1:3], sep=" \\and ", and="")}}
\date{\today}

\begin{document}
\maketitle
\section{Introduction}

Forensic analysis of \Sexpr{authors[2]} about legacy of commercial transcantions
of \Sexpr{authors[1]} showed  that he is as guiltless as the mam of
\Sexpr{authors[3]}.
All work and no play makes Jack a dull boy.
All work and no play makes Jack a dull boy.
All work and no play makes Jack a dull boy.

\section{Acknowledgements}

We would like to thank to \Sexpr{combine_words(authors[5])} the  help
to write the present document with the guidance of
\Sexpr{combine_words(authors[c(4,6)])}.

Back luck, \Sexpr{combine_words(authors[7])}, you are out!

\end{document}


• LOL, amazing answer! – domotorp Dec 18 '18 at 8:37
• @Fran +1 just for the text... Lol... – AndiW Dec 18 '18 at 10:25