revtex4-1 aps 样式长参考书目中的作者姓名首字母

revtex4-1 aps 样式长参考书目中的作者姓名首字母

我正在使用 revtex4-1 文档类的 aps 选项,并且我希望书目能够打印文章标题。但是,longbibliography 选项还会写出作者的全名,而不是使用首字母。有没有办法使用此文档类在书目中同时获取首字母作者姓名和文章标题?

以下是 MWE:

\begin{filecontents}{testbiblio.bib}
   @ARTICLE{one,
   author = {John Smith},
   title = {Recent advances in physics},
   journal = {Phys. Rev. D}, 
   year = {2015},
   volume = {10},
   pages = {123456},
   number = {5}
   }
\end{filecontents}


\documentclass[aps,prd,twocolumn,longbibliography]{revtex4-1}

\begin{document}

\cite{one}

\bibliography{testbiblio}

\end{document}

这给了我文章标题,但没有给出作者姓名“J. Smith”。有没有办法修改它,使之工作,最好使用 revtex 书目样式,它可以很好地处理超链接和电子版参考资料?

为此,所需的输出将是这样的

  1. J. Smith,《物理学的最新进展》,Phys. Rev. D10,123456 (2015年)。

我还想知道是否有办法在不修改 revtex bst 文件的情况下做到这一点。例如,在 答案在这里,他们说你可以更改 filenameNotes.bib 文件来设置参考书目选项。但似乎每次我在文件上运行 latex 时,它都会重置 filenameNotes.bib 文件中的内容的值。

答案1

使用 revtex4-1 文档类的“aps”选项,以下解决方案允许保持 aps 书目样式的所有其他特性不变。值得注意的是,可以使用 apsrev4-1.bst 的修改版本,但这可能会影响其他行为。在这里,我们将简单地覆盖传递给 apsrev4-1.bst 样式文件的参数。

最初,没有 'longbibliography' 的 RevTex 包的输出将是

原始输出

现在,当你添加“longbibliography”选项时,你会得到这个

输出“longbibliography” 名字首字母和全名严重混杂在一起。

实际上,构建参考书目的参数存储在文档文件夹中名为 [你的文件]Notes.bib 的 .bib 文件的扩展名中。要覆盖其输出,请在序言中,在调用包之后添加,

\AtBeginDocument{%
    \newwrite\bibnotes
    \def\bibnotesext{Notes.bib}
    \immediate\openout\bibnotes=\jobname\bibnotesext
    \immediate\write\bibnotes{@CONTROL{REVTEX41Control}}
    \immediate\write\bibnotes{@CONTROL{%
    apsrev41Control,author="08",editor="1",pages="1",title="0",year="1"}}
     \if@filesw
     \immediate\write\@auxout{\string\citation{apsrev41Control}}%
    \fi
}%

这将替换构建文件时生成的文本。您可以手动设置这些代码行中的所有参数。这里 author="08" 代表“作者姓名首字母”。用于作者的整数值实际上是以 2 的幂之和进行编码的,每个幂对应一个不同的参数。title="0" 允许生成文章标题。您的输出现在如下所示

输出覆盖的 Notes.bib

请注意,“longbibliography”选项的使用现在无效,但由手动值取代。

除了首字母之外,这里是 apsrev4-1.bst 中的所有作者参数列表

  'control.author.jnrlst   swap$ duplicate$ #64 control.decode
  'control.author.dotless  swap$ duplicate$ #32 control.decode
  'control.author.nospace  swap$ duplicate$ #16 control.decode
  'control.author.initials swap$ duplicate$  #8 control.decode
  'control.author.nocomma  swap$ duplicate$  #4 control.decode
  'control.author.first    swap$ duplicate$  #2 control.decode
  'control.author.reversed swap$ duplicate$  #1 control.decode

例如,使用 16+8+1=25 来反转顺序,不带空格和首字母缩写。您需要设置 editor="0" 以完全控制作者格式。输入的 author="HH" 参数实际上是一个十六进制值。这意味着对于前面的示例,您必须设置 author="19"

答案2

简单的解决方法是修改 bib 文件中的标题字段。将“Recent advances in physics”更改为“J. Smith, Recent advances in physics”,依此类推。

如果您想要修复一般情况,则需要修改 的revtex4.bst 文件以更改输出格式。在我的系统(带有 Tex Live 的 Debian Linux)上,文件的位置是 /usr/local/texlive/2014/texmf-dist/bibtex/bst/revtex4/apsrev.bst。原始 format.title 函数是:

FUNCTION {format.title}
{ title
  duplicate$ empty$ 'skip$ { "t" change.case$ } if$
  duplicate$ "title" bibinfo.check swap$
  duplicate$ empty$ 'pop$
    {
      punctuation.yes 'punctuation.state :=
      string.enquote
      select.language
    }
  if$
}

修改为:

FUNCTION {format.title}
{ author #1 "{f. }{ll}" format.name$ ", " * title *
  %duplicate$ empty$ 'skip$ { "t" change.case$ } if$
  duplicate$ "title" bibinfo.check swap$
  duplicate$ empty$ 'pop$
    {
      punctuation.yes 'punctuation.state :=
      string.enquote
      select.language
    }
  if$
}

您可以使用 format.string$ 的格式字符串来处理所有作者姓名。有关编辑 .bst 文件的参考资料,请参阅驯服野兽。我相信还有一种比破坏第二行更优雅的方式来处理姓氏的大写,但现在这应该足够了。

编辑:这里有一个适用于您更新的格式的相关方法:BibTeX natbib 中仅使用命名样式的作者姓名首字母

答案3

添加

\bibliographystyle{abbrv}

\bibliography{testbiblio}

完整代码。我做了一点修改。:)

\begin{filecontents}{testbiblio.bib}
   @ARTICLE{one,
   author = {John Smith},
   title = {Recent advances in physics},
   journal = {Phys. Rev. D}, 
   year = {2015},
   volume = {10},
   pages = {123456},
   number = {5}
   }
\end{filecontents}


\documentclass[aps,prd,twocolumn,longbibliography]{revtex4-1}

\begin{document}
vxdvsdsdf\cite{one}
sdfsdf
sdfs
df
sdf

\bibliographystyle{abbrv}

\bibliography{testbiblio}

\end{document}

结果

在此处输入图片描述

答案4

我想到了其他解决方案。可以直接修改\@bibdataout@aps。只需在文档序言中添加以下代码(假设longbibliography您的文档类中有选项):

\makeatletter
\def\@bibdataout@aps{%
\immediate\write\@bibdataout{%
@CONTROL{%
apsrev41Control%
\longbibliography@sw{%
    ,author="08",editor="1",pages="1",title="0",year="1"%
    }{%
    ,author="08",editor="1",pages="1",title="",year="1"%
    }%
  }%
}%
\if@filesw \immediate \write \@auxout {\string \citation {apsrev41Control}}\fi 
}
\makeatother

相关内容