So many questions around dealing with fancyhdr
, but none works for me...
I have an article
where I want my document title and ONLY THE SECTION NAME in the header, not the subsection, not the section number, nothing but the name. For this, I created a custom pagestyle (have different pagestyles in my document), see MWE below. But what ever I try, I still get the subsection in the title, even including its number. Why?
\documentclass{article}
\newcommand{\maintitle}{MAIN TITLE}
\newcommand{\docname}{My Document}
% tabular package
\usepackage{tabularx}
% header / footer
\usepackage{fancyhdr}
\renewcommand{\sectionmark}[1]{\markright{#1}}
% define own pagestyle
\fancypagestyle{complete}{%
\fancyhf{}%
\lfoot{%
\begin{tabularx}{\textwidth}{X X}
\maintitle & Page~\thepage
\end{tabularx}
}
\rhead{\docname~-~\rightmark}
}
% Let the madness begin...
\begin{document}
\pagestyle{complete}
\section{First Section}
Blablubb ...
\newpage
\subsection{First Subsection}
dumdidum ...
\section{Second Section}
Blablablubb ...
\subsection{Second Subsection}
dumdidumdidum ...
\end{document}