I would like to have a footer on every page containing the main section (always the name of the current \section, not \subsection) and the current page, e.g.
My section heading | 42
Bonus level: Pages with a \section should only contain the page, not the heading or |
This is what I've got so far. Not really what I want but at least a starting point.
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\sectionmark}[1]{\markright{#1{\bfseries~|~}}}
\renewcommand{\subsectionmark}[1]{\markright{#1{\bfseries~|~}}}
\renewcommand{\subsubsectionmark}[1]{\markright{#1{\bfseries~|~}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[R]{\sffamily{\small\rightmark}{\bfseries\thepage}}
\pagestyle{fancy}
\begin{document}
\Blinddocument
\end{document}
