1

So I'm using the endnotes package and it works great. However, I wish to change the title from 'Notes' to say 'Endnotes' and to give it a bit of custom formatting to match the rest of the book.

I can just change the word using \renewcommand easily enough. However, as soon as I add in formatting such as size and alignment this also changes the headers to be the same, rather than the fancy headers I wanted.

\begin{filecontents}[overwrite]{testtext.tex}
Lorem ipsum dolor sit amet\endnote{consectetur adipiscing elit. Etiam elementum diam eu blandit rutrum. Donec facilisis}, eros quis vehicula laoreet, ipsum ipsum maximus ex, non auctor magna magna non felis. Curabitur elementum vel nisl non fringilla\endnote{Vestibulum massa augue, accumsan ut ligula nec, tincidunt facilisis libero.} Suspendisse eget magna lectus. Nullam turpis lectus, dictum quis elit nec, efficitur sollicitudin ligula\endnote{In hac habitasse platea dictumst. Fusce neque leo, vestibulum eu dapibus vitae, feugiat at lectus. Maecenas a maximus nisl. Donec elit dolor, pharetra nec felis ut, bibendum gravida nibh. Nulla sagittis ut metus vitae bibendum. Nulla quam lorem, interdum elementum mi eu, vestibulum interdum mi. Cras maximus placerat eros, vitae vulputate eros vehicula et. Aliquam et tellus non nulla dictum malesuada. Nunc luctus nisi diam. Curabitur dapibus sem odio, in feugiat ante consectetur nec}.

Fusce consequat finibus leo, ut vulputate turpis cursus ac. Ut pretium tellus sapien, et congue eros consectetur ac. Etiam sollicitudin non tortor sit amet luctus. Cras nec metus at elit imperdiet ornare. Praesent elementum sagittis congue. Sed congue vulputate velit, congue tristique metus porta sit amet. Nullam sit amet turpis pretium, dignissim augue vehicula, semper nisl. Nulla vel dictum nulla. Quisque erat nibh, accumsan sit amet lorem sit amet, aliquet\endnote{egestas nisl. Nullam ultrices aliquet turpis in tincidunt. Nulla facilisi.} Aenean convallis eu nibh sit amet lacinia. Aenean in ipsum quis augue ultrices facilisis.

Curabitur\endnote{sit amet dui vehicula, egestas quam ut, venenatis eros. Ut eu posuere nulla. Fusce dictum dui sit amet maximus sodales. Pellentesque ante magna, consequat vel justo nec, efficitur aliquam nulla. Vestibulum scelerisque in metus sit amet fermentum. Vivamus id massa vitae libero congue sodales. Ut mollis orci et purus mollis, eget egestas lacus pulvinar. Curabitur eget mi nec urna} fringilla malesuada. Nullam eu eros at urna\endnote{posuere consectetur. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus eget ex ligula. Pellentesque tempor est eget nibh elementum, suscipit commodo urna sollicitudin}. Proin finibus arcu ut odio lobortis scelerisque non vel metus. Fusce pellentesque sapien sed massa aliquam, in elementum elit posuere.
\end{filecontents}

\documentclass[12pt]{book}

\usepackage[paperwidth=5.5in,paperheight=8.5in]{geometry}
\usepackage{endnotes}

\renewcommand{\notesname}{{\Large\centering\bfseries Endnotes}}

\begin{document}
\input{testtext}
\theendnotes
\end{document}
8
  • \renewcommand{\notesname}{{\Large\centering\bfseries Endnotes}}? The extra braces should keep it local, see if that works and if not, let us know
    – JamesT
    Commented Oct 5, 2022 at 13:56
  • @JamesT No. That didn't work. It removed any formatting for the title, but the header is still bold and Large
    – JRCSalter
    Commented Oct 5, 2022 at 15:31
  • Could you edit into your question a Minimal Working Example (tex.meta.stackexchange.com/q/228/273733), called MWE please? I tried to turn your code into one but it ran into errors about undefined control sequences. Include everything that is relevant to the question, for example fancyhdr and the commands are not necessary for section titles.
    – JamesT
    Commented Oct 5, 2022 at 16:02
  • @JamesT Sorry, I thought that did compile. I've edited my question with a working example now.
    – JRCSalter
    Commented Oct 5, 2022 at 18:35
  • 1
    @JamesT Updated now to include it
    – JRCSalter
    Commented Oct 5, 2022 at 19:08

