1

I'm using biblatex and biber with the following definitions:

\usepackage[
  backend=biber,
  sorting=none,
  backref=true,
  % firstinits=true,
  style=numeric-comp
]{biblatex}
\DefineBibliographyStrings{english}{
  backrefpage  = {cited on p.},
  backrefpages = {cited on pp.}
}

I have a bibliography item defined like this:

@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"
}

which comes out like this:

enter image description here

Is it possible to define a new field called cds that should work like doi, so in the .bib file I could write cds = "2116337" and it would add "CDS: 2116337" to the item in the bibliography with the number linked to the URL?

3
  • 1
    Does tex.stackexchange.com/q/155532/35864 help?
    – moewe
    Sep 23, 2020 at 6:16
  • 1
    Yes, it does. I'll write up what I did as an answer when I have time.
    – SU3
    Sep 27, 2020 at 6:25
  • Is what you did so different from the answer there that it warrants a new answer of its own or would you say it would also be OK to close this question here as a duplicate?
    – moewe
    Sep 27, 2020 at 6:38

1 Answer 1

1

For posterity, here is the listing of what I did, based on the answer here, which was suggested in the comments.

Inside biblatex-dm.cfg, which can be put in the same directory as the main .tex file,

\DeclareDatamodelFields[type=field,datatype=verbatim]{cds}
\DeclareDatamodelEntryfields{cds}

In the main .tex, after \usepackage{biblatex}, before the \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}}
    {}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .