plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
508 stars 117 forks source link

Add ocn number #1155

Open bastien-roucaries opened 3 years ago

bastien-roucaries commented 3 years ago

Hi,

In order to improve data for old book it will be nice to add a field ocn.

For book too old for getting an isbn the current state of art number is the ocn. Wikipedia use it and major catalog (like sudoc in france) allow to search by OCN.

It will improve the quality of the bibliographic database. Every time you get an isbn, we could have a ocn.

Bastien

bastien-roucaries commented 3 years ago

With biblatex-ext @moewew I can do this and get nice fallback for my report:

\DeclareFieldFormat{isbn}{%
  \mkbibacro{ISBN}: \href{https://en.wikipedia.org/wiki/Special:BookSources/#1}{#1}}

\DeclareFieldFormat{ocn}{%
  \mkbibacro{OCN}: \href{https://www.worldcat.org/search?q=no\%3A/#1}{#1}}

\newbibmacro*{isbn}{%
  \ifboolexpr{not togl {bbx:isbn} or (test {\iffieldundef{isbn}} and test {\iffieldundef{ocn}})}
    {}%
    {%
      \iffieldundef{isbn}%
        {%
          \iffieldxref{ocn}{}{\printfield{ocn}}%
        }%
        {%
          \iffieldxref{isbn}{}{\printfield{isbn}}%
        }%
   }%
}