3

How to write rhead only on the first page? The other rheads should be nothing. Thank you

\documentclass{article}    
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}    
\begin{center}
text
\rhead{name}
\newpage
text
\end{center}    
\end{document}
5

Using \AtBeginShipoutFirst of the atbegshi package we can execute some code while the first page is being output, e.g., we could do \rhead{} there:

\documentclass{article}    
\usepackage{atbegshi}
\usepackage{fancyhdr}
\rhead{name}
\AtBeginShipoutFirst{\rhead{}}
\pagestyle{fancy}
\begin{document}    
\begin{center}
text
\newpage
text
\end{center}    
\end{document}
7

Use a different page style for the first page.

\documentclass{article}
\usepackage{fancyhdr}

\usepackage{kantlipsum} % for fill-in text

\fancyhf{} % clear all fields
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}

\fancypagestyle{firstpage}{%
  \fancyhf{}% clear all fields
  \fancyfoot[C]{\thepage}%
  \fancyhead[R]{name}
  \renewcommand{\headrulewidth}{0pt}%
}

\pagestyle{fancy}
\AtBeginDocument{\thispagestyle{firstpage}}

\begin{document}

\kant[1-10]

\end{document}

This is more flexible than other approaches.

enter image description here

2

Like this -

\documentclass{article}    
\usepackage{fancyhdr}

\begin{document}    
\thispagestyle{fancy}
\begin{center}
text
\rhead{name}
\newpage
text
\end{center}    
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.