# affiliations on the same line using authblk (command \renewcommand\AB@affilsepx not working)

I was following the solution provided in this post to put 3 affiliations on the same line using authblk but failed. The author/affiliation list is like:

\author[1]{author1}
\author[2]{author2}
\author[3]{author3}
\affil[1]{dept1}
\affil[2]{dept2}
\affil[3]{dept3}


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


in order to typeset the affiliations to:

1 dept1, 2 dept2, 3 dept3


But the result showed still as:

1 dept1
2 dept2
3 dept3


I didn't set a local repository for authblk. I used the online repo hosted and provided by my university. Would this be the reason that the \renewcommand\AB@affilspex command not working? Anyone can provide another way to achieve "affiliations on the same line" problem?

\documentclass{article}

\usepackage{authblk}

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

\author[1]{author1}
\author[2]{author2}
\author[3]{author3}
\affil[1]{dept1}
\affil[2]{dept2}
\affil[3]{dept3}

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


Here is the output,

• Thanks. I used: \makeatletter \renewcommand\AB@affilsepx{\hfill \protect\Affilfont} \makeatother to use space instead of commas between the affiliations. – haggai_e Mar 30 at 9:22