This is what I want to achieve for endnotes in a book typeset using LuaLaTeX 2020.
- Endnote marker at the left margin
- Hanging indent (endnote text should indented throughout, not just first line of each note)
- No line space between successive notes
- Endnote text fully justified
I started with the answer here
\documentclass{book}
\usepackage{endnotes}
\usepackage{lipsum}
\renewcommand\enoteformat{%
\raggedright
\leftskip=1.8em
\makebox[0pt][r]{\theenmark. \rule{0pt}{\dimexpr\ht\strutbox+\baselineskip}}%
}
\begin{document}
\endnote{\lipsum[1]}\endnote{\lipsum[2]}
\theendnotes
\end{document}
and changed the code to remove the space between two notes by deleting +\baselineskip. This worked and the extra space was gone. So then I tried to justify the endnote text using justify (I am using ragged2e anyway in my book). This is my code now
\documentclass{book}
\usepackage{endnotes}
\usepackage{lipsum}
\usepackage{ragged2e}
\renewcommand\enoteformat{%
\justify
\leftskip=1.8em
\makebox[0pt][r]{\theenmark. \rule{0pt}{\dimexpr\ht\strutbox}}%
}
\begin{document}
\endnote{\lipsum[1]}\endnote{\lipsum[2]}
\theendnotes
\end{document}
But this reintroduced the space between the endnotes. I tried playing around but cannot figure out how to eliminate the space.
memoirclass (a superset ofbook, \report, ...) provides a very flexible endnote capability (calledpagenote) in the documentation. Read 12.6 Endnotes in the manual (>texdoc memoir`). – Peter Wilson Aug 11 '21 at 17:20