# Page number and name in the header of each page

How do you enter a page number on the right-hand side of each page?

Also, is there a command so that "My name" is on the top left corner of each page except the first page?

And maybe put a bar below the two above items?

I am using document class resume.

 \documentclass[margin,line]{resume}

\begin{document}
\name{\Large My name}
\begin{resume}

This is page 1.

\newpage

This is page 2.

\newpage

This is page 3.

\end{resume}
\end{document}


Thank you.

-
Suggestion: fancyhdr package. fancyhdr package –  azetina Sep 20 '12 at 15:38
Thank you for the link. I will try that! –  math-visitor Sep 20 '12 at 15:39
@azetina please turn your comment into an answer, with a complete MWE :) –  cmhughes Sep 20 '12 at 16:21

fancyhdr works with resume (which is based on article), but some adjustments are necessary:

\documentclass[margin,line]{resume}

\usepackage{kantlipsum} % to provide mock text

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\makeatletter
\makeatother
\AtBeginDocument{\thispagestyle{empty}}

\begin{document}

\name{\Large My name}

\begin{resume}

\kant

\end{resume}

\end{document}


Comment out the \fancyheadoffset line if you don't want that the line on the pages following page 1 are extended on the left. If you want to increase the separation between the rule and the text, modify the value of \headsep and also the value of \topmargin.

Note. The mysterious \expandafter\@gobble\@name is needed because \@name expands to \Large My Name, after \name{My Name}, so we have to remove the unwanted \Large command.

-
Thank you. This is helpful, but since I do not have kantlipsum.sty, I followed the instructions as on this link: ctan.org/tex-archive/macros/latex/contrib/kantlipsum and downloaded kantlipsum.sty, kantlipsum.dtx, kantlipsum.ins. But neither the name in the header or the page numbers are showing up on my pdf file. Am I at a trust-worthy website and am supposed to download the kantlipsum package from this link? –  math-visitor Sep 21 '12 at 3:45

The following code may be of assistance to solve your issue:

\documentclass[letterpaper]{article}
\usepackage{lipsum}% Used to create the random paragraphs
\usepackage{fancyhdr}
\pagestyle{fancy}
\lfoot{} % controls the left corner of the footer
\cfoot{} % controls the center of the footer
\rfoot{Page~\thepage} % controls the right corner of the footer

Could you try and mould the answer into a resume document class? There may be specific requirements dealing with something other than article. –  Werner Sep 20 '12 at 16:47
Sure, but what type of class is resume? –  azetina Sep 20 '12 at 16:49
Based on the document class options ([margin,line]) and only using \name, it could be a renamed version of the res class. –  Werner Sep 20 '12 at 17:44