In REVTex 4.2 aapm template, including a full address with forced line brakes causes full justification. Fix

revtex

I'm using REVTeX 4.2 as a base template for creating internal documents at work (not for journal submission, I just really like the format!), and I'm having issues with the aapm template.

I want to add my full work address within the \affiliation{} environment, but when I do, it screws up the formatting. See below:

Without full address:

Without full address

\documentclass[aapm,reprint]{revtex4-2}
\begin{document}
\title[ABC-XXXXXX Fancy Paper Title]{Fancy Paper Title}
\author{M.Y. Name}
\email[]{m\[email protected]}
\affiliation{
ABC Company%\\
%123 Road Ln\\
%Fancy City, MI 48123\\
%United States
}
\date{\today}
\begin{abstract}
Fancy abstract.
\end{abstract}
\maketitle 
\section{First Section}
Stuff. Blah blah blah, etc etc etc.
\section{Second Section}
More stuff
\subsection{Look, a subsection!}
Even more stuff!
\end{document}

With full address

With full address

\documentclass[aapm,reprint]{revtex4-2}
\begin{document}
\title[ABC-XXXXXX Fancy Paper Title]{Fancy Paper Title}
\author{M.Y. Name}
\email[]{m\[email protected]}
\affiliation{
ABC Company\\
123 Road Ln\\
Fancy City, MI 48123\\
United States
}
\date{\today}
\begin{abstract}
Fancy abstract.
\end{abstract}
\maketitle 
\section{First Section}
Stuff. Blah blah blah, etc etc etc.
\section{Second Section}
More stuff
\subsection{Look, a subsection!}
Even more stuff!
\end{document}

I've tried using flushleft, but it also messed up the formatting:

With full address and flushleft

\documentclass[aapm,reprint]{revtex4-2}
\begin{document}
\title[ABC-XXXXXX Fancy Paper Title]{Fancy Paper Title}
\author{M.Y. Name}
\email[]{m\[email protected]}
\affiliation{
\begin{flushleft}
ABC Company\\
123 Road Ln\\
Fancy City, MI 48123\\
United States
\end{flushleft}
}
\date{\today}
\begin{abstract}
Fancy abstract.
\end{abstract}
\maketitle 
\section{First Section}
Stuff. Blah blah blah, etc etc etc.
\section{Second Section}
More stuff
\subsection{Look, a subsection!}
Even more stuff!
\end{document}

Any advice on how to correct this? I'm totally ok with going into the base classes and modifying them, if that will accomplish the desired result, I just don't really know where to begin with that.

Best Answer

One way it to use a minipage.

enter image description here

\documentclass[aapm,reprint]{revtex4-2}
\begin{document}
    \title[ABC-XXXXXX Fancy Paper Title]{Fancy Paper Title}
    \author{M.Y. Name}
    \email[]{m\[email protected]}
    \affiliation{%
        \begin{minipage}{\textwidth} % added <<<<<<<<<<<<<<
            \vspace{0.5\baselineskip}
            ABC Company \\
            123 Road Ln\\
            Fancy City, MI 48123\\
            United States
        \end{minipage}
    }
    \date{\today}
    \begin{abstract}
        Fancy abstract.
    \end{abstract}
    \maketitle 
    \section{First Section}
    Stuff. Blah blah blah, etc etc etc.
    \section{Second Section}
    More stuff
    \subsection{Look, a subsection!}
    Even more stuff!
\end{document}