TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The following book is referenced through two distinct isbn numbers: the online isbn and the print isbn. Is there a way to reflect this with biblatex?

@BOOK{AcaryBrogliato201011, 
  title={Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics   and Electronics (Lecture Notes in Applied and Computational Mechanics)},
  author={Vincent Acary and Bernard Brogliato},
  publisher={Springer},
  date={2010},
  month={11},
  edition={Softcover reprint of hardcover 1st ed. 2008},
  isbn_online={9783540753926},
  isbn_print={9783642094644},
  url={http://amazon.de/o/ASIN/3642094643/},
  price={EUR 245,03},
  totalpages={548},
  timestamp={2013.04.25},
}
share|improve this question
    
I think you can reflect everything. The question is what's your idea? ;-) – Marco Daniel Mar 21 '13 at 18:39
2  
Why not just use the ISBN for the copy you're actually citing? If you insist on both the isbn field is of the literal type so you can do list processing with \forcsvfield. You can also extend the default data model to make isbn of the list type. There was some discussion of this at the github repo. – Audrey Mar 21 '13 at 19:29
    
@MarcoDaniel I would like to reference the two numbers. I am not sure it makes sense though. – pluton Mar 21 '13 at 20:15
    
@Audrey Thanks, I'll try to have a look at this possibility. – pluton Mar 21 '13 at 20:16
1  
The texnical perspective aside, I wonder if you should do that. IIRC, print vs online counts as different editions and should therefore probably be cited separatedly. While kind of a nuisande, it can be important if e.g. page numbers differ, or the electronic version receives an update without a new printing (would it get a new ISBN?). That is, it may be important which version you cite. – Raphael Sep 18 '15 at 16:08
up vote 4 down vote accepted

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 bibliography with two ISBNs

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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