2

I'm struggling to make every endnote entry not take a new line. I read this answer, which explained a lot, but didn't answer my doubt, as said, how can I make endnotes entries not start a new line. For example:

1- entry 1 2- entry 2

Instead of

1- entry 1

2- entry 2

  • Do you want ALL the endntes to be one paragraph? Or just some of them? The former would involve a nearly complete rewire of the endnotes package. OTOH, you can pack a savebox until you are ready to put it into an endnote. – John Kormylo Jul 26 '20 at 17:52
  • I just want the endnotes entries not start in a new line, but start right after the last one when there is room for it. – Fábio José de Jesus Jul 26 '20 at 18:03

2 Answers2

3

In endnotes.sty, \theendnotes is defined as follows:

\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
  \begingroup
    \makeatletter
    \edef\@tempa{`\string >}%
    \ifnum\catcode\@tempa=12%
      \let\@ResetGT\relax
    \else
      \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
      \@makeother\>%
    \fi
    \def\@doanenote##1##2>{\def\@theenmark{##1}\par\begingroup
        \@ResetGT
        \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
        \enoteformat}
    \def\@endanenote{\par\endgroup}%
    \enoteheading
    \enotesize
    \input{\jobname.ent}%
  \endgroup}

All you need to do is to hack this to remove the \pars inside the definition. Here is the MWE, where two \pars are just removed:

\documentclass{article}
\usepackage{endnotes}
\makeatletter
\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
  \begingroup
    \makeatletter
    \edef\@tempa{`\string >}%
    \ifnum\catcode\@tempa=12%
      \let\@ResetGT\relax
    \else
      \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
      \@makeother\>%
    \fi
    \def\@doanenote##1##2>{\def\@theenmark{##1}\begingroup
        \@ResetGT
        \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
        \enoteformat}
    \def\@endanenote{\hspace{1em}\endgroup}%
    \enoteheading
    \enotesize
    \input{\jobname.ent}%
  \endgroup}
\makeatother
\begin{document}
One\endnote{this is the first endnote. this is the first endnote.} two\endnote{this is the second endnote. this is the second endnote.} three \endnote{this is the third endnote.}

\theendnotes \end{document}

You can change the space between endnotes by modifying the amount of \hspace{1em}.

Result

domperor
  • 448
2

You can use enotez together with enumitem.

\documentclass{article}
\usepackage{enotez}
\usepackage[inline]{enumitem}

\DeclareInstance{enotez-list}{itemize}{list}{list-type = itemize} \setlist[itemize]{itemjoin={\qquad}}

\begin{document}

A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two} A\endnote{entry one} B\endnote{entry two}

\printendnotes[itemize*]

\end{document}

enter image description here

egreg
  • 1,121,712
  • Good take, but I can't keep the entries together. It's a large list of contents plus questions. But I appreciate though. – Fábio José de Jesus Jul 27 '20 at 11:41
  • 1
    @FábioJosédeJesus Sorry, but I can't understand: you asked for endnotes to be set as a single unit. Please, be more precise about your aim. – egreg Jul 27 '20 at 12:35