[Tex/LaTex] Adding Multiple Authors with Different Affiliation in LaTeX Article

affiliationarticleauthor

Updated:

I want would like to add more than one author affiliation in latex article. To make this I have tried with the following latex code :

\documentclass{article}
\usepackage{authblk}
\author[1]{A. Author}
\author[2]{B. Author}
\author[3]{C.  Author}
%\author[2]{Corresponding Author\thanks{email@2nduniversity.com}}
\affil[1,2]{Institution of the Authors from  University}
\affil[3]{Institution of the Authors from  College}
\affil[1]{Email id: aa@gmail.com}
\affil[2]{Email id: ba@gmail.com}
\affil[1,3]{Email id: ca@gmail.com}
\title{Title of the Presentation}
\date{}
%
\begin{document}
\maketitle
Main Part of document here.
\end{document}. 

But it does not give my desired output. I want exactly like this :
enter image description here
How can I do this?

Best Answer

Apart from correcting the typo in \author[1]{C. Author}, which should be \author[3]{C. Author} as pointed out in the comments, you can use the approach in this answer to make the emails appear on the same line. The following code block determines what appears between affiliations (in this case, a comma followed by a space):

\makeatletter
\renewcommand\AB@affilsepx{, \protect\Affilfont}
\makeatother

To make this change local, you should enclose all the email code in curly braces {}. To include the Email ids: header, you can use an affiliation whose tag is a space (\affil[ ]{Email ids}) and : as separator:

{
    \makeatletter
    \renewcommand\AB@affilsepx{: \protect\Affilfont}
    \makeatother

    \affil[ ]{Email ids}

    \makeatletter
    \renewcommand\AB@affilsepx{, \protect\Affilfont}
    \makeatother

    \affil[1]{aa@gmail.com}
    \affil[2]{ba@gmail.com}
    \affil[1,3]{ca@gmail.com}
}

enter image description here

The full code is as follows:

\documentclass{article}
\usepackage{authblk}
\author[1]{A. Author}
\author[2]{B. Author}
\author[3]{C.  Author}
%\author[2]{Corresponding Author\thanks{email@2nduniversity.com}}
\affil[1,2]{Institution of the Authors from  University}
\affil[3]{Institution of the Authors from  College}
{
    \makeatletter
    \renewcommand\AB@affilsepx{: \protect\Affilfont}
    \makeatother

    \affil[ ]{Email ids}

    \makeatletter
    \renewcommand\AB@affilsepx{, \protect\Affilfont}
    \makeatother

    \affil[1]{aa@gmail.com}
    \affil[2]{ba@gmail.com}
    \affil[1,3]{ca@gmail.com}
}

\title{Title of the Presentation}
\date{}
%
\begin{document}
    \maketitle
    Main Part of document here.
\end{document}.