[Tex/LaTex] comma delineation of consecutive endnotes

endnotesfootnotes

Consecutive footnotes can be separated by commas by invocation of the multiple option of the footmisc package:

enter image description here

\documentclass{article}
\usepackage[multiple]{footmisc}
\begin{document}
Comma delineation of consecutive footnotes fails upon conversion to endnotes%
\footnote{First note.}%
\footnote{Second note.}.%
\end{document}

This comma delineation fails, however, if footnotes are converted to endnotes using the endnotes package:

enter image description here

\documentclass{article}
\usepackage{endnotes}
\let\footnote=\endnote
\usepackage[multiple]{footmisc}
\begin{document}
Comma delineation of consecutive footnotes fails upon conversion to endnotes%
\footnote{First note.}%
\footnote{Second note.}.%
\theendnotes
\end{document}

How can one preserve automated comma delineation of consecutive endnotes?

Best Answer

Manual solution

An admittedly not very comfortable solution is doing it manually, for example with KOMA-Script's \multiplefootnoteseparator:

\documentclass{scrartcl}
\usepackage{endnotes}
\let\footnote=\endnote

\begin{document}

Comma delineation of consecutive footnotes fails upon conversion to
endnotes\footnote{First note.}\multiplefootnoteseparator\footnote{Second
  note.}.

\theendnotes

\end{document}

enter image description here

Or with a standard class something like this:

\documentclass{article}
\newcommand*\multiplefootnoteseparator{%
  \textsuperscript{\multfootsep}\nobreak
}
\newcommand*\multfootsep{,}
\usepackage{endnotes}
\let\footnote=\endnote

\begin{document}

Comma delineation of consecutive footnotes fails upon conversion to
endnotes\footnote{First note.}\multiplefootnoteseparator\footnote{Second
  note.}.

\theendnotes

\end{document}

enter image description here

The package scrextend may also be loaded to integrate KOMA-Script's \multiplefootnoteseparator in standard classes.

Automatic Solution

My package fnpct offers a different solution. If loaded together with the endnotes “it just works”:

\documentclass{article}
\usepackage{endnotes}
\usepackage{fnpct}

\begin{document}

Comma delineation of consecutive footnotes fails upon conversion to
endnotes\endnote{First note.}\endnote{Second note.}.  \theendnotes

\end{document}

enter image description here

fnpct also reverses the fullstop and the footnote markers but that can be changed with a package option.

\documentclass{article}
\usepackage{endnotes}
\let\footnote\endnote
\usepackage{fnpct}
\setfnpct{reverse,before-punct-space=0pt}

\begin{document}

Comma delineation of consecutive footnotes fails upon conversion to
endnotes\footnote{First note.}\footnote{Second note.}.

\theendnotes

\end{document}

enter image description here