3

I want to create an author index with backend=bibtex and indexing=cite using biblatex. However, some authors get duplicated when I have cited both books and inproceedings published by the same author.

In the following MWE, the author of both bibliographical entries gets listed twice although the author's name is identical:

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{velemaWatChristelijkGereformeerd1947,
  langid = {Nederlands},
  location = {{Amsterdam}},
  title = {Wat is Christelijk Gereformeerd?},
  pagetotal = {151},
  publisher = {{Ds. H. Janssen-fonds}},
  date = {1947},
  author = {Velema, J.H.}}

@incollection{velemaKerkStrijd1992,
  location = {{Kampen}},
  title = {{{Kerk en strijd}}},
  booktitle = {{{Een eeuw christelijk-gereformeerd: aspecten van 100 jaar Christelijke Gereformeerde Kerken}}},
  publisher = {{Kok}},
  date = {1992},
  pages = {221-240},
  author = {Velema, J.H.},
  editor = {van 't Spijker, W. and Noorlandt, J.N. and van der Schaaf, H.},
  options = {useprefix=true}}
\end{filecontents*}

\usepackage[style=authoryear,indexing=cite,backend=bibtex]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{makeidx}
\makeindex

\begin{document}
\cite{velemaWatChristelijkGereformeerd1947,velemaKerkStrijd1992}

\printbibliography
\printindex
\end{document}

Which results in:

example index

To merge the duplicated names in the index, I tried the solution provided in this answer but that did not help. Could anyone provide an alternative solution to merge both names? Thank you.

2
  • 1
    It would be helpful to see how these are shown in the .idx and .ind files. I suspect that there's an extra space in one of them, or the spacing is different. Of course, the problem then is to figure out why. Commented May 25, 2019 at 20:49
  • In the .idxfile, the authors are indeed different: \indexentry{Velema, J.H.}{1} and \indexentry{Velema, J.H.@Velema, J.H.}{1}. In the .ind file they end up identically: \item Velema, J.H., 1` and \item Velema, J.H., 1. Of course, I can edit the .idx file manually to fix the problem, but it would be more convenient if it could be solved automatically.
    – absmn
    Commented May 26, 2019 at 6:03

1 Answer 1

2

biblatex 3.13 contains a fix for https://github.com/plk/biblatex/issues/893 that is equivalent to the definition of \mkbibindexname (option 2) shown in the MWE below.

Update your TeX distribution to obtain the current versions of biblatex and Biber.

Further changes to the document should not be necessary.

\documentclass{article}

\usepackage[style=authoryear, indexing=cite, backend=bibtex]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{velemaWatChristelijkGereformeerd1947,
  langid    = {dutch},
  location  = {Amsterdam},
  title     = {Wat is Christelijk Gereformeerd?},
  pagetotal = {151},
  publisher = {Ds.~H.~Janssen-fonds},
  date      = {1947},
  author    = {Velema, J. H.},
}
@incollection{velemaKerkStrijd1992,
  location  = {Kampen},
  title     = {Kerk en strijd},
  booktitle = {Een eeuw christelijk-gereformeerd: aspecten van 100 jaar Christelijke Gereformeerde Kerken},
  publisher = {Kok},
  date      = {1992},
  pages     = {221-240},
  author    = {Velema, J. H.},
  editor    = {van 't Spijker, W. and Noorlandt, J. N. and van der Schaaf, H.},
  options   = {useprefix=true},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\usepackage{makeidx}
\makeindex

\begin{document}
\cite{velemaWatChristelijkGereformeerd1947,velemaKerkStrijd1992}

\printbibliography
\printindex
\end{document}

produces the expected result.

The answer below is kept for historical interest.

As mentioned in the comments, the .idx file contains

\indexentry{Velema, J. H.}{1}
\indexentry{Velema, J. H.@Velema, J. H.}{1}

The index then ends up with two entries for J. H. Velema, one for Velema, J. H. and one for Velema, J. H.@Velema, J. H..

The different entries are caused by biblatex's name indexing settings. The relevant bits can be found in biblatex.def (ll. 1166-1187)

\newcommand*{\mkbibindexname}[4]{%
  \ifuseprefix
    {\ifdefvoid{#3}{}{#3 }%
     \@firstofone #1% remove spurious braces
     \ifdefvoid{#4}{}{ #4}%
     \ifdefvoid{#2}{}{, #2}%
     \actualoperator
     \ifdefvoid{#3}{}{\MakeCapital{#3} }%
     #1%
     \ifdefvoid{#4}{}{ #4}%
     \ifdefvoid{#2}{}{, #2}}
    {\@firstofone #1% remove spurious braces
     \ifdefvoid{#4}{}{ #4}%
     \ifboolexpe{%
       test {\ifdefvoid{#2}}
       and
       test {\ifdefvoid{#3}}}
       {}
       {,}%
     \ifdefvoid{#2}{}{ #2}%
     \ifdefvoid{#3}{}{ #3}}}

If useprefix is true, biblatex will use \actualoperator (i.e. @) to make sure that the prefix is sorted correctly but shown in the expected capitalisation. But the @ is also added in cases where it is not needed since there is no prefix.

The entry velemaKerkStrijd1992 has an explicit useprefx=true, while velemaWatChristelijkGereformeerd1947 uses the default useprefix=false setting. Hence, the former produces Velema, J. H.@Velema, J. H. and the latter Velema, J. H. for the index.

There are at least two possible solutions.

  1. Enable useprefix=true globally and not only for velemaKerkStrijd1992. Then both entries will send Velema, J. H.@Velema, J. H. to the index.
  2. Redefine \mkbibndexname to only use \actualoperator when necessary.

The MWE demonstrates option 2.

\documentclass{article}

\usepackage[style=authoryear, indexing=cite, backend=bibtex]{biblatex}

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

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{velemaWatChristelijkGereformeerd1947,
  langid    = {dutch},
  location  = {Amsterdam},
  title     = {Wat is Christelijk Gereformeerd?},
  pagetotal = {151},
  publisher = {Ds.~H.~Janssen-fonds},
  date      = {1947},
  author    = {Velema, J. H.},
}
@incollection{velemaKerkStrijd1992,
  location  = {Kampen},
  title     = {Kerk en strijd},
  booktitle = {Een eeuw christelijk-gereformeerd: aspecten van 100 jaar Christelijke Gereformeerde Kerken},
  publisher = {Kok},
  date      = {1992},
  pages     = {221-240},
  author    = {Velema, J. H.},
  editor    = {van 't Spijker, W. and Noorlandt, J. N. and van der Schaaf, H.},
  options   = {useprefix=true},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\usepackage{makeidx}
\makeindex

\begin{document}
\cite{velemaWatChristelijkGereformeerd1947,velemaKerkStrijd1992}

\printbibliography
\printindex
\end{document}

Note how I changed langid = {Nederlands}, to langid = {dutch}, since langid takes babel language names as values. I also removed excess braces in some fields.

2
  • 1
    See github.com/plk/biblatex/issues/893
    – moewe
    Commented May 26, 2019 at 10:19
  • Dear moewe, thank you very much! I can confirm that both solutions are working. Thank you also for fixing this by adding a commit on github. My question is solved.
    – absmn
    Commented May 26, 2019 at 15:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .