4

I am looking for a way to change the way in which author (or editor) names are sorted in Biblatex-generated indexes.

In French, we use accented letters such as é or è, which should be sorted with the main letter, in this case e. Whenever a name contains such an accented letter, it gets sorted out of order, so we need to index entries using: no accents@with accents. I understand how to get Biblatex to use an @ in the index, but not how to feed it the proper string.

How can I make sure that Biblatex either:

  • converts such special characters to their equivalent basic latin letter before printing the name into the index (with Biber or any string manipulation package)
  • uses a special name field such as indexauthor, which would contain a list of names using only basic latin characters
  • tweak the index so that it properly sorts all special characters without having to use @ (my base class is using memoir, so makeidx is the preferred engine)
  • or anything else that works

The solution from this answer works partially, as shown in the following example:

\documentclass{article}

\usepackage[french]{babel}
\usepackage[indexing=true]{biblatex}
\usepackage{makeidx}
\makeindex

\begin{filecontents}{\jobname.bib}
@article{testcite,
  author = {Éliot, William and Doé, John},
  title = {Test Title},
  year = {2018},
  usera = {Eliot, William and Doe, John}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\renewbibmacro*{citeindex}{%
    {\indexnames{labelname}}{}}

\renewbibmacro*{index:name}[5]{%
  \usebibmacro{index:entry}{#1}
    {\iffieldundef{usera}{}{\thefield{usera}\actualoperator}\mkbibindexname{#2}{#3}{#4}{#5}}}

\makeindex

\begin{document}

\printindex

\cite{testcite}

\end{document}

The first name gets indexed properly, as an E letter, but the second name also gets indexed as such, because we are using a literal field instead of a name field for the indexauthor name (in this case, usera).

Would it be possible to use a name field instead and make sure both names get indexed properly? I realise that this may be impossible due to the way in which fields work.

In that event, how could I convert the special characters on the fly? Or tweak the indexing process itself so that it sorts accented letters properly?

4

You need an index tool that can handle UTF8 correctly, then there is no need at all to manipulate the sorting manually. This is not really a biblatex problem, its an issue of the indexing tool.

You can use xindy together with imakeidx

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[indexing=true,style=authoryear]{biblatex}
\usepackage[xindy, noautomatic]{imakeidx}
\def\xindylangopt{-M texindy -L french -C utf8}
\makeindex[options=\xindylangopt]

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{testcite,
  author = {Éliot, William and Doé, John},
  title = {Test Title},
  year = {2018},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\printindex

\index{hallo}
\cite{testcite}
\printbibliography
\end{document}

compiled with

pdflatex document
biber document
pdflatex document
texindy -M texindy -L french -C utf8 document.idx
pdflatex document
pdflatex document

gives

enter image description here

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.