
我使用 biblatex 和 biber 有以下定義:
\usepackage[
backend=biber,
sorting=none,
backref=true,
% firstinits=true,
style=numeric-comp
]{biblatex}
\DefineBibliographyStrings{english}{
backrefpage = {cited on p.},
backrefpages = {cited on pp.}
}
我有一個參考書目項目定義如下:
@book{yellow-hl-lhc,
author = "Apollinari, G and Béjar Alonso, I and Brüning, O and Lamont, M and
Rossi, L",
title = "{High-Luminosity Large Hadron Collider (HL-LHC):
Preliminary Design Report}",
publisher = "CERN",
address = "Geneva",
series = "CERN Yellow Reports: Monographs",
year = "2015",
url = "https://cds.cern.ch/record/2116337",
doi = "10.5170/CERN-2015-005"
}
結果是這樣的:
是否可以定義一個名為 的新字段,cds
其工作方式類似於doi
,因此在.bib
我可以編寫的文件中cds = "2116337"
,它會將“CDS: 2116337”添加到參考書目中的項目中,並帶有鏈接到URL 的編號?
答案1
對於後代,這是我根據答案所做的事情的列表這裡,這是在評論中建議的。
inside biblatex-dm.cfg
,可以放在與主.tex
檔案同一目錄下,
\DeclareDatamodelFields[type=field,datatype=verbatim]{cds}
\DeclareDatamodelEntryfields{cds}
在主要.tex
、之後\usepackage{biblatex}
、之前\begin{document}
、
\DeclareFieldFormat{cds}{%
\textsc{cds}\addcolon\space
\ifhyperref
{\href{https://cds.cern.ch/record/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\printfield{cds}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}