I have been searching for hours on trying to figure out why I cannot get a subsection title to appear on the first page of my document.
I have loaded fancyhdr and use
\pagestyle{fancy}
but I cannot get the subsection to appear when I use \rightmark
.There was a thread posted in 2009 on this very same topic, but no one responded to this person's inquiry.
I am stuck in the same boat, and I couldn't find an answer for why I still have this problem when I did several comprehensive general internet searches and various placements of
\pagestyle{fancy}
and other related commands.What's going on?
Here is an example.
Code: Select all
\documentclass[11pt]{article}
\usepackage{fancyhdr}
\begin{document}
\pagestyle{fancy}
\fancyhead[L]{}
\fancyhead[R]{\rightmark}
% This won't work on first page and I cannot for the life of me figure out why.
\thispagestyle{fancy} % doesn't matter where I put this
\section{Section title}
\subsection{I want this at the top of all pages including the first}
% subsection not present at the top of the first page
Stuff on the first page
Second paragraph of the first page
\newpage
% subsection is present at the top of the second page
Second page text
\end{document}