[Tex/LaTex] Putting name on every page in resume

resume

I am following this template to build a resume. When there are multiple pages, I was wondering how to put my name on every page? Thanks!

The code is (you may need to download the res.cls file from the link above)

\documentclass[margin, 10pt]{res} % Use the res.cls style, the font size can be changed to 11pt or 12pt here

\usepackage{helvet} % Default font is the helvetica postscript font

\setlength{\textwidth}{5.1in} % Text width of the document

\begin{document}

\moveleft.5\hoffset\centerline{\large\bf John Smith} % Your name at the top

\moveleft\hoffset\vbox{\hrule width\resumewidth height 1pt}\smallskip % Horizontal line after name; adjust line thickness by changing the '1pt'

\moveleft.5\hoffset\centerline{123 Broadway} % Your address
\moveleft.5\hoffset\centerline{City, State 12345}
\moveleft.5\hoffset\centerline{(000) 111-1111 or (111) 111-1112}

\begin{resume}
...
\end{resume}

\end{document}

Best Answer

If you use the package fancyhdr then you can put the following in your preamble:

\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Tim}

Occasionally you may want a page to have a different format.

By defining commands to handle the contents of the various positions in the headers and footers and defining a new page style, you can selectively change only parts of the page style temporarily.

Here's some code to selectively change, for only one page, the header and footer of a page. The key here is the new command \myname and the new page style noname.

\def\myname{John Smith}
\def\myleftfoot{LEFT FOOT}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{LEFT}
\chead{\myname}
\rhead{RIGHT}
\lfoot{\myleftfoot}
\cfoot{CENTER}
\rfoot{RIGHT}

Then define a new page style as follows

\makeatletter
\def\ps@noname{%%'
  \def\myname{}%%'
  \def\myleftfoot{I've been changed temporarily}%%'
}
\makeatother

Then on the page in question put the following line

\thispagestyle{noname}

The effect of redefining \myname only applies to the particular page for which you're changing the header and footer.

Related Question