Relativity Biblatex 格式的 Living Reviews(简化的 [DOI]、[ADS]、[ARXIV] 标识符)

Relativity Biblatex 格式的 Living Reviews(简化的 [DOI]、[ADS]、[ARXIV] 标识符)

我想模仿 Relativity(Springer)中众多 Living Reviews 中出现的这种参考书目风格。具体来说,Arxiv、DOI 和 ADS 标识符都简化为方括号,如图所示。我熟悉 biblatex 的使用,但我找不到正确实现这种风格的方法。目前我有

\usepackage[backend=bibtex,style=numeric,citestyle=numeric-comp,natbib=true,sorting=nyt,language=english,bibstyle=numeric,backref=true,giveninits=true]{biblatex}
with e.g.
@ARTICLE{2016PhRvD..94l4038D,
       author = {{De Laurentis}, Mariafelicia and {Porth}, Oliver and {Bovard}, Luke and
         {Ahmedov}, Bobomurat and {Abdujabbarov}, Ahmadjon},
        title = "{Constraining alternative theories of gravity using GW150914 and GW151226}",
      journal = {\prd},
     keywords = {General Relativity and Quantum Cosmology},
         year = "2016",
        month = "Dec",
       volume = {94},
       number = {12},
          eid = {124038},
        pages = {124038},
          doi = {10.1103/PhysRevD.94.124038},
archivePrefix = {arXiv},
       eprint = {1611.05766},
 primaryClass = {gr-qc},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2016PhRvD..94l4038D},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
} 

Luc Blanchet,生活评论 CMWill Living 评论

答案1

您必须重新定义相关字段格式。您可以在以下位置找到默认格式:biblatex.def,第 445-501 行于 v3.12

主要的变化包括添加\mkbibbrackets和更改的文本参数\href。请注意,我删除了\ifhyperref某些格式的测试,这意味着代码现在需要hyperref(事实上,如果没有链接可以附加到它,那么仅仅打印“DOI”是没有意义的,所以我认为这是一个可以接受的变化)。

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

\usepackage[backend=bibtex, style=numeric-comp, sorting=nyt,
  giveninits=true,
  natbib=true, backref=true]{biblatex}

\usepackage[colorlinks]{hyperref}


\DeclareFieldFormat{doi}{%
  \mkbibbrackets{%
    \href{https://doi.org/#1}{\mkbibacro{DOI}}}}

\makeatletter
\DeclareFieldFormat{eprint:arxiv}{%
  \mkbibbrackets{%
    \ifhyperref
      {\href{https://arxiv.org/\abx@arxivpath/#1}{%
         arXiv\addcolon
         \nolinkurl{#1}%
         \iffieldundef{eprintclass}
           {}
           {\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}
      {arXiv\addcolon
       \nolinkurl{#1}%
       \iffieldundef{eprintclass}
         {}
         {\addspace\texttt{\mkbibbrackets{\thefield{eprintclass}}}}}}}
\makeatother

\DeclareFieldFormat{eprint:googlebooks}{%
  \mkbibbrackets{%
    \href{http://books.google.com/books?id=#1}{Google Books}}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,baez/article,wassenberg,kastenholz,wilde}
\printbibliography
\end{document}

“JC Baez 和 AD Lauda。‘高维代数 V:2-群’。版本 3。在:范畴论与应用 12(2004 年),第 423-491 页。[arXiv:math/0307200v3](引自第 1 页)。”等等。

答案2

来自原始 livrevrel.bst 文件:

% shows DOI and links doi
FUNCTION {format.doi}
{ doi empty$
    { "" }
    {"{\small[\href{http://dx.doi.org/" doi * "}{DOI" * "}]}" *}
  if$
}

相关内容