[Tex/LaTex] IEEE styling authors with 5 columns

authorieee-styleieeetran

I am writing a paper and want to format the authors section for 5 authors. Using the basic IEEE template (see code below), I managed to have this (see Picture). Can someone know how this can be more organized: 3 authors on 1st line, 2 authors on the second line?

\author{\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{laboratory} \\
City, Country \\
email}
}

enter image description here

Best Answer

You can use \newlineauthors (defined below) to insert a \par at the point it's called, together with \hfills on either side to stretch out the authors on the rows involved:

enter image description here

\documentclass[conference]{IEEEtran} 

\makeatletter
\newcommand{\newlineauthors}{%
  \end{@IEEEauthorhalign}\hfill\mbox{}\par
  \mbox{}\hfill\begin{@IEEEauthorhalign}
}
\makeatother


\title{A title}
\author{\IEEEauthorblockN{Firstname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Secondname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Thirdname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{laboratory} \\
City, Country \\
email}
\newlineauthors
\IEEEauthorblockN{Fourthname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{Laboratory} \\
City, Country \\
email}
\and
\IEEEauthorblockN{Fifthname Lastname}
\IEEEauthorblockA{\textit{University of X}\\
\textit{laboratory} \\
City, Country \\
email}
}

\begin{document}

\maketitle

\end{document}