# imakeidx - A special feature for footnotes

The question is similar to those about indexing footnotes. The answers I could read provide commands that produce an output like the following when the word to be indexed occurs on the same page both in text and in footnotes (see MWE):

Index entry, 1n1, 1n2, 1,...


What I would like is that the indexing command took into account the previous occurence of the word to produce something like this:

Index entry, 1 and n, 25, 42n, 51 and n,...


where there is no reference to the footnote number (so no need to hyperref to the note) and the and should of course be language sensitive (e.g. an e for Italian users).

Bonus (convoluted). It could be nice to make it so that footnotes numbers may be indexed if wanted, but I can see many possible issues following such a request (n should turn to nn or notes if more than a footnote is indexed, and how about separating the numbers without getting messy?). You can definitely ignore this one!

MWE:

\documentclass[11pt, twoside, openany]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\makeindex[title=Indice dei nomi,columns=2,intoc=true]
\usepackage[italian]{babel}
\usepackage{hyperref}
\def\fn#1#2{%
\hyperpage{#2}~n%~#1%
}%

\newcommand{\is}[1]{%
\if@noftnote%
\index{#1}%
\else%
\index{#1|fn{\number\value{footnote}}}%
\fi%
}
\begin{document}
A statement about Some One\index{One, Some}.\footnote{For a different on S. One\is{One, Some}
see\dots} Some text backed by a footnote.\footnote{As Another Scholar\is{Scholar, Another} once said}
\printindex
\end{document}


The code for the \is indexer is taken from https://tex.stackexchange.com/a/282609/212292