I'm currently weighing indexing options for a book-length project. One of the more surprising hurdles is that there doesn't seem to be a way to create an index (in my case, several indices) that disambiguates references in the text from those that appear in the footnotes. For example, there will be several hundred references to Roman and canon law, but usually these will be in the footnotes, where there will be, on average, several footnotes per page. Thus a generic reference to page 100 in the citation index is not nearly as helpful as a reference to '100n34' (which is standard practice for publishers who still bother to include things like an 'index locorum').

For sorting reasons, it seems like xindy will be the best option, but a solution that can deal with footnote references will trump that since it will be easier to manually sort the .idx file than to manually identify every citation in a footnote versus one in the text. (Note also that the footnotes invariably contain other arbitrary elements, such as text and citations to modern studies, so a 'special' footnote command will probably not work.)

Finally, in case this complicates things any further, this project is tied to the memoir class (page layout) and lualatex (fonts).

| improve this question | | | | |
  • 3
    Will you be using Biblatex? I know that sounds like a mad question. But it's good at detecting when something is happening in a footnote, and one might leverage that to patch the index command. – Paul Stanley May 11 '12 at 20:48
  • @PaulStanley -- yes I do. It is the only sane choice if you work in the humanities. In fact, I wondered --- briefly --- about the very same thing after I posted the question. I suppose I should look at what it does this weekend, but I suspect this will be beyond my expertise to fix. – jon May 11 '12 at 21:04
  • Just as a follow-up: the default behaviour of biblatex (with option indexing=cite) does not indicate whether the citation is in a footnote or not. – jon May 11 '12 at 21:11
  • I think you will find that whatever index package you use will at some time write \thepage to its idx file. If one could test whether one was in a footnote at that point, which Biblatex makes simple with \iffootnote one could add a reference to the footnote number at that point. – Paul Stanley May 11 '12 at 21:14
  • The point is that \iffootnote is just a macro like any other. It uses the fact that Biblatex patches the way footnotes are constructed to set a flag which can then be tested, but I think you could use it for any purpose. Indeed you should be able to play with biblatex's indexing macros to make it an automatic part of a citation. – Paul Stanley May 11 '12 at 21:21

Here is my attempt at doing it. I haven't tested extensively, but it seems to work (with two books, two inline citations, and two footnote citations with dummy footnotes in-between).

The idea, following what Paul Stanley said in his comments, is to use BibLaTeX to index things properly. In order to do so, we need to redefine \DeclareIndexFieldFormat (which is used for indexing titles, but it has several variants for names, etc.), and to create a macro that will format the page number by appending the footnote number to it.

I am also renewing two macros because biblatex does some formatting before indexing titles, and we need to preserve it while incorporating the added |note command.









  author = {Author, A.},
  year = {2000},
  title = {My first title},
  author = {Buthor, B.},
  year = {2002},
  title = {My second title},



Some inline citation \cite{author:2000}. Some footnote\footnote{A, b and c}. Some footnote citation \footcite{buthor:2002}.


Some footnote\footnote{A, b and c}. Some footnote citation \footcite{author:2000}. Some inline citation \cite{buthor:2002}.



Edit: Looking at your first question, I think perhaps you could create an entry using the following code:

    title = {Digestum},
    indextitle = {Digestum!\emph{Dig.}},
    indexsorttitle = {02},
    title = {Institutiones},
    indextitle = {Institutiones!\emph{Inst.}},
    indexsorttitle = {01},

Don't forget to replace the \emph{#2} by #2 in \renewbibmacro{index:title} at l. 14, otherwise it won't work.

Now, if you want two indexes with one of them being sorted arbitrarily and the other alphabetically, you need to specify things accordingly, by saying where to index which data (see the memoir documentation). If you further want the "Institutiones" and "Digestum" to look like letter headings, I suggest you look for a way to solve your first question with xindy (or wait until someone find it). Sorry I can't help there.

| improve this answer | | | | |
  • This is a great start! I actually started on a similar tact as with your \note command, just not tied to biblatex. One problem with what I need for the legal citations is that I cannot bind my indexing to the index:title macro because two different (multi-volume) works each contain a complicated assortment of legal collections --- see here for an earlier question, which only scratches the surface of the different types of citations (and which is somehow not linked to this account). – jon May 11 '12 at 23:38
  • That said: I will certainly use this for regular citations! – jon May 11 '12 at 23:39
  • I used index:title because I thought it would be easier than the author's name for indexing legal citations, but you could use something else. Do you think another field would be more appropriate? As I said, \DeclareIndexFieldFormat has different variants. I'll edit my answer with what could be a solution to your first question. – ienissei May 12 '12 at 9:24
  • @jon And I'd be very interested in the xindy solution for creating custom alphabetical orders, too, though I can't help much there at the moment. Also if you are interested, perhaps you could contact Paul Stanley, we are trying to gather people who are working on styles for legal citations with biblatex. I would regard some roman law knowledge as a great addition to the endeavour. See here for details. – ienissei May 12 '12 at 10:39
  • For most cases, I think the index:title field is appropriate, but not necessarily for Roman or canon law. The standard edition for Roman law (3 vols.) contains the Institutes, Digest, Code, and Novels (cited by I./Inst., D./Dig., C./Cod., and N./Nov.), while canon law (in two vols.) contains the Decretum (cited differently depending on which part), Decretals (X.), Sext (VI.), Clementines, (Clem.), Extravagantes Iohannis XXII (usually Ex. Io. XXII), and Extravagantes communes (Ex. comm.). It is easier, and better, to create citation commands not tied to biblatex to cite them. – jon May 12 '12 at 18:52

So far it seems as though the easiest solution is to create two commands, one for in-text citations (which are rare in my case), and one for the citation occurs in a footnote. Here is a simplified example using makeindex (which will end up sorting things incorrectly in a fuller example, but that's a different problem...). Note that I exaggerated the \digtext and \insttext commands for clarity (including how they are indexed); I suppose you could do the same with 'starred' commands, but I prefer expressing the point of the command in its name where possible.



\newcommand{\inst}[1]{Inst.\,#1\index{Inst. #1@I. #1|nn{\thefootnote}}}
\newcommand{\insttext}[1]{Inst.\,#1\index{Inst. #1@I. #1}}

\newcommand{\digtext}[1]{Dig.\,#1\index{Dig. #1@D. #1}}
\newcommand{\dig}[1]{Dig.\,#1\index{Dig. #1@D. #1|nn{\thefootnote}}}


Some text.%
\footnote{A footnote with no citations.} %

\insttext{1.2 pr}


A more automatic, not to mention elegant, solution would be better, but changing a several dozen in-text citations might be the easiest solution.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.