[Tex/LaTex] Compressing consecutive footnote marks

footnotes

This question led to a new package:
footnoterange

I have a series of consecutively numbered footnotes that appear as (1,2,…,N). I would like these to be condensed to a hyphenated series consisting of only the first and last member of the series (1–N), analogous to the behavior of the cite and natbib packages for consecutively-numbered bibliographic references. I have loaded the package footmisc to enable proper display of consecutive footnotes, but this package appears to only support comma delineation (and not hyphenation) of footnote lists (cf. footmisc manual).

Edit: I have added three MWEs to make my intentions clear. MWE1 shows the default LaTeX behavior. MWE2 shows the improvements afforded by invocation of \usepackage[multiple]{footmisc}. MWE3 shows the desired outcome.

MWE1 (default):

enter image description here

MWE2 (footmisc):

enter image description here

MWE3 (desired):

enter image description here

The source codes are included here:

MWE1 (default):

\documentclass{article}
\usepackage[hmargin=1in,vmargin=4.75in]{geometry}
\begin{document}
This text bears a multiplicity of footnotes%
\footnote{Lorum}\footnote{ipsum}\footnote{dolor}%
\footnote{sit}\footnote{amet,}\footnote{consectetur}%
\footnote{adipisicing}\footnote{elit}.%
\end{document}

MWE2 (footmisc):

\documentclass{article}
\usepackage[hmargin=1in,vmargin=4.75in]{geometry}
\usepackage[multiple]{footmisc}
\begin{document}
This text bears a multiplicity of footnotes%
\footnote{Lorum}\footnote{ipsum}\footnote{dolor}%
\footnote{sit}\footnote{amet,}\footnote{consectetur}%
\footnote{adipisicing}\footnote{elit}.%
\end{document}

MWE3 (desired):

\documentclass{article}
\usepackage[hmargin=1in,vmargin=4.75in]{geometry}
\begin{document}
This text bears a multiplicity of footnotes$^{1\textrm{--}8}.$%
\footnotetext[1]{Lorum}\footnotetext[2]{ipsum}\footnotetext[3]{dolor}%
\footnotetext[4]{sit}\footnotetext[5]{amet,}\footnotetext[6]{consectetur}%
\footnotetext[7]{adipisicing}\footnotetext[8]{elit}%
\end{document}

Best Answer

If you want to give the references to a range of footnotes, the footnoterange environment of the footnoterange package is the obvious choice:

\documentclass{article}
% load hyperref or footmisc or other packages here
% hyperref-option hyperfootnotes=true or =false as you like
% if you use the cleverref package:
%  it must be loaded after hyperref, never before hyperref
\usepackage{footnoterange}
\begin{document}
This text bears a multiplicity of footnotes%
\begin{footnoterange}%
\footnote{Lorum}\footnote{ipsum}\footnote{dolor}%
\footnote{sit}\footnote{amet,}\footnote{consectetur}%
\footnote{adipisicing}\footnote{elit}%
\end{footnoterange}%
 which are referenced as one footnoterange.
\end{document}

Use the footnoterange* environment, if you use the hyperref package with option hyperfootnotes=true but without wanting hyperlinked footnotes. [As for a truly automatic solution without the need for \begin{footnoterange} and \end{footnoterange}: Sorry! That's too tricky. See also Incompatibility between footmisc-option multiple and hyperref asking for more automatic footnote-handling.]

Related Question