# Numberless sectionmark

### Context

I am trying to display the name of a numberless section (\section*{}) in the header of a document with the fancyhdr package.

I am already displaying the name of sections and removing their numbering from the label with the extramark and titlesec packages.

### Issue

The numberless section does not appear in the header leaving it empty. It seems to work properly for the table of contents which is also a numberless section (correct me if I am wrong).

### MWE

\documentclass{article}

\usepackage{mwe}

\usepackage{extramarks}
\usepackage{fancyhdr}
\usepackage{titlesec}

\title{Document}

{\nouppercase
\firstleftmark}
}

\pagestyle{fancy}

\renewcommand{\sectionmark}[1]{\markboth{#1}{}}

\begin{document}

\section*{Test}
\newpage
\tableofcontents
\newpage
\blinddocument

\end{document}


### Example

You can manually trigger the entry in the headline for the unnumbered section:

\documentclass{article}

\usepackage{mwe}

\usepackage{extramarks}
\usepackage{fancyhdr}
\usepackage{titlesec}

\title{Document}

{\nouppercase
\firstleftmark}
}

\pagestyle{fancy}

\renewcommand{\sectionmark}[1]{\markboth{#1}{}}

\begin{document}

\section*{Test}
\markboth{Test}{}

\newpage
\tableofcontents
\newpage
\blinddocument

\end{document}

• While this does indeed fix this specific issue, it does require to type twice the name of the section. Is it possible to automatically retrieve it somehow? – Akaizoku May 24 '18 at 10:46
• @Florian Something like \renewcommand*{\secwhead}[1]{\section*{#1}\sectionmark{#1}}? (Could be improved for optional arguments etc. etc.) – moewe May 24 '18 at 11:13