1

How to write rhead only on the first page? Why does this code not work?

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}

\lhead{} \chead{}

\usepackage{amssymb} \usepackage{atbegshi} \rhead{AAAAAA} \AtBeginShipoutFirst{\rhead{}} \pagestyle{fancy}

\begin{document} AAAAAAAA \newpage AAAAAAAAA \end{document}

enter image description here

1 Answers1

2

My impression is that you want to suppress the header in the first page.

You can use a conditional in the code for the right header (but this will keep the rule).

\documentclass[11pt,a4paper]{article}
\usepackage{fancyhdr}

\pagestyle{fancy} \fancyhead{} \fancyhead[R]{\ifnum\value{page}=1 \else AAAAAA\fi} \setlength{\headheight}{13.6pt}

\begin{document}

AAAAAAAA

\newpage

AAAAAAAAA

\end{document}

Alternatively, issue \thispagestyle{plain} after \begin{document}.

egreg
  • 1,121,712