# Running head wrong in endnotes chapter when using enotez package

I use the enotez package (current version, 0.9a) for endnotes. When I print the endnotes (using \printendnotes), the running head of the endnotes chapter contains the name of the previous chapter instead of "Notes".

Here is a minimal working example:

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enotez}
\usepackage{lipsum}

\begin{document}

\chapter{Introduction}

First paragraph.\endnote{\lipsum{3}}

\lipsum{5}

Last paragraph.\endnote{\lipsum{3}}

\printendnotes

\end{document}


The behaviour is the same when I use KOMA-Script's scrlayer-scrpage package and configure the running head with \pagestyle{scrheadings} and \automark{chapter}.

I am not sure if I am doing something wrong or if it is a bug. Is there a solution or workaround for fixing this behaviour?

Emit the proper marks:

\documentclass[a4paper,12pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enotez}
\usepackage{lipsum}

\makeatletter
\makeatother

\begin{document}

\chapter{Introduction}

First paragraph.\endnote{\lipsum{3}}

\lipsum{5}

New paragraph.\endnote{\lipsum{3}}

Last paragraph.\endnote{\lipsum{3}}

\printendnotes

\end{document}


As you're using scrreport, an easier way is available:

\setenotez{list-heading=\addchap{#1}}


• With class scrreprt you can use \setenotez{list-heading=\addchap{#1}} to get the desired result. – esdd Jul 7 at 23:18
• @esdd As you see I'm not expert in these classes. The method I suggested works also for the standard classes. I know, KOMA-script classes are full of bell and whistles, but the manuals are unreadable and the name of commands not really good: why \addchap and not the clearer \addchapter? A chap in English is very different from a chapter. – egreg Jul 7 at 23:29
• @KeksDose I beg to disagree about scrguien. I consulted it many times, so I could make an opinion about it. – egreg Jul 9 at 12:05