使用 biblatex 将字母从卷移动到期刊字段

使用 biblatex 将字母从卷移动到期刊字段

我已经自动生成了 bibtex 条目,例如:

@article{Gasser:1984gg,
      author         = "Gasser, J. and Leutwyler, H.",
      title          = "{Chiral Perturbation Theory: Expansions in the Mass of
                        the Strange Quark}",
      journal        = "Nucl. Phys.",
      volume         = "B250",
      year           = "1985",
      pages          = "465-516",
      doi            = "10.1016/0550-3213(85)90492-4",
      reportNumber   = "CERN-TH-3798",
      SLACcitation   = "%%CITATION = NUPHA,B250,465;%%"
}

@article{Leutwyler:1992yt,
      author         = "Leutwyler, H. and Smilga, Andrei V.",
      title          = "{Spectrum of Dirac operator and role of winding number in
                        QCD}",
      journal        = "Phys. Rev.",
      volume         = "D46",
      year           = "1992",
      pages          = "5607-5632",
      doi            = "10.1103/PhysRevD.46.5607",
      reportNumber   = "BUTP-92-10",
      SLACcitation   = "%%CITATION = PHRVA,D46,5607;%%"
}

@article{Chou:1983qy,
      author         = "Chou, Kuang-chao and Guo, Han-ying and Wu, Ke and Song,
                        Xing-chang",
      title          = "{On the Gauge Invariance and Anomaly Free Condition of
                        {Wess-Zumino}-witten Effective Action}",
      journal        = "Phys. Lett.",
      volume         = "134B",
      year           = "1984",
      pages          = "67-69",
      doi            = "10.1016/0370-2693(84)90986-9",
      reportNumber   = "AS-ITP-83-027",
      SLACcitation   = "%%CITATION = PHLTA,134B,67;%%"
}

不幸的是,日记帐字段的最后一个字母有时会存储为卷字段的第一个或最后一个字母。有没有办法biblatex自动将字母从卷字段的开头或结尾移动到日记帐字段的末尾?
因此,我想将左侧的条目视为以右侧的形式给出:

journal        = "Nucl. Phys.",      -->      journal        = "Nucl. Phys. B",
volume         = "B250",             -->      volume         = "250",
journal        = "Phys. Rev.",       -->      journal        = "Phys. Rev. D",
volume         = "D46",              -->      volume         = "46",
journal        = "Phys. Lett.",      -->      journal        = "Phys. Lett. B",
volume         = "134B",             -->      volume         = "134",

答案1

由于您正在使用,biblatex您可以使用 Biber 源映射来操作来自文件的输入数据.bib

需要额外的映射步骤\step[fieldsource=journal, fieldtarget=journaltitle]是因为该journal字段是内部调用的journaltitle,而通常处理该问题的自动映射在错误的时间执行。

.bib仅对文件进行一次更正,然后使用文件的干净版本,而不是让 Biber 每次都执行映射,这可能会很有用。

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
      \step[fieldsource=volume, match=\regexp{\A(\p{L}+)?\d+(\p{L}+)?\Z}, final]
      \step[fieldsource=volume, match=\regexp{\A(\p{L}+)?(\d+)(\p{L}+)?\Z}, replace={$2}]
      \step[fieldsource=journal, fieldtarget=journaltitle]
      \step[fieldset=journaltitle, fieldvalue={\space$1$2}, append=true]
    }
  }
}

\begin{filecontents}{\jobname.bib}
@article{gasser,
  author         = {Gasser, J. and Leutwyler, H.},
  title          = {Chiral Perturbation Theory: Expansions in the Mass of
                    the Strange Quark},
  journal        = {Nucl. Phys.},
  volume         = {B250},
  year           = {1985},
  pages          = {465-516},
  doi            = {10.1016/0550-3213(85)90492-4},
  reportNumber   = {CERN-TH-3798},
}
@article{leutwyler,
  author         = {Leutwyler, H. and Smilga, Andrei V.},
  title          = {Spectrum of {Dirac} Operator and Role of Winding Number in
                    {QCD}},
  journal        = {Phys. Rev.},
  volume         = {D46},
  year           = {1992},
  pages          = {5607-5632},
  doi            = {10.1103/PhysRevD.46.5607},
  reportNumber   = {BUTP-92-10},
}
@article{chou,
  author         = {Chou, Kuang-chao and Guo, Han-ying and Wu, Ke and Song,
                    Xing-chang},
  title          = {On the Gauge Invariance and Anomaly Free Condition of
                    {Wess--Zumino--Witten} Effective Action},
  journal        = {Phys. Lett.},
  volume         = {134B},
  year           = {1984},
  pages          = {67-69},
  doi            = {10.1016/0370-2693(84)90986-9},
  reportNumber   = {AS-ITP-83-027},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}


\begin{document}
\nocite{gasser,leutwyler,chou,sigfridsson}
\printbibliography
\end{document}

Chou, Kuang-chao 等人 (1984)。《论 Wess–Zumino–Witten 有效作用的规范不变性和无异常条件》。在:Phys. Lett. B 134,第 67-69 页。doi:10.1016/0370-2693(84)90986-9。//Gasser, J. 和 H. Leutwyler (1985)。《手性微扰理论:奇异夸克质量的扩展》。在:Nucl. Phys. B 250,第 465-516 页。doi:10.1016/0550-3213(85)90492-4。//Leutwyler, H. 和 Andrei V. Smilga (1992)。 “狄拉克算子的光谱和 QCD 中绕组数的作用”。在:Phys. Rev. D 46,第 5607-5632 页。doi:10.1103/PhysRevD.46.5607。//Sigfridsson, Emma 和 Ulf Ryde (1998)。“从电势和矩导出原子电荷的方法比较”。在:Journal of Computational Chemistry 19.4,第 377-395 页。doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P。

相关内容