A "blind endnote" consists of the page number to which the endnote refers, some text that precedes where the endnote number would be in the text, and the text of the endnote. In the text itself, there is no number for the endnote. This structure is used for all the endnotes (in this case, in a book using memoir documentclass). This has become a popular endnote style for books targeted at the general public rather than academics.
The text looks like this (assume the text is on page 3):
This is the text with an endnote that will appear in the endnotes, but no endnote number.
The endnote looks like this:
3 "no endnote number": This is the text of the endnote."
The right side of the endnote text is ragged. The left side is left justified, with the left margin for the text even with the start of the footnote text (in the example, even with the opening quotation mark).
I started with unnumbered endnotes referenced by page and extract
which gets me close to my desired outcome. I have played with enotez
and other packages, but I get farther rather than closer to the desired outcome. I have three problems I can't solve:
I can't replace the endnote number (in the endnotes) with the page number (it tried to redefine
@makeenmark
aspageref
, but that did not work). There should not be a period after the page number.I can't get the headings in the endnotes for chapters where I have eliminated the chapter number (i.e., the Preface and the Conclusion). I understand I need additional code to address the * version of chapter headings, but the combinations I tried did not get the desired result.
When a chapter does not have endnotes (unlikely, but possible), I want that chapter heading omitted from the endnotes. In the example, the heading for the second chapter would not be in the endnotes.
I have reached the limits of my current abilities. My MWE is as follows:
\documentclass{memoir}
\usepackage{endnotes}
\usepackage{etoolbox}
\usepackage{ebgaramond}
\makeatletter
\def\endnote{\@ifnextchar[\@xendnote{\stepcounter{endnote}%
\protected@xdef\@theenmark{\theendnote}%
\label{en:\@theenmark}%
%\@endnotemark
\@endnotetext}}
\def\@makeenmark{\pageref{en:\@theenmark}}
\renewcommand{\enotesize}{\normalsize}
\renewcommand\enoteformat{%
\raggedright
\leftskip=1.8em
\makebox[0pt][r]{\theenmark. \rule{0pt}{\dimexpr\ht\strutbox}}%
}
\apptocmd{\@makechapterhead} {\addtoendnotes{\protect\subsection* {\textsc{\MakeLowercase{\thechapter: #1}}}\indent}}{}{}
\makeatother
\begin{document}
\tableofcontents
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
This is a sentence in the preface.\endnote{\textbf{``in the preface'':} This is the preface endnote. I have made each of the endnotes long so that the text will wrap.}
\chapter{First Chapter}
This is a sentence in the first chapter.\endnote{\textbf{``the first chapter'':} This is the first chapter endnote. I have made each of the endnotes long so that the text will wrap.}
\chapter{Second Chapter}
This is a sentence in the second chapter; it does not have an endnote.
\chapter{Third Chapter}
This is a sentence in the third chapter.\endnote{\textbf{``the third chapter'':} This is the third chapter endnote. I have made each of the endnotes long so that the text will wrap.}
\chapter*{Conclusion}
\addcontentsline{toc}{chapter}{Conclusion}
This is a sentence in the conclusion.\endnote{\textbf{``in the conclusion'':} This is the conclusion endnote. I have made each of the endnotes long so that the text will wrap.}
\clearpage
\theendnotes
\end{document}
The MWE gets me the following (which does not have the Preface or Conclusion headings in the endnotes and does not have the page numbers instead of the endnote numbers):