更改书目样式 AEA,将作者后面的年份放在括号中

更改书目样式 AEA,将作者后面的年份放在括号中

我已经对原始 AEA 书目样式代码做了一些更改。现在我想在作者后面用括号标出出版年份。我应该更改什么?这是我的 Latex 文件:

\documentclass{article}
\usepackage{natbib}

\begin{document}

\section{Test}

Here is an example to cite \citet{abeler2010gift} in text.

\pagebreak
\addcontentsline{toc}{section}{References}
\bibliographystyle{aea}
\bibliography{paper}
\nocite{*}


\end{document}

参考文献由 Jabref 生成并保存在单独的参考书目文件(纸质文件)中,格式如下:

@Article{abeler2010gift,
  author    = {Abeler, Johannes and Altmann, Steffen and Kube, Sebastian and Wibral, Matthias},
  title     = {Gift exchange and workers' fairness concerns: When equality is unfair},
  year      = {2010},
  volume    = {8},
  number    = {6},
  pages     = {1299--1324},
  journal   = {Journal of the European Economic Association},
  publisher = {Wiley Online Library},
}

参考书目样式是美国经济评论样式 (AEA) 的修改版本。我在此处上传了文件: https://www.file-upload.net/download-12626400/aea.bst.html

答案1

您可以通过修改文件来实现所需的效果.bst,但文件中的“注释”指出了一点小警告aea.bst

Copying of this file is authorized only if either
     (1) you make absolutely no changes to your copy, including name, or
     (2) if you do make changes, you name it something other than
     btxbst.doc, plain.bst, unsrt.bst, alpha.bst, abbrv.bst, agsm.bst,
     dcu.bst, cje.bst, aer.bst, or kluwer.bst.
     This restriction helps ensure that all standard styles are identical.

如果您按照如下所示进行更改,请将其保存为新.bst文件并将其命名为其他名称,例如robinho.bst


  1. .bst文件中,找到 ( Ctrl+ F)FUNCTION {output.month.year}条目。这将控制月份和年份输出的格式。因此,要添加所需的括号(请注意,这将改变全部年份字段的格式包括括号),替换

    FUNCTION {output.month.year}
      {
          space month plain.space.output
          space year plain.comma "year" output.check
      }
    

    FUNCTION {output.month.year}
      {
          space month plain.space.output
          space "(" year * ")" * plain.comma "year" output.check
      }
    
  2. 要影响年份字段的位置,请继续在文件中找到 ( Ctrl+ F) 。替换.bstFUNCTION {article}

    FUNCTION {article}
    { output.bibitem
      author.item.check
      format.title.if.not.sortkey.check
      crossref missing$
        { space journal italic comma "journal" output.check
          output.month.year
          output.vol.num.pages
        }
        { space format.article.crossref plain.space output.nonnull
          comma format.pages plain.space.output
        }
      if$
      fin.entry
    }
    

    FUNCTION {article}
    { output.bibitem
      author.item.check
      output.month.year
      format.title.if.not.sortkey.check
      crossref missing$
        { space journal italic comma "journal" output.check
          output.vol.num.pages
        }
        { space format.article.crossref plain.space output.nonnull
          comma format.pages plain.space.output
        }
      if$
      fin.entry
    }
    
  3. 另存为robinho.bst。(这样做,原因我在本文开头提到过。)

然后考虑以下 MWEB:

\begin{filecontents*}{\jobname.bib}
    @Article{abeler2010gift,
        author    = {Abeler, Johannes and Altmann, Steffen and Kube, Sebastian and Wibral, Matthias},
        title     = {Gift exchange and workers' fairness concerns: When equality is unfair},
        year      = {2010},
        volume    = {8},
        number    = {6},
        pages     = {1299--1324},
        journal   = {Journal of the European Economic Association},
        publisher = {Wiley Online Library},
    }
\end{filecontents*}

\documentclass{article}
\usepackage{natbib}
\usepackage{filecontents}

\begin{document}
    \section{Test}

    Here is an example to cite \citet{abeler2010gift} in text.

    \bibliographystyle{robinho}% <-----------
    \bibliography{\jobname}% <-----------
%   \nocite{*}

\end{document}

输出结果如下:

在此处输入图片描述

相关内容