编辑 bst 文件以添加“page”或“pages”

编辑 bst 文件以添加“page”或“pages”

我有这个最好的文件http://pastebin.com/z6mXByj7并使用了这个文本:

\documentclass[10pt,oneside,letterpaper,spanish]{book}
\usepackage[utf8x]{inputenc}
\usepackage[activeacute,spanish]{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>.}}
\decimalpoint %\spanishdecimal{.}

\usepackage[spanish]{babel}
\usepackage{natbib}
\usepackage{ulem}
\def\bbluline#1{\uline#1}

\begin{document}
asdasd \citep{chsh_inequality} asdasd \citep*{aspect_test_bell}
\bibliographystyle{fiuady3}
\bibliography{ejem_biblio}

\end{document}

使用此 bib 文件

% This file was created with JabRef 2.5.
% Encoding: Cp1252


@ARTICLE{chsh_inequality,
   author = {{Clauser}, J.~F. and {Horne}, M.~A. and {Shimony}, A. and {Holt}, R.~A.
    },
    title = "{Proposed Experiment to Test Local Hidden-Variable Theories}",
  journal = {Physical Review Letters},
     year = 1969,
    month = oct,
   volume = 23,
   number = 15,
    pages = {880-884},
      doi = {10.1103/PhysRevLett.23.880},
   adsurl = {http://adsabs.harvard.edu/abs/1969PhRvL..23..880C},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{aspect_test_bell,
   author = {{Aspect}, A. and {Grangier}, P. and {Roger}, G.},
    title = "{Experimental Tests of Realistic Local Theories via Bell's Theorem}",
  journal = {Physical Review Letters},
 keywords = {Fluorescence, phosphorescence},
     year = 1981,
    month = aug,
   volume = 47,
   number = 15,
    pages = {460-463},
      doi = {10.1103/PhysRevLett.47.460},
   adsurl = {http://adsabs.harvard.edu/abs/1981PhRvL..47..460A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

输出结果如下在此处输入图片描述

这正是我需要的,除了它应该将页面“pp”的粒子放在 460-460 和 880-884 之前。可以通过编辑 bst 文件来实现吗?

答案1

format.journal.pages您必须按如下方式更改函数的定义

FUNCTION {format.journal.pages}
{ pages duplicate$ empty$ 'pop$
    { swap$ duplicate$ empty$
        { pop$ pop$ format.pages }
        {
          ", " * 
          swap$ pop$
          format.pages *
        }
      if$
    }
  if$
}

请注意,这仅适用于类型的条目article

答案2

在我的 .bst 文件中,我有bbl.pagesbbl.page函数,它们控制包含单页和多页的参考文献的预格式化。

FUNCTION {bbl.pages}
{ "pp." }

FUNCTION {bbl.page}
{ "p." }

这些函数可以分别从 从pp.修改为Pages:p.Page:,如下所示:

FUNCTION {bbl.pages}
{ "Pages:" }

FUNCTION {bbl.page}
{ "Page:" }

为了了解这将如何影响您的最终文档,上面的函数bbl.pagesbbl.page随后在函数中调用format.pages

FUNCTION {format.pages}
{ pages duplicate$ empty$ 'skip$
    { duplicate$ multi.page.check
        {
          bbl.pages swap$
          n.dashify
        }
        {
          bbl.page swap$
        }
      if$
      tie.or.space.prefix
      "pages" bibinfo.check
      * *
    }
  if$
}

format.pages函数中,首先检查页面字段为空(如果为真则跳过),然后检查是否涉及单个还是多个页面(multi.page.check),分别调用bbl.pagebbl.pages函数。

相关内容