# footmisc effects with endnotes

I want my endnotes to simulate the effect of

\usepackage[para,norule,hang]{footmisc}


With these settings, footnotes occur within a single paragraph. Each endnote, by contrast, begins on a new line. I've added some code (from Alan Munn, re hspace except at the beginning of a line) to kill the indent, but can't figure out how to replace with the carriage carry with the same horizontal spacing as footmisc places between the footnotes.

An example:

\documentclass{article}
\usepackage{endnotes}
\usepackage[para,norule,hang]{footmisc}

\usepackage{etoolbox}

\makeatletter
\patchcmd{\@makefntext}{.5em}{0em}{}{}
\makeatother

%KILL ENDNOTE INDENT
%\def\enoteformat{\rightskip=0pt \leftskip=0pt \parindent=0em \leavevmode\llap{\makeenmark}}
\patchcmd{\enoteformat}{1.8em}{0pt}{}{}

\begin{document}

Gallia\footnote{in} est\footnote{one} omnis\footnote{paragraph}
divisa\endnote{in} in\endnote{a} partes\endnote{vertical} tres\endnote{list}

\newpage

\theendnotes

\end{document}

-

Here you need to patch a more substantial piece of code, so I don't think it's so easily done with a patchcmd. Here's a solution.

\documentclass{article}
\usepackage{endnotes}
\usepackage[para,norule,hang]{footmisc}

\usepackage{etoolbox}

\makeatletter
\patchcmd{\@makefntext}{.5em}{0em}{}{}
\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}%
\enotesize
\input{\jobname.ent}%
\endgroup}
\makeatother
%KILL ENDNOTE INDENT
\patchcmd{\enoteformat}{1.8em}{0pt}{}{}
\begin{document}

Gallia\footnote{in} est\footnote{one} omnis\footnote{paragraph}
divisa\endnote{in} in\endnote{a} partes\endnote{vertical} tres\endnote{list}

\newpage

\theendnotes

\end{document}


-
Thanks. That works perfectly. Off to inspect the code. (Apologies for the misattribution of code. I've edited the question.) –  Daniel Harbour Jun 23 '12 at 13:02
All I did was remove two \par commands from the code and replaced one with an \hspace`. –  Alan Munn Jun 23 '12 at 13:05