[Tex/LaTex] Get a line instead of “Notes” when using endnotes

endnotesfootnotes

I'm using the following code to generate an endnote section (instead of having footnotes pop up on every page they are referred to on.

\documentclass{article} 
\usepackage{endnotes} 
\let\footnote\endnote
\def\footnotetext{\endnotetext[\number\numexpr\value{endnote}+1]}
\let\footnotemark\endnotemark 
\begin{document} 
\footnote{This is a footnote} 
\theendnotes 
\end{document}

However, instead of the endnotes having the title "Notes", I would like there to only be a line above the text, just like with standard footnotes. How do I accomplish this?

Best Answer

The header of the endnotes are saved in the the command \enoteheading. Here the original definition.

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

To setup the rule you can use:

\def\enoteheading{\par\kern2\baselineskip%
                  \footnoterule%
                  \kern1\baselineskip}

Here the MWE:

\documentclass{article} 
\usepackage{endnotes,showframe} 
\let\footnote\endnote
\def\footnotetext{\endnotetext[\number\numexpr\value{endnote}+1]}
\let\footnotemark\endnotemark 

\def\enoteheading{\par\kern2\baselineskip%
                  \footnoterule%
                  \kern1\baselineskip}

\begin{document} 
\footnote{This is a footnote} 
\theendnotes 
\end{document}