为什么用于突出显示作者姓名的 BST 黑客程序不起作用?

为什么用于突出显示作者姓名的 BST 黑客程序不起作用?

下列的(这是),我创建了这个 MWE。

演示文本

\documentclass{article}

\begin{document}

\nocite{*}
\bibliographystyle{IEEEtran2}
\bibliography{pub}

\end{document}

公共图书馆

@article{janssen1996evaluation,
    title={Evaluation of the DNA fingerprinting method AFLP as a new tool in bacterial taxonomy},
    author={Janssen, Paul and Coopman, Renata and Huys, Geert and Swings, Jean and Bleeker, Marjo and Vos, Pieter and Zabeau, Marc and Kersters, Karel},
    journal={Microbiology},
    volume={142},
    number={7},
    pages={1881--1893},
    year={1996},
    publisher={Soc General Microbiol}
}

@article{vos1995aflp,
    title={AFLP: a new technique for DNA fingerprinting},
    author={Vos, Pieter and Hogers, Rene and Bleeker, Marjo and Reijans, Martin and Van de Lee, Theo and Hornes, Miranda and Friters, Adrie and Pot, Jerina and Paleman, Johan and Kuiper, Martin and others},
    journal={Nucleic acids research},
    volume={23},
    number={21},
    pages={4407--4414},
    year={1995},
    publisher={Oxford Univ Press}
}

IEEEtran2.bst 中的相关变化(原始 IEEEtran.bst 的克隆)

FUNCTION {highlight.if.cv.author}
{ duplicate$ purify$ "Janssen, Paul" purify$ =
    { bold }
    'skip$
  if$
}

FUNCTION {format.names}
{ 'bibinfo :=
  duplicate$ empty$ 'skip$ {
  this.to.prev.status
  this.status.std
  's :=
  "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      name.format.string
      format.name$
      highlight.if.cv.author
      bibinfo bibinfo.check
      't :=
.
.
.

Paul Janssen生成的参考书目中仍然没有突出显示名称。我遗漏了什么?

在此处输入图片描述

答案1

突出显示函数正在比较实际字符串,因此需要使用“P. Janssen”作为比较的文字。此外,中没有bold定义函数IEEEtrans.bst。因此您的突出显示函数需要为:

FUNCTION {highlight.if.cv.author}
{ duplicate$ purify$ "P. Janssen" purify$ =
    { "\textbf{" swap$ * "}" * }
    'skip$
  if$
}

代码输出

相关内容