将影响因子信息添加到 apalike.bst 中

将影响因子信息添加到 apalike.bst 中

我正在尝试将影响因子信息添加到 apalike.bst 中。到目前为止,我将 apalike.bst 进行了如下更改

首先,我添加了impact_factor部分ENTRY并创建了一个新功能

FUNCTION {format.impactFactor}
{ 
impact_factor empty$
    { "" }
    {"( Impact Factor:" impact_factor ")"}
  if$
}

article然后从函数中调用此函数

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  author format.key output              
  output.year.check                 
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      format.vol.num.pages output
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  format.impactFactor output              % <---- the new filed
  new.block  
  note output
  fin.entry  
}

当我尝试使用 bibtex 和有效的 bib 文件进行编译时,出现以下错误消息

This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit)
The top-level auxiliary file: apubs.aux
The style file: apalike_custom.bst
Database file #1: JanS.bib
ptr=2, stack=
( Impact Factor:
45(1):205--212
---the literal stack isn't empty for entry ferkl2010ceiling
while executing---line 1104 of file apalike_custom.bst
(There was 1 error message)

答案1

您希望函数输出字符串,因此您必须将它们连接起来:

FUNCTION {format.impactFactor}
{ 
impact_factor empty$
    { "" }
    {"( Impact Factor:" impact_factor * ")" *}
  if$
}

相关内容