0

This is what I want to achieve for endnotes in a book typeset using LuaLaTeX 2020.

  1. Endnote marker at the left margin
  2. Hanging indent (endnote text should indented throughout, not just first line of each note)
  3. No line space between successive notes
  4. 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.

1
  • The memoir class (a superset of book, \report, ...) provides a very flexible endnote capability (called pagenote) in the documentation. Read 12.6 Endnotes in the manual (>texdoc memoir`). Aug 11 '21 at 17:20
0

Finally got it working. The trick is to remove \raggedright, not add \justify but instead add \noindent before \makebox. 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} 

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.