Compressing consecutive footnote marks

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.]


I suggest you look into the cleveref package and its commands \crefrange and \cref. The former commands takes two arguments, the first and last label of a range of items to be cross-referenced; with the second command, you just specify all labels that are to be cross-referenced, and the package will sort and, if possible, compress the list automatically. The arguments of the \cref command needn't even be in any order.

The following MWE illustrates how this may be done.

\documentclass{article}
\usepackage[para]{footmisc} % since you mention that you use this package
\usepackage{cleveref}
  \newcommand\crefrangeconjunction{--}      % default: " to "
  \newcommand{\creflastconjunction}{, and } % default: " and ", i.e., without the comma
\begin{document}
\section{Hey, let's create some footnotes}
Once\footnote{A \label{fn:A}} upon\footnote{B \label{fn:B}} a\footnote{C \label{fn:C}} time,\footnote{D \label{fn:D}} there\footnote{E \label{fn:E}} was\footnote{F \label{fn:F}} \ldots

\section{Now let's cross-reference these footnotes}   
As is demonstrated in \crefrange{fn:A}{fn:F}, \ldots

\noindent
As additionally noted in \cref{fn:F,fn:A,fn:D,fn:E,fn:B}, \ldots
\end{document}

enter image description here enter image description here

Of course, the cleveref package's cross-referencing commands work not only with footnotes, but with just about all items that can be given a label -- equations, sections, figures, tables, algorithms, and so on.

Finally, be sure to have the latest version of the cleveref package on your system, as the package has recently been updated and upgraded significantly by its author. For instance, the \creflastconjunction macro that's used in the MWE probably won't work unless you have a recent version of the package.

Tags:

Footnotes