Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
3  
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
add comment

2 Answers

up vote 5 down vote accepted

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
\fancyhead[L]{\textbf{\expandafter\@gobble\@name}}
\makeatother
\fancyhead[R]{\thepage}
\fancyheadoffset[L]{\sectionwidth}
\setlength\headheight{12pt}
\setlength\headsep{3pt}
\addtolength\topmargin{-15pt}
\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.

enter image description here

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.

share|improve this answer
    
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
add comment

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}
\lhead{My Name} % controls the left corner of the header
\chead{} % controls the center of the header
\rhead{} % controls the right corner of the header
\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
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\thispagestyle{plain}% Removes the header from the first page. Change plain to empty to remove the numbering entirely.
\lipsum[2-10]
\end{document}

enter image description here

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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