1

assume that I use biblatex and indexing=cite to get the authors of cited titles in the index. But authors with first-letter special characters (e. g. {\c{C}}abej, Nelson R.) don't get automatically sorted under "C". If I would index the person manually, I could handle it with "{\c{C}}abej\index{Cabey@{\c{C}}abej, Nelson R.}" but how can I get the same result with indexing=cite? The same question with prefixes, how can I get "van den Berg, Horst" get sorted in the index under "B".

So here is a MWE - would be cool if somebody could come up with a solution, couldn't find one in the internet.

    \documentclass[12pt,a4paper]{scrreport}
    \usepackage[utf8]{inputenc}
    \usepackage{amsfonts}
    \usepackage[T1]{fontenc}
    \usepackage[english]{babel}
    \usepackage[natbib=true,backend=biber,style=authoryear,indexing=cite]{biblatex}
    \usepackage{hyperref}
    \usepackage{csquotes}
    
    \usepackage{imakeidx}
    \usepackage{etoolbox}
    \makeindex[columns=2,title=Titelregister]
    \makeindex[columns=2,name=personenregister,title=Index of Persons]
    \makeindex[columns=2,name=sachregister,title=Index of Subjects]
    \DeclareIndexNameFormat{default}{%
    \usebibmacro{index:name}{\index[personenregister]}
    {\namepartfamily}
    {\namepartgiven}
    {\namepartprefix}
    {\namepartsuffix}}
    
    \begin{filecontents}{\jobname.bib}
    @book{Cabej.2012,
        author = {{\c{C}}abej, Nelson R.},
        year = {2012},
        title = {Epigenetic Principles of Evolution},
        address = {Amsterdam},
        publisher = {Elsevier},
    }
  @book{Berg.2012,
        author = {van den Berg, Horst},
        year = {2012},
        title = {Epigenetic Principles of Evolution 2},
        address = {Amsterdam},
        publisher = {Elsevier},
    }
    \end{filecontents}
    
    \addbibresource{\jobname.bib}
    \addbibresource{biblatex-examples.bib}
    
    \begin{document}
    
    \autocite{Cabej.2012}
    \autocite{bertram}
    \autocite{doody}
    \autocite{coleridge}
    \autocite{Berg.2012}
    
    
    \printindex[personenregister]
    
    \end{document} 

appendix

assume further I also use arara with makeglossaries...

% arara: pdflatex
% arara: makeglossaries
% arara: texindy
% arara: biber
% arara: pdflatex
% arara: pdflatex

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[natbib=true,backend=biber,style=authoryear,indexing=cite]{biblatex}
\usepackage[xindy]{imakeidx}
\usepackage{hyperref}

\usepackage[]{glossaries}

\makeglossaries

\newglossaryentry{randomglossaryentry}
{
    name={Random Glossary Entry},
    text={Random Glossary Entry},
    description={xxx},
}

\makeindex[columns=2,title=Titelregister]
\makeindex[columns=2,name=personenregister,title=Index of Persons, options={-C utf8}]
\makeindex[columns=2,name=sachregister,title=Index of Subjects]
\DeclareIndexNameFormat{default}{%
    \usebibmacro{index:name}{\index[personenregister]}
    {\namepartfamily}
    {\namepartgiven}
    {\namepartprefix}
    {\namepartsuffix}}

