8

The Latex document below (from my earlier question Chapter name appearing in the endnotes) produces endnotes which are numbered by arabic numbers in the superscript, and there is indentation for each note.

I would like: (1) to have notes numbered by regular-sized Arabic numbers (not superscripts) followed by a period (like this: "1."), and (2) notes to appear with no indentation at the beginning of the note (but all paragraphs within a given note, starting with the second one, should be indented).

\documentclass[12pt]{book}

\usepackage{endnotes,chngcntr}

\counterwithin*{endnote}{chapter}  % Reset endnote numbering every new chapter

\let\latexchapter\chapter
\makeatletter
\renewcommand\enoteheading{%
\setcounter{secnumdepth}{-2}
\latexchapter*{\notesname\markboth{NOTES}{}}
\mbox{}\par\vskip-\baselineskip
\let\@afterindentfalse\@afterindenttrue
}
\makeatother

\usepackage{xparse}


\RenewDocumentCommand{\chapter}{som}{%
\IfBooleanTF{#1}
{\latexchapter*{#3}%
\setcounter{endnote}{0}%
\addtoendnotes{%
 \noexpand\enotedivision{\noexpand\subsection}
   {\unexpanded{#3}}}%
}
{\IfNoValueTF{#2}
 {\latexchapter{#3}}
 {\latexchapter[#2]{#3}}%
\addtoendnotes{%
 \noexpand\enotedivision{\noexpand\subsection}
   {\chaptername\ \thechapter. \unexpanded{#3}}}%
}%
}
\makeatletter
\def\enotedivision#1#2{\@ifnextchar\enotedivision{}{#1{#2}}}
\makeatletter

\begin{document}

\setcounter{tocdepth}{1}

\tableofcontents

\chapter*{Preface\markboth{MY BOOK}{PREFACE}}

\addcontentsline{toc}{chapter}{Preface}

This is the Prologue.\endnote{There is one endnote here, which should
appear under the heading "Prologue". The paragraph should start
with ``1.'' and should not be indented.

This is the second paragraph of the same note. It should be indented.}

\chapter{Amazing Story}
As I am describing this story, I make a note which should appear at
the end.\endnote{This the first endnote. It should start with ``1.''

This is the second paragraph of the same note. It should be indented.

This is the third paragraph of the same note. It should also be
indented.} And then I make the second note.\endnote{This is the second
note. It should start with ``2.''}

\chapter{Another Amazing Story}
In this chapter, there are no endnotes. So it should not appear in the
"Notes" at the end.

\chapter{Yet Another Amazing Story}
In this chapter, I have some notes again, which I want to go to the
end.\endnote{This note should appear at the end, under the heading
"Chapter 3. Yet Another Amazing Story", with the counter reset to 1,
since this is the first endnote of this chapter.}

\chapter*{Epilogue\markboth{EPILOGUE}{}}

\addcontentsline{toc}{chapter}{Epilogue}

This is the Epilogue.\endnote{One last endnote. It should have number
1 and should appear under the heading ``Epilogue''.}

\addtoendnotes{\unexpanded{\enotedivision{}{}}}

\cleardoublepage

\addcontentsline{toc}{chapter}{Notes}

\theendnotes

\end{document}
  • @egreg: Do you have any advice? – Latex user May 10 '13 at 0:14
6

Just change the definitions of \enoteformat:

\documentclass[12pt]{book}

\usepackage{endnotes,chngcntr}

\counterwithin*{endnote}{chapter}  % Reset endnote numbering every new chapter

\makeatletter
\renewcommand\enoteformat{%
  \parindent=1.8em
  \noindent\@theenmark.\ }
\makeatother

<the rest is the same>

enter image description here

  • Thank you! However, if I do this, then in the main body of the text the references to the footnotes also appear as arabic numerals, NOT as superscripts. But I want the references to the notes to apear as superscripts. How to do this? – Latex user May 14 '13 at 0:58
  • @Latexuser Fixed – egreg May 14 '13 at 7:28
  • Thanks, now it works! I have another question: is there a way to remove the page number on the first page of Notes? (it appears on the bottom of the page, as it does on the opening page of each chapter - not at the top of the page, as it does for all other pages) I want to remove this page number globally on the opening page of every chapter, but don't know how. For each chapter, except for the Notes, I simply include the line \thispagestyle{empty}, but for the Notes this does not work. How to do it? (I thought of creating a new "Question" entry for this, but not sure it merits one). – Latex user May 14 '13 at 18:52
  • @Latexuser This might be a good question; but in essence it reduces to make LaTeX emit \thispagestyle{empty} instead of \thispagestyle{plain} for the chapter opening pages. I don't think it's a good idea, though. – egreg May 14 '13 at 19:46
  • Well, this wasn't my idea. I have to do it, because of the way the pages will be cut. Is it possible to make LaTeX emit \thispagestyle{empty} instead of \thispagestyle{plain} for the chapter opening pages? – Latex user May 14 '13 at 21:19

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.