1

I am using revtex4-1 for formatting notes that may become part of background for a journal paper later. Although I like the format in general, I find that it's hard to re-use elements from the title block elsewhere. Specifically, I would like to include the author name in the footer. Although I read through revtex4-1.cls, its treatment of author(s) is complicated and I couldn't figure out what to call to reprint author name(s) outside of \maketitle. I tried a few commands I found in the .cls such as \@author@finish, etc., but none were effective. I was able to print the title in the body and footer as desired, as shown in the demo below.

How can I print revtex author(s) outside of the title block?

% Document basic setup
\documentclass[aip,jmp,amsmath,amssymb,nofootinbib,reprint]{revtex4-1}

% Header and footer setup
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\rfoot{\footnotesize \thepage/\pageref{LastPage}}
\cfoot{}
% \lfoot{\makeatletter\@title\makeatother}  % Can't do it here

% Start document and define title and author
\begin{document}
\title{TITLE: revtex4-1 author and title demo}
\author{author NAME name}
\date{20190607}
% \lfoot{\makeatletter\@title\makeatother}  % Can't do it here
\maketitle

% \lfoot{\makeatletter\@title\makeatother}  % Can't do it here

% This works: -----
\makeatletter
\let\runtitle\@title
\makeatother
\lfoot{\runtitle}
% -----

% This doesn't work: -----
\makeatletter
\let\runauthor\@author
\makeatother
\cfoot{\runauthor}
% -----

\thispagestyle{fancy}  % Apply header and footer style to first page, too

% Content ------------------------------------------------------
\section{Introduction}
Words words words.

\subsection{Try to print the title in the text}
\begin{enumerate}
    \item \verb|\thetitle| doesn't work. %\thetitle
    \item \verb|\makeatletter\@title\makeatother| does work: \makeatletter\@title\makeatother
    \item \verb|\runtitle| does work (because we defined it): \runtitle
\end{enumerate}

\subsection{Try to print the author in the text}
\begin{enumerate}
    \item \verb|\theauthor| doesn't work. %\theauthor
    \item \verb|\makeatletter\@author\makeatother| doesn't produce an error, but it doesn't print anything: \makeatletter\@author\makeatother
    \item \verb|\runauthor| doesn't produce an error (because we defined it), but it still doesn't print anything: \runauthor
    \item \verb|\makeatletter\@author@finish\makeatother| prints nothing: \makeatletter\@author@finish\makeatother
\end{enumerate}

\end{document}

output_from_sample_latex

EL_DON
  • 231

1 Answers1

1

This answer: https://tex.stackexchange.com/a/31070/120014 clearly shows a workaround where a different command is defined and then input to \title{} or \author{} to avoid complexities associated with the true \author{} and \title{}, such as being cleared during \maketitle. So I simply define \firstauthor and input that to both \author and the footer:

\newcommand{\firstauthor}{author NAME name}
\author{\firstauthor}

...

\cfoot{\firstauthor}

This is sufficient for showing just the first author or documents with one author, which is fine for use in the footer. It does not show the whole author list that revtex keeps and shows in the title block. It also doesn't access the true author list that revtex keeps. Although I don't have a practical need for it anymore, I am still curious to know how to make revtex print its author list.

EL_DON
  • 231