\makeatletter
\renewcommand*{\mkbibindexname}[4]{%
    \@firstofone #1% remove spurious braces
    \ifdefvoid{#4}{}{ #4}%
    \ifdefvoid{#2}{}{, #2}%
    \ifdefvoid{#3}{}{
        #3%
        \actualoperator
        #3 %
        #1%
        \ifdefvoid{#4}{}{ #4}%
        \ifdefvoid{#2}{}{, #2}}}
\makeatother

\begin{filecontents}{\jobname.bib}
    @book{Cabej.2012,
        author    = {{\c{C}}abej, Nelson R.},
        year      = {2012},
        title     = {Epigenetic Principles of Evolution},
        address   = {Amsterdam},
        publisher = {Elsevier},
    }
    @book{Berg.2012,
        author    = {van den Berg, Horst},
        year      = {2012},
        title     = {Epigenetic Principles of Evolution 2},
        address   = {Amsterdam},
        publisher = {Elsevier},
    }
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
    \autocite{Cabej.2012}
    \autocite{bertram}
    \autocite{doody}
    \autocite{coleridge}
    \autocite{Berg.2012}
    
    \gls{randomglossaryentry}

van den Berg\index[personenregister]{van den Berg, Horst}
        
    \printglossary
    \printbibliography
    
    \printindex[personenregister]
\end{document}
1

For Çabej I suggest you use an indexing tool that can deal with non-ASCII characters: xindy.

Load imakeidx with the xindy option and call xindy (via texindy) with the option -C utf8

texindy -C utf8 personenregister.idx

For van den Berg you can redefine \mkbibindexname to issue

Berg, Horst van den@van den Berg, Horst

Together you get

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{csquotes}
\usepackage[natbib=true,backend=biber,style=authoryear,indexing=cite]{biblatex}
\usepackage[xindy]{imakeidx}
\usepackage{hyperref}

\makeindex[columns=2,title=Titelregister]
\makeindex[columns=2,name=personenregister,title=Index of Persons, options={-C utf8}]
\makeindex[columns=2,name=sachregister,title=Index of Subjects]
\DeclareIndexNameFormat{default}{%
  \usebibmacro{index:name}{\index[personenregister]}
    {\namepartfamily}
    {\namepartgiven}
    {\namepartprefix}
    {\namepartsuffix}}

\makeatletter
\renewcommand*{\mkbibindexname}[4]{%
  \@firstofone #1% remove spurious braces
  \ifdefvoid{#4}{}{ #4}%
  \ifdefvoid{#2}{}{, #2}%
  \ifdefvoid{#3}{}{
    #3%
    \actualoperator
    #3 %
    #1%
    \ifdefvoid{#4}{}{ #4}%
    \ifdefvoid{#2}{}{, #2}}}
\makeatother

\begin{filecontents}{\jobname.bib}
@book{Cabej.2012,
  author    = {{\c{C}}abej, Nelson R.},
  year      = {2012},
  title     = {Epigenetic Principles of Evolution},
  address   = {Amsterdam},
  publisher = {Elsevier},
}
@book{Berg.2012,
  author    = {van den Berg, Horst},
  year      = {2012},
  title     = {Epigenetic Principles of Evolution 2},
  address   = {Amsterdam},
  publisher = {Elsevier},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
\autocite{Cabej.2012}
\autocite{bertram}
\autocite{doody}
\autocite{coleridge}
\autocite{Berg.2012}


\printindex[personenregister]
\end{document}

"van den Berg" under B; "Çabej" under C


I know next to nothing about arara (except that it has a beautiful documentation, an extremely pretty logo and a very enthusiastic development team), but the following directives seemed to work in your updated MWE

% arara: pdflatex
% arara: biber
% arara: pdflatex
% arara: makeglossaries
% arara: texindy: { files: [personenregister, sachregister], codepage: utf8 }
% arara: pdflatex
% arara: pdflatex

In particular we need to run texindy after the Biber and following LaTeX run because citations can only be indexed after they appear in the document.

We also needed to give the file names for the texindy call directly, since they are hard-coded in the document and cannot be inferred from the file name of the main .tex file.

If you trust the code in your document (and all packages you load) so much that you would allow it to execute arbitrary commands on your machine, you can cut down on some of the calls by having imakeidx call texindy for you via shell escape (which we need to enable for the relevant pdflatex run)

% arara: pdflatex
% arara: biber
% arara: pdflatex: { shell: yes }
% arara: makeglossaries
% arara: pdflatex
% arara: pdflatex

But in general shell escape is a security risk (What does --shell-escape do?, What are \immediate & \write18 and how does one use them?).

2
  • Thank you very much, it works very well with standard compilaton. Unfortunately I could not reproduce it with arara while using makeglossaries as well... I added an appendix to the original question. Do you know what the problem might be? – Horstfuchs Feb 24 at 0:18
  • Thank you for the arara-advice, now it works!! – Horstfuchs Feb 24 at 11:25

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.