1

Please consider the following snippet:

\documentclass[10pt]{article}
\usepackage[backend=biber]{biblatex}
\begin{filecontents*}{p.bib}
  @book{Smith2015,
        title = {Some Conundrums},
        author = {Smith, John},
        year = {2015},
        isbn = {for printed version},
        isbn = {for online version}
  }
\end{filecontents*}
\addbibresource{p.bib}
\nocite{Smith2015}
\begin{document} 
\printbibliography
\end{document}

Is it possible using biblatex/biber to print multiple ISBN's for a given entry, preferably prefixed with printed and online respectively. At present the online isbn overwrites the printed one.

4

Quite a mess.

Using filecontents, we write a new file that maps a data model for our new field oisbn. We manually add the oisbn field to the book-driver using a biblatex-cfg file. You have to make sure to add this to all drivers, if you want to have that feature for articles, incollections, etc. The additional toggle is just for convenience, if you decide to not include an online ISBN.

Be careful, make sure to not simply replace any files! Check carefully and append the contents to any existing files.

pieterBiblatexField

\begin{filecontents*}{biblatex-dm.cfg}
    \ProvidesFile{biblatex-dm.cfg}
    \DeclareDatamodelFields[type=field, datatype=literal]{oisbn}
    \endinput
\end{filecontents*}
\begin{filecontents*}{biblatex.cfg}
\newtoggle{bbx:oisbn}
\DeclareBibliographyOption{oisbn}[true]{%
  \settoggle{bbx:oisbn}{#1}}
\ExecuteBibliographyOptions{oisbn}

\DeclareFieldFormat{oisbn}{{\color{red}online\mkbibacro{\space{}ISBN}\addcolon\space#1}}
\settoggle{bbx:oisbn}{true}
\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
    \newunit\newblock
  \iftoggle{bbx:oisbn}
    {\printfield{oisbn}}
    {no oisbn}%%%JB This is for debugging, make sure you don't have that in your real document
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}
  \end{filecontents*}
\documentclass[10pt]{article}
\usepackage{xcolor}
\usepackage[backend=biber]{biblatex}
\begin{filecontents*}{\jobname.bib}
    @book{Smith2015,
        title = {Some Conundrums},
        author = {Smith, John},
        year = {2015},
        isbn = {for printed version},
        oisbn = {for online version},
    }
\end{filecontents*}
\addbibresource{\jobname.bib}
\nocite{Smith2015}
\begin{document} 
\printbibliography

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.