I use the splitidx package to create a special index of named persons.
\usepackage[makeindex,protected]{splitidx}
\newindex[Index of people]{person}
\setindexpreamble[person]{...}
To index people as "Surname, Given", I created two simple macros:
\newcommand{\person}[2]{\sindex[person]{#2, #1}#2}% "Given Surname" in text
\newcommand{\Person}[2]{\sindex[person]{#2, #1}#1 #2}% "Surname" only in text
This works at least for people with given and surname (unlike names such as "Plato"). Now I also want to include authors of cited works in the people index with page numbers where I cited them. The page numbers when I cited their work should be set in a different style to see whether I mentioned the person or one of its works. Any idea how to do this automatically? Simply rewriting the \cite command will not help, because it only gets the citation key as argument. I use the biblatex package for citations, maybe this helps.
Best Answer
With biblatex, you can use
\DeclareIndexNameFormat
for that purpose. As is stated in biblatex.def, the following arguments are passed to indexing directives for name lists:The biblatex option
indexing=true
enables indexing globally. Withindexing=cite
andindexing=bib
you can limit the indexing to the citations or bibliography, respectively.Here is a minimal working example:
Edit:
I forgot the different style of the page numbers referring to names of cited authors. For this, you will first of all need a command to print the pages in the index differently, e.g.
If you are using hyperref, this should be
Now you have to give this information to the
\DeclareIndexNameFormat
command. In a normal index entry, this would be simple:\index{Name|ii}
(or, with splitindex,\sindex[person]{Name|ii}
. But withDeclareIndexNameFormat
this is not possible in a direct way, since biblatex splits up the name given in the bib file and passes it on to the given index command. Thus, the easiest solution is to define a new command which then can be used by\DeclareIndexNameFormat
: