2

Hello this is my first post so sorry if i am not clear enough somewhere. I have been trying to write my lab report using Revtex 4.2. I also used the fancyhdr package to generate a headline with some text in it. That worked fine for all of the pages expect from the first one. By messing around with the code i realised that this is due to \maketitle which clashes with fancyhdr.

\documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
\usepackage{fancyhdr}
\usepackage{hyperref}

\pagestyle{fancy}
\fancyhf{}
\rhead{text 1}
 \lhead{text 2}
 \chead{\large{text 3}}
 \begin{document}



  \title{Title}

  \author{Author}

   \begin{abstract}
    Abstract
   \end{abstract}


  \maketitle

  \section{section}

  \end{document}

enter image description here

However if i comment out the \maketitle command it works

    \documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
    \usepackage{fancyhdr}
    \usepackage{hyperref}

    \pagestyle{fancy}
    \fancyhf{}
    \rhead{text 1}
    \lhead{text 2}
    \chead{\large{text 3}}
    \begin{document}



    \title{Title}

     \author{Author}

     \begin{abstract}
      Abstract
     \end{abstract}

     %\maketitle

     \section{section}

      \end{document}

enter image description here

How can i fix that and have both title+abstract and the headline on the page? Thank you in advance.

1 Answer 1

1

The plain page style is used on the page on which you used \maketitle. You can overcome this by adding \thispagestyle{fancy} right after the \maketitle command:

enter image description here

\documentclass[aps,prl,twocolumn,groupedaddress]{revtex4-2}
\usepackage{fancyhdr}
\usepackage{hyperref}

\pagestyle{fancy}
\fancyhf{}
\rhead{text 1}
\lhead{text 2}
\chead{\large{text 3}}
 
\begin{document}

\title{Title}
\author{Author}
\begin{abstract}
    Abstract
\end{abstract}

\maketitle
\thispagestyle{fancy}

\section{section}
  

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .