更改字段顺序并抑制额外的 arXiv 标识符

更改字段顺序并抑制额外的 arXiv 标识符

虽然我见过一些改变 biblatex 中字段顺序的例子,但出于某种原因,我无法改变pagesdate字段的顺序。现在打印是


L. Maclerran:“理论总结:夸克物质 2006”。J.Phys. G34(2007),538-592。arXiv:hep-ph/0702004 [hep-ph]


我希望的是


L. Maclerran:“理论总结:夸克物质 2006”。J.Phys. G34, 538-592 (2007),arXiv:hep-ph/0702004


额外的标识符问题仅存在于 2007 年之前的电子印刷本中,当时标识符的形式发生了变化。

以下是迄今为止我相关的和不太相关的(以防我戳到了一些不应该戳的部分) biblatex 相关代码(包括我尝试更改datepages字段的顺序但失败了):

\usepackage[style=numeric-comp,
sorting=none,
backend=bibtex,
doi=false,
firstinits=true,
hyperref]{biblatex}


%supress "in" from biblatex
\renewbibmacro{in:}{}
%":" instead of "." after author in biblatex
\renewcommand{\labelnamepunct}{\addcolon\space}
% Collaborations correctly with tag "authortype"
\renewbibmacro*{author}{%
   \ifboolexpr{ test {\ifuseauthor} and not test {\ifnameundef{author}} }
     {\printnames{author}%
     \iffieldundef{authortype}
       {}
       {\setunit{\addspace}%
        \usebibmacro{authorstrg}}}
     {}}
\DeclareFieldFormat{authortype}{\mkbibparens{#1}}
% removes period at the very end of bibliographic record
\renewcommand{\finentrypunct}{}
% "p.101"->"101"
\DeclareFieldFormat{pages}{#1} 

% (year), pages -> pages (year),
\renewbibmacro{date+pages}{%
   \printfield{pages}%
   \setunit*{\space}%
   \usebibmacro{date}%
   \setunit*{\addcomma\space}%
   \newunit}

所用示例引用直接来自 InspireHEP:

@article{McLerran:2007hz,
      author         = "McLerran, Larry",
      title          = "{Theory Summary: Quark Matter 2006}",
      journal        = "J.Phys.",
      volume         = "G34",
      pages          = "583-592",
      doi            = "10.1088/0954-3899/34/8/S50",
      year           = "2007",
      eprint         = "hep-ph/0702004",
      archivePrefix  = "arXiv",
      primaryClass   = "hep-ph",
      SLACcitation   = "%%CITATION = HEP-PH/0702004;%%",
}

我提前感谢您的回答:)

答案1

更改 s 顺序的最简单方法@article可能是从 bib 驱动程序中删除页码(使用xpatch包裹)

\xpatchbibdriver{article}
  {\newunit
   \usebibmacro{note+pages}}
  {}{}{}

然后我们将页面插入到journal+issuetitle宏中,如下所示

\newbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \newunit
  \usebibmacro{note+pages}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

平均能量损失

\documentclass[12pt,a4paper]{article}
\usepackage[style=numeric-comp,firstinits=true,]{biblatex}
\usepackage{xpatch}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}

%supress "in" from biblatex
\renewbibmacro{in:}{}
%":" instead of "." after author in biblatex
\renewcommand{\labelnamepunct}{\addcolon\space}
% Collaborations correctly with tag "authortype"
\renewbibmacro*{author}{%
   \ifboolexpr{ test {\ifuseauthor} and not test {\ifnameundef{author}} }
     {\printnames{author}%
     \iffieldundef{authortype}
       {}
       {\setunit{\addspace}%
        \usebibmacro{authorstrg}}}
     {}}
\DeclareFieldFormat{authortype}{\mkbibparens{#1}}
% removes period at the very end of bibliographic record
\renewcommand{\finentrypunct}{}
% "p.101"->"101"
\DeclareFieldFormat{pages}{#1} 

% (year), pages -> pages (year),
\renewbibmacro{date+pages}{%
   \printfield{pages}%
   \setunit*{\space}%
   \usebibmacro{date}%
   \setunit*{\addcomma\space}%
   \newunit}

\xpatchbibdriver{article}
  {\newunit
   \usebibmacro{note+pages}}
  {}{}{}

\newbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
  \newunit
  \usebibmacro{note+pages}%
  \setunit{\addspace}%
  \usebibmacro{issue+date}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\begin{document}
\cite{baez/article,itzhaki,wassenberg}.

\printbibliography
\end{document}

在此处输入图片描述

相关内容