How can I change the default behaviour of \rightmark to display the last defined section before the current page. The default behaviour appears to be the last defined section before the current page IF there are no new sections on the current page.
For example, the following produces a sample document with the default behaviour of \rightmark.
\documentclass[a4paper,oneside]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\begin{document}
\chapter{Lorem Ipsum :)}
\section{Paragraphs 1 - 5}
\lipsum[1-5]
\section{Paragraphs 6 - 10}
\lipsum[1-5]
\section{Paragraphs 11 - 15}
\lipsum[1-5]
\end{document}
It looks a bit like this
I would like to make it look a bit more like this. Notice the header now references the last defined section


\firstmarkand\botmarkbut you want\topmark– David Carlisle Sep 01 '18 at 15:58\topmarkmight be prefixed byCONTENTS? I posted a new question about it here. I appreciate any help you can give – Dan Sep 01 '18 at 19:57