[Tex/LaTex] Show affiliation directly under author name

affiliationauthorformatting

I'm working on a paper with three authors, each with different affiliations. I want to list the authors such that their names are on one line and their affiliations are on another line just below it, lined up so that each affiliation is directly under the author name. Is there a way to accomplish this without manually spacing the affiliations? I've tried including a table in the author box but I get errors for using a table before the document begins.

As of now I have the affiliations in a footnote, and this is the code

\documentclass[a4paper,12pt]{article}

%opening
\title{ This is a Paper }
\author{Author A\footnote{Affiliation A}, Author B\footnote{Affiliation B}, and Author C\footnote{Affiliation C}}

\begin{document}

\maketitle

\end{document}

EDIT: There is a similar question in which one of the answers uses a custom function to display the affiliation directly under the author name, but the author names are scattered in a grid. If possible, I'd like to have the author names remain in a list like

Author A, Author B, and Author C

with the affiliations directly under the author names.

Best Answer

Just use standard LaTeX syntax inside the argument of \author, i.e., use \and to separate the three author blocks. Then each block should be of the form

Author Name \\ Author Affiliation

enter image description here

\documentclass[a4paper,12pt]{article}
\title{ This is a Paper }
\author{Author A\\ \small Affiliation A % "\small" is optional
        \and 
        Author B\\ \small Affiliation B 
        \and 
        Author C\\ \small Affiliation C}
\date{\today}

\begin{document}
\maketitle
\end{document}