1 Answer 1

1

So after looking at the .sty file on CTAN, the issue was with with \enoteheading using the \notesname that you were changing. The solution is to use a \newcommand that defines just the plain text name (\EndNoteCustomName) and then modify the \enoteheading code like this:

\begin{filecontents}[overwrite]{testtext.tex}
Lorem ipsum dolor sit amet\endnote{consectetur adipiscing elit. Etiam elementum diam eu blandit rutrum. Donec facilisis}, eros quis vehicula laoreet, ipsum ipsum maximus ex, non auctor magna magna non felis. Curabitur elementum vel nisl non fringilla\endnote{Vestibulum massa augue, accumsan ut ligula nec, tincidunt facilisis libero.} Suspendisse eget magna lectus. Nullam turpis lectus, dictum quis elit nec, efficitur sollicitudin ligula\endnote{In hac habitasse platea dictumst. Fusce neque leo, vestibulum eu dapibus vitae, feugiat at lectus. Maecenas a maximus nisl. Donec elit dolor, pharetra nec felis ut, bibendum gravida nibh. Nulla sagittis ut metus vitae bibendum. Nulla quam lorem, interdum elementum mi eu, vestibulum interdum mi. Cras maximus placerat eros, vitae vulputate eros vehicula et. Aliquam et tellus non nulla dictum malesuada. Nunc luctus nisi diam. Curabitur dapibus sem odio, in feugiat ante consectetur nec}.

Fusce consequat finibus leo, ut vulputate turpis cursus ac. Ut pretium tellus sapien, et congue eros consectetur ac. Etiam sollicitudin non tortor sit amet luctus. Cras nec metus at elit imperdiet ornare. Praesent elementum sagittis congue. Sed congue vulputate velit, congue tristique metus porta sit amet. Nullam sit amet turpis pretium, dignissim augue vehicula, semper nisl. Nulla vel dictum nulla. Quisque erat nibh, accumsan sit amet lorem sit amet, aliquet\endnote{egestas nisl. Nullam ultrices aliquet turpis in tincidunt. Nulla facilisi.} Aenean convallis eu nibh sit amet lacinia. Aenean in ipsum quis augue ultrices facilisis.

Curabitur\endnote{sit amet dui vehicula, egestas quam ut, venenatis eros. Ut eu posuere nulla. Fusce dictum dui sit amet maximus sodales. Pellentesque ante magna, consequat vel justo nec, efficitur aliquam nulla. Vestibulum scelerisque in metus sit amet fermentum. Vivamus id massa vitae libero congue sodales. Ut mollis orci et purus mollis, eget egestas lacus pulvinar. Curabitur eget mi nec urna} fringilla malesuada. Nullam eu eros at urna\endnote{posuere consectetur. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus eget ex ligula. Pellentesque tempor est eget nibh elementum, suscipit commodo urna sollicitudin}. Proin finibus arcu ut odio lobortis scelerisque non vel metus. Fusce pellentesque sapien sed massa aliquam, in elementum elit posuere.
\end{filecontents}

\documentclass[12pt]{book}

\usepackage[paperwidth=5.5in,paperheight=8.5in]{geometry}
\usepackage{endnotes}

\newcommand\EndNoteCustomName{Endnotes}

\renewcommand{\notesname}{\Large\centering\textbf{\EndNoteCustomName}}

\makeatletter
\renewcommand\enoteheading{\section*{\notesname
  \@mkboth{\MakeUppercase{\EndNoteCustomName}}{\MakeUppercase{\EndNoteCustomName}}}%
  \mbox{}\par\vskip-\baselineskip}
\makeatother

\begin{document}
\input{testtext}
\theendnotes
\end{document}

This produces this:

enter image description here

I changed from \bfseries to \textbf{} in your formatting code, it can probably be improved but this at least works.

1
  • 1
    Thanks. That worked!
    – JRCSalter
    Commented Oct 5, 2022 at 19:46

You must log in to answer this question.

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