2

I have a document that uses fancyhdr (with fancy page style enabled), and also uses endnotes.sty to create endnotes. However, the pages that have endnotes on get the text "Notes" inserted into the header, which I do not want (the header should contain only a banner graphic). I can not find any hint in the endnotes.sty as to how to suppress this text in the header, can anyone advise?

Here is a simple tex script that generates the undesired behaviour as an example:

    %% LyX 2.1.1 created this file.
\documentclass[english]{extarticle}
\usepackage{mathpazo}
\usepackage{helvet}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm,headheight=1cm,headsep=1cm,footskip=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{color}
\usepackage{endnotes}
\makeatletter
\usepackage{lipsum}
\makeatother
\usepackage{babel}

\begin{document}
\title{\textcolor{blue}{Endnotes create unwanted text in the header of the
last page}}
\author{A.N. Other}
\maketitle
\subsection*{\lipsum[2]}
\lipsum[2-4]\endnote{This is an endnote}
\lipsum[5-10]
\theendnotes
\end{document}

Many thanks

1 Answer 1

3

endnotes.sty has

\def\enoteheading{\section*{\notesname
  \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
  \mbox{}\par\vskip-\baselineskip}

which updated the marks for the header. You can redefine this to something like

\renewcommand\enoteheading{\section*{\notesname}\mbox{}\par\vskip-\baselineskip}

A complete example:

\documentclass[english]{extarticle}
\usepackage{mathpazo}
\usepackage{helvet}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm,headheight=1cm,headsep=1cm,footskip=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{color}
\usepackage{endnotes}
\makeatletter
\usepackage{lipsum}
\makeatother
\usepackage{babel}

\renewcommand\enoteheading{\section*{\notesname}\mbox{}\par\vskip-\baselineskip}

\begin{document}
\title{\textcolor{blue}{Endnotes create unwanted text in the header of the
last page}}
\author{A.N. Other}
\maketitle
\subsection*{\lipsum[2]}
\lipsum[2-4]\endnote{This is an endnote}
\lipsum[5-10]
\theendnotes
\end{document}

The resulting document:

enter image description here

1
  • Thanks - a perfect answer in less than 10 minutes after posting the question. Awesome! (upvoted this answer, but it won't show until I get enough rep)
    – dww
    Commented Oct 16, 2015 at 0:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .