NB: biber
is needed to (fully) enjoy the following code.
To let BibLaTeX
deal with online and print ISBNs, we need register the fields in a datamodel file, the easiest way is to create a <style>.dbx
in the working directory.
\ProvidesFile{authortitle.dbx}
\DeclareDatamodelFields[type=field,datatype=literal]{isbnonline}
\DeclareDatamodelFields[type=field,datatype=literal]{isbnprint}
\DeclareDatamodelEntryfields{isbnonline,isbnprint}
Now biber
and BibLaTeX
know the field, we need to get BibLaTeX
to print it in a nice format
\DeclareFieldFormat{isbnonline}{\mkbibacro{ISBN}~(online)\addcolon\space #1}% we need some format ..
\DeclareFieldFormat{isbnprint}{\mkbibacro{ISBN}~(print)\addcolon\space #1}% ... just stole it from standard ISBN
We just patch the bibliography drivers to also print our online and print ISBN.
With the following command patching a driver (that includes \printfield{isbn}
) is as easy as \patchmoreisbn{book}
.
\newcommand*{\patchmoreisbn}[1]{% let all drivers include the isbn
\xpatchbibdriver{#1}%
{\printfield{isbn}}
{\printfield{isbn}%
\newunit\newblock
\printfield{isbnprint}%
\newunit\newblock
\printfield{isbnonline}}%
{\typeout{patching #1 to include more ISBNs succeded}}%
{\typeout{patching #1 to include more ISBNs failed}}%
}
The full MWE
\documentclass[ngerman, a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage{xpatch}% to patch the editor macros
\usepackage[style=authortitle, backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents}{authortitle.dbx}
\ProvidesFile{authortitle.dbx}
\DeclareDatamodelFields[type=field,datatype=literal]{isbnonline}
\DeclareDatamodelFields[type=field,datatype=literal]{isbnprint}
\DeclareDatamodelEntryfields{isbnonline,isbnprint}
\end{filecontents}
\begin{filecontents}{\jobname.bib}
@book{AcaryBrogliato201011,
title = {Numerical Methods for Nonsmooth Dynamical Systems},
subtitle = {Applications in Mechanics and Electronics},
titleaddon = {Lecture Notes in Applied and Computational Mechanics},
author = {Vincent Acary and Bernard Brogliato},
publisher = {Springer},
date = {2010},
month = {11},
edition = {1},
isbnonline = {978-3-540-75392-6},
isbnprint = {978-3-642-09464-4},
}
@book{Heuser:Analysis1,
author = {Harro Heuser},
title = {Lehrbuch der Analysis Teil 1},
edition = {17., aktualisierte},
date = {2009},
gender = {sm},
isbn = {978-3-8384-0777-9},
publisher = {Vieweg+Teubner},
location = {Wiesbaden},
}
\end{filecontents}
\DeclareFieldFormat{isbnonline}{\mkbibacro{ISBN}~(online)\addcolon\space #1}% we need some format ..
\DeclareFieldFormat{isbnprint}{\mkbibacro{ISBN}~(print)\addcolon\space #1}% ... just stole it from standard ISBNa
\newcommand*{\patchmoreisbn}[1]{% let all drivers include the isbn
\xpatchbibdriver{#1}%
{\printfield{isbn}}
{\printfield{isbn}%
\newunit\newblock
\printfield{isbnprint}%
\newunit\newblock
\printfield{isbnonline}}%
{\typeout{patching #1 to include more ISBNs succeded}}%
{\typeout{patching #1 to include more ISBNs failed}}%
}
% patch all drivers
\patchmoreisbn{article}
\patchmoreisbn{book}
\patchmoreisbn{collection}
\patchmoreisbn{inbook}
\patchmoreisbn{incollection}
\patchmoreisbn{inproceedings}
\patchmoreisbn{manual}
\patchmoreisbn{periodical}
\patchmoreisbn{proceedings}
\patchmoreisbn{report}
\patchmoreisbn{thesis}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
produces

isbn
field is of the literal type so you can do list processing with\forcsvfield
. You can also extend the default data model to makeisbn
of the list type. There was some discussion of this at the github repo.