# How to use \affiliation in RevTex revtex4-2 Template in order to have the authors in the same line?

2 template (with two columns) and I would like to have the author of the paper in the same row and the affiliations all together below the authors. I'm using the following code:

\documentclass[reprint,amsmath,amssymb,aps,]{revtex4-2}
\usepackage{graphicx}
\graphicspath{{C:..}}
\usepackage{dcolumn}
\usepackage{bm}

\begin{document}
\title{Title}

\author{Author1}
\affiliation{Affiliation1}
\author{Author2}
\affiliation{Affiliation2}

\collaboration{Z}
\date{\today}

\begin{abstract}
Article abstract
\end{abstract}

\maketitle

\end{document}


In this way I obtain the first author and below it the affiliation, even more below it the second author and below the second author its affiliation. Like this:

How can I have the authors in the same row and below the the affiliations like this?

• Welcome to TeX.SX! Have you tried to list first all \author statements and then all \affiliation statements? Jan 27, 2021 at 14:11

First list all \authors, then all \affiliations. By default, multiple authors/affiliations are separated by and, but this can be changed to , using

\def\andname{\unskip,}


\documentclass[reprint,amsmath,amssymb,aps,]{revtex4-2}
\usepackage{graphicx}
\graphicspath{{C:..}}
\usepackage{dcolumn}
\usepackage{bm}
\def\andname{\unskip,}
\begin{document}
\title{Title}

\author{Author1}
\author{Author2}
\affiliation{Affiliation1}
\affiliation{Affiliation2}

\collaboration{Z}
\date{\today}

\begin{abstract}
Article abstract
\end{abstract}

\maketitle

\end{document}

• It works, Thanks a lot. Jan 27, 2021 at 15:10