I would like to include \thesubsection in my header, referring to the first instance of subsection, and not the last as seems to be the default.
The following MWE says it all:
\documentclass[a5paper]{article}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage[a5paper]{geometry}
\lhead{\thesubsection}
\pagestyle{fancy}
\begin{document}
\section{Section 1}
\subsection{Subsection 1}
\lipsum[1]
\section{Section 2}
\subsection{Subsection 1}
\lipsum[2]
\pagebreak
\subsection{Subsection 2}
\lipsum[3]
\subsection{Subsection 3}
\lipsum[4]
\section{Section 3}
\subsection{Subsection 1}
\lipsum[5]
\subsection{Subsection 2}
\lipsum[6]
\subsection{Subsection 3}
\lipsum[7]
\end{document}
Results:
Page What I want What I get
1 1.1 2.1
2 2.2 3.1
3 3.2 3.3