作者在索引中重复

作者在索引中重复

我想使用backend=bibtex和创建作者索引。但是,当我引用同一作者发表的和时,有些作者会重复。indexing=citebiblatexbooksinproceedings

在以下 MWE 中,尽管作者姓名相同,但两个书目条目的作者都被列出两次:

\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}

其结果是:

示例索引

为了合并索引中的重复名称,我尝试了这个答案但这没有帮助。有人能提供合并两个名字的替代解决方案吗?谢谢。

答案1

biblatex3.13 包含以下修复https://github.com/plk/biblatex/issues/893这相当于\mkbibindexname下面 MWE 中显示的(选项 2)的定义。

更新您的 TeX 发行版以获取当前版本的biblatexBiber。

该文件无需进一步修改。

\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}

产生预期的结果。

下面的答案是为了历史兴趣而保留的。

正如评论中提到的,该.idx文件包含

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

索引最终会出现 JH Velema 的两个条目,一个为Velema, J. H.,一个为Velema, J. H.@Velema, J. H.

不同的条目是由 的biblatex名称索引设置引起的。相关位可以在biblatex.def(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}}}

如果useprefix为真,biblatex将使用\actualoperator(即@)来确保前缀排序正确但以预期的大写显示。但是,@在没有前缀的情况下,也会添加不需要的。

条目velemaKerkStrijd1992具有显式的useprefx=true,而velemaWatChristelijkGereformeerd1947使用默认useprefix=false设置。因此,前者生成Velema, J. H.@Velema, J. H.,后者Velema, J. H.为索引。

至少有两种可能的解决方案。

  1. 全局启用useprefix=true,而不仅限于velemaKerkStrijd1992。然后两个条目都将发送Velema, J. H.@Velema, J. H.到索引。
  2. 重新定义\mkbibndexname以便仅在必要时使用\actualoperator

MWE 演示了选项 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}

请注意我如何将其更改langid = {Nederlands},langid = {dutch},sincelangidbabel语言名称作为值。我还删除了一些字段中多余的括号。

相关内容