[Tex/LaTex] Authors with multiple affiliations

templatestitles

The problem

Using this template I want to have an author in the list of authors with multiple affiliations.

Like in this mockup ("Othercoauthor" has multiple affiliations):

enter image description here

The code

This is some exemplary code (you only need ifmbe.cls):

\documentclass[nouppercase]{ifmbe}

\title{Authors With Multiple Affiliations}

\affiliation{First Institution/Department, Affiliation, City, Country }{FIRSTAFF}
\affiliation{Second Institution/Department, Affiliation, City, Country }{SECONDAFF}

\author{A.B. Firstauthor}{FIRSTAFF}
\author{C. Coauthor}{SECONDAFF}
\author{D.E. Othercoauthor}{FIRSTAFF}

\begin{document}

\maketitle

\end{document}

The output is the same as in the mockup except for the affiliations of "Othercoauthor" (only "1" in superscript).

The \author command is defined in ifmbe.cls like this:

\renewcommand{\author}[2]{
      \stepcounter{ifmbe@authors}
      \expandafter\def\csname ifmbe@author\alph{ifmbe@authors}\endcsname
      {#1$^{\expandafter\the\csname ifmbe@affiliationcounter#2\endcsname}$}
}

What I have tried

I tried "faking" it by putting superscript numbers into the author's name. However, the text size/shape of the numbers that I put manually there was slightly off and I couldn't figure out why.

I rewrote the renewing of \author such that the command took a larger number of arguments. However, this didn't help since I couldn't put "empty" affiliations for those authors that had less affiliations than the number of arguments.

So I guess I need to make the number of arguments variable or add optional arguments.

Best Answer

I did a basic redefinition of \author to include an optional argument; the value used in this argument will be appended, together with a comma, to the superscript number used in the affiliation:

\documentclass[nouppercase]{ifmbe}

\makeatletter
\renewcommand{\author}[3][]{
      \stepcounter{ifmbe@authors}
      \expandafter\def\csname ifmbe@author\alph{ifmbe@authors}\endcsname
      {#2$^{\expandafter\the\csname ifmbe@affiliationcounter#3\endcsname
        \if\relax\detokenize{#1}\relax\else,#1\fi}$}
}
\makeatother

\title{Authors With Multiple Affiliations}
\affiliation{First Institution/Department, Affiliation, City, Country }{FIRSTAFF}
\affiliation{Second Institution/Department, Affiliation, City, Country }{SECONDAFF}
\author{A.B. Firstauthor}{FIRSTAFF}
\author{C. Coauthor}{SECONDAFF}
\author[2]{D.E. Othercoauthor}{FIRSTAFF}

\begin{document}

\maketitle

\end{document}

enter image description here

A more general redefinition could be made, but for a one-case situation, this should be enough.