Text Formattingheadings in endnote

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
psw1937
Posts: 8
Joined: Sat Jan 03, 2015 5:01 am

headings in endnote

Post by psw1937 »

I want to produce two versions of a book, one with footnotes and the other with endnotes. I'm using the endnote package to convert the footnotes to endnotes to produce the second version. But I need to alter the text on the heading and get the headers on each page to look the same for the endnotes as the other chapters in the book. For example, currently the heading says "Notes", say I wish to change this to "Myheading which is underlined" and then have "something else" appear in the headers of the pages on which the endnotes themselves appear. Is there a simple way to do this?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

headings in endnote

Post by Stefan Kottwitz »

Changing the name is simple:

Code: Select all

\renewcommand*{\notesname}{Myheading}
Using \markboth you could adjust the headings, such as in this sample:

Code: Select all

\clearpage
\markboth{this and that}{something else}
\begingroup
\parindent 0pt
\parskip 2ex
\def\enotesize{\normalsize}
\theendnotes
\endgroup
This is the relevant definition in endnotes.sty:

Code: Select all

\def\notesname{Notes}%
\def\enoteheading{\section*{\notesname
  \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
  \mbox{}\par\vskip-\baselineskip}
You see, a standard section without numbering would be used, and the headers are set, but with \MakeUppercase. You could remove it in a redefinition.

So, redefinitions may look like, in your own preamble:

Code: Select all

\renewcommand*{\notesname}{Myheading}
\makeatletter
\renewcommand*{\enoteheading}{%
  \section*{\notesname}%
  \markboth{\notesname}{\notesname}%
  \@afterindenttrue}
\makeatother
The \@afterindenttrue is to get the paragraph indentation like for any following line.

Your end notes may then look like the other headings in your document, with default article settings like:
endnotes.png
endnotes.png (11.66 KiB) Viewed 4153 times
Stefan
LaTeX.org admin
psw1959
Posts: 1
Joined: Fri Aug 21, 2015 4:22 am

headings in endnote

Post by psw1959 »

Thanks Stefan. The quick and dirty way I got what I want is to renamed \notename as you suggested and then I created a myendnotes.sty file by changing lines 373-376 in the standard endnotes.sty file from

Code: Select all

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

Code: Select all

\def\notesname{Notes}%
\def\enoteheading{\label{endn}\chapter*{\notesname
  \@mkboth{\MakeUppercase{\notesname}}{\MakeUppercase{\notesname}}}%
  \mbox{}\par\vskip-\baselineskip}
This seems to give me what I want, the label just lets me get a page number in the table of contents, so I thank you and I sure my publisher will thank you as well!!
Post Reply