I am having problems getting the section name displayed on the top of my pages. I know \leftmark is the proper way to do this, but I would like that the section name is only displayed when no subsection name is present, and that it is not capitalized.
Explained in another way: This is a document of 3 pages. The first page has nothing in the header, I would like it to have "1 A section" in the header, but the following pages should remain the same:
\documentclass[twoside]{article}
\usepackage{fancyhdr}
%Header defined
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO]{\rightmark}
\fancyhead[LE]{\rightmark}
\begin{document}
\section{A section}
\newpage
\subsection{A subsection}
\newpage
\subsection{Another subsection}
\end{document}
Thanks in advance.