In exam documents where there are index pages and the page numbering restarts, I'm having trouble with getting the lhead and rhead to work correctly. Reference this example:

\documentclass[letterpaper, 12pt, twoside]{exam}

\usepackage{abbrevs}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{hyperref}
\usepackage{lipsum}

\definecolor{SolutionColor}{rgb}{0.8,0.9,1}
\renewcommand{\solutiontitle}{\noindent}

\begin{document}

\title{Sample Number Errors}
\maketitle
\thispagestyle{empty}
\newpage

\thispagestyle{empty}
\newpage

\setcounter{page}{1}
\pagenumbering{roman} %use lowercase Roman numerals for page numbers

Revision history page goes here.
\newpage

\setcounter{tocdepth}{1}
\tableofcontents
\newpage

%reset the page counter for the regular pages
\setcounter{page}{1}
\pagenumbering{arabic} %use standard numbers for the page number

\lipsum[1-50]

\end{document}


Here, everything looks fine until you get to the third page of content (IE: title page is good, copyright page is good, revision history page is good, table of contents is good, then the first two pages of content are good). On the third page of content, the header stops switching between lhead and rhead. The page numbering is on the inside spine instead of the outside. In fact, for every subsequent page after page 2, the header is always using the rhead definition only, regardless of which page I'm on.

How can I fix this for my document? Note that I left all the \usepackage and preamble in the example, just in case something odd is interfering/conflicting with what I'm trying to do.

\rhead[<1>]{<2>} prints <1> on page 1 and <2> on all other pages. The same is true for \lhead.

If you want to achieve what you want you have to substitute the lines

\rhead[\thepage]{logo goes here}


with

\rhead{\oddeven{\thepage}{logo goes here}}


Complete MWE

\documentclass[letterpaper, 12pt, twoside]{exam}

\usepackage{abbrevs}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{multirow}
\usepackage[table]{xcolor}
\usepackage{hyperref}
\usepackage{lipsum}

\definecolor{SolutionColor}{rgb}{0.8,0.9,1}
\renewcommand{\solutiontitle}{\noindent}

\begin{document}

\title{Sample Number Errors}
\maketitle
\thispagestyle{empty}
\newpage

\thispagestyle{empty}
\newpage

\setcounter{page}{1}
\pagenumbering{roman} %use lowercase Roman numerals for page numbers

Revision history page goes here.
\newpage

\setcounter{tocdepth}{1}
\tableofcontents
\newpage

%reset the page counter for the regular pages
\setcounter{page}{1}
\pagenumbering{arabic} %use standard numbers for the page number

\lipsum[1-50]

\end{document}


Output

• @Jon You're welcome. Glad to help. – karlkoeller Dec 12 '13 at 16:52