1

I am using the endnotes package to list all notes at the end of a document. I'd like for the section header (notes) to also include the section number just as any other section.

MWE:

\documentclass{article}
\usepackage{endnotes}
\begin{document}
\section{Some section}
 bla bla bla\endnote{Some note}.
\theendnotes
\end{document}
1

Looking into endnotes.sty it is easy to see, that one just has to redefine the command \enoteheading. (One just has to delete on *) This just do the job.

\documentclass{article}

\usepackage{endnotes}
% Taken from endnotes.sty and changed \section*{ to \section{
\makeatletter
\def\enoteheading{\section{\notesname
\@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
\mbox{}\par\vskip-\baselineskip}
\makeatother

\begin{document}
\section{Some section}
bla bla bla\endnote{Some note}.
\endnote{Another note.} \endnote{A third note.}
\theendnotes
\end{document}
|improve this answer|||||
  • Just a follow up, but is there a reason this wouldn't work with the book class and babel? I get multiple illegal parameter errors – Lars Christian Jensen Aug 14 '17 at 19:24
  • @LarsChristianJensen This is strange, because the solution does not work if you use the book class and the babel package together. While it works if you use only one of them. I have no clue. Consider submitting a follow up question? – crixstox Aug 15 '17 at 9:23
  • Yes that what struck me as will - I'll post a follow-up. Thanks. – Lars Christian Jensen Aug 15 '17 at 12:25
1

An alternative is to use etoolbox:

\documentclass{article}
\usepackage{etoolbox}
\usepackage{endnotes}
% in \enoteheading, replace \section* with \section,
% do nothing (i.e., {}) on success, do nothing on failure
\patchcmd{\enoteheading}{\section*}{\section}{}{}
\begin{document}
\section{Some section}
 bla bla bla\endnote{Some note}.
\theendnotes
\end{document}

Result:

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.