I have an index of cited authors generated with biblatex and imakeidx. How can I have this index sorted by the sortkey field in the bib-file, if defined.
For indexing titles there is a indexsorttitle field (biblatex manual p. 26), but there is no parallel for authors.
My idea was to use the sortstring@printed name syntax in the \index commend via the bibmacro, but I dont know how to make this work. Something like \iffieldundef{sortkey}{}{\thefield{sortkey}@} inserted in the macro, perhaps?
In the example below, al-Xalil should be sorted after Brutus in the index.
\documentclass{book}
\usepackage{imakeidx}
\usepackage{filecontents}
\usepackage[indexing=cite]{biblatex}
\makeindex[title=Index of Authors, name=author]
\renewbibmacro*{citeindex}{%
{\indexnames{labelname}}{}}
\DeclareIndexNameFormat{default}{%
\usebibmacro{index:name}{\index[author]}
{#1}{#3}{#5}{#7}}
\begin{filecontents}{general.bib}
@misc{A01,
author = {Arabicname al-Xalil},
year = {2001},
sortkey = {xalil},
title = {Alpha}
}
@misc{B02,
author = {Alex Brutus},
year = {2002},
title = {Bravo}
}
\end{filecontents}
\addbibresource{general.bib}
\begin{document}
\cite{A01}
\cite{B02}
\printindex[author]
\end{document}

usera). Would you know how to write theindex:namemacro so that it prints the name field into the index, e.g. with "last name, given name" (instead of\thefield{usera})? Thanks – ienissei Jan 06 '18 at 23:11userahere is only for sorting. It is not printed. The printing is done by\mkbibindexnameand that is indeed applied to a name field (as you can see in the output). I'm not quite sure what you need. Can you give more details? (If necessary in a new question?) – moewe Jan 07 '18 at 07:35