# How to write rhead only on the first page - what is wrong with the code?

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}

\usepackage{amssymb}
\usepackage{atbegshi}
\pagestyle{fancy}

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


• Would it be possible somehow with \AtBeginShipoutFirst{\rhead{}}? Mar 20 at 8:08
• your code writes only on the first page -- what is the problem Mar 20 at 8:30
• I do not know, I added the result to my question. Mar 20 at 8:50
• My impression is that you want to remove the right header in the first page, is this correct? Mar 20 at 9:15

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}

\begin{document}

AAAAAAAA

\newpage

AAAAAAAAA

\end{document}


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

• Thank you very much Mar 20 at 10:48