Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
    
@pluton: Could you solve your issue? –  Marco Daniel Apr 7 '13 at 16:44
show 2 more comments

1 Answer

up vote 3 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
add comment

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.