1

I'm a newcomer to TeX so I suspect I'm overlooking something obvious but nonetheless this has got me stumped. I'm trying to set up a header which appears the same on all pages, but for some reason I can't get it to display on even-numbered pages. I'm using the article class. I've tried everything I can think of and looked up multiple references. I'm compiling with XeLaTeX on ShareLaTeX.

My code:

\documentclass[letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[]{fontspec}
\usepackage[]{titling}
\usepackage{fancyhdr}

\title{Title}
\author{Database Development Project}
\date{}

\newfontfamily\verdanaz[]{verdanaz.ttf}

\pretitle{\begin{flushright}
\includegraphics[width=1in]{logo.png}
\verdanaz\Huge\\}
\posttitle{\\*{\Large Subtitle}\par\end{flushright}}
\preauthor{\begin{flushright}}
\postauthor{\end{flushright}}
\postdate{\newpage}

\fancyhf{}
\rhead[header]{header}


\begin{document}
\pagestyle{fancy}

\maketitle
\section{Introduction}

\newpage

\section{Second Section}

\end{document}
1

1 Answer 1

1

After some more experimentation I determined that the issue was caused by the fact that \maketitle issues a thispagestyle{plain} order, as discussed here: Suppress Fancy header and footer on first page only.

Apparently \postdate{\newpage} was causing this attribute to be inherited by Page 2. My fix:

\usepackage{fancyhdr}

\fancyhf{}
\rhead[Header]{Header}

\pretitle{\begin{flushright}
\includegraphics[width=1in]{logo.png}
\verdanaz\Huge\\}
\posttitle{\\*{\Subtitle}\par\end{flushright}}
\preauthor{\begin{flushright}}
\postauthor{\end{flushright}}


\begin{document}
\pagestyle{fancy}
\maketitle
\thispagestyle{fancy}
\newpage
\section{Section 1}
Some text...
\newpage
\section{Section 2}
Some text...
\newpage
\section{Section 3}
Some text...
\newpage
\end{document}

The thispagestyle{fancy} was needed to counteract the order issued by \maketitle

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .