plk / biblatex

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

patent #906

Open bastien-roucaries opened 5 years ago

bastien-roucaries commented 5 years ago

Hi,

I tried to create a pull request but I could not test it due to dev using a dev version of biber. So I open a issue.

I need to get reference to patents date, and I think it could be useful upstream

Is use thereofre patent with date:

@Patent{patent-US2462599-blumlein:1943,
  author =   {Blumlein,Alan Dower},
  related =      {patent-GB581164-blumlein:1940},
  relatedtype =  {priorityof},
  title =    {Self-balancing bridge arrangement},
  number =   {2462599},
  date =     {1949-02-22},
  fileddate =    {1943-09-11},
  granteddate =  {1949-02-22},
  expireddate =  {1961-11-21},
  holder =   {Blumlein,Alan Dower},
  type =     {patentus},
  language =     "langenglish",
  langid =   "english",
  abstract =     "The present invention relates to electrical
                  bridgearrangements, Methods are already known for
                  the measurement of capacities by meansof bridge
                  arrangements, the capacity being 10 determined by
                  adjusting one or more of the components of such
                  arrangements to give a balance condition, the value
                  of the unknown capacity then being calculable in
                  termsof the values of the known adjust- 16 able
                  components.  .  Although many such methodsare satis-
                  factory for the measurementofrelatively large
                  capacities, difficulties arise in their use for the
                  measurement of very small 20 capacities,
                  particularly in the presence of stray impedances
                  which may in some cases be comparable io the
                  capacity to be measured, since such stray capacities
                  may render the bridge arrangement seriously
                  inaccurate.  It has already been proposed to reduce
                  such errors by meansof a bridge arrange- ment
                  comprising a pair of equal tightly coupled inductive
                  ratio arms.  Such an 30 arrangement has the
                  advantage that at or - near the condition of balance
                  the outer endsof the inductive ratio armsare at sub-
                  _ stantially zero A.C. potential, so that the
                  presence of capacity at these points has 86 little
                  effect upon the accuracyof the bridge ‘
                  arrangements.  It is an object of the present
                  invention to provide a more sensitive and accurate
                  bridge of the aforementioned type having 40 tightly
                  coupled inductive ratio arms. "
}

And in the tex file something like

\usepackage{filecontents}

\begin{filecontents}{biblatex-dm.cfg}
  \DeclareDatamodelFields[type=field,datatype=date,nullok=true]{granteddate}
  \DeclareDatamodelFields[type=field,datatype=date,nullok=true]{publisheddate}
  \DeclareDatamodelFields[type=field,datatype=date,nullok=true]{fileddate}
  \DeclareDatamodelFields[type=field,datatype=date,nullok=true]{expireddate}
  \DeclareDatamodelEntryfields[patent]{granteddate}
  \DeclareDatamodelEntryfields[patent]{publisheddate}
  \DeclareDatamodelEntryfields[patent]{fileddate}
  \DeclareDatamodelEntryfields[patent]{expireddate}
  \DeclareFieldAlias[patent]{publisheddate}{date}
\end{filecontents}

\NewBibliographyString{priorityof}
\DefineBibliographyStrings{english}{%
  priorityof = {priority of},
}
\DefineBibliographyStrings{french}{%
  priorityof = {priorité de},
}

\NewBibliographyString{priorityto}
\DefineBibliographyStrings{english}{%
  priorityto = {priority to},
}
\DefineBibliographyStrings{french}{%
  priorityto = {priorité to},
}

\NewBibliographyString{granted}
\DefineBibliographyStrings{english}{%
  granted = {granted},
}
\DefineBibliographyStrings{french}{%
  granted = {délivré},
}
\NewBibliographyString{filed}
\DefineBibliographyStrings{english}{%
  filed = {filed},
}
\DefineBibliographyStrings{french}{%
  filed = {déposé},
}
\NewBibliographyString{expired}
\DefineBibliographyStrings{english}{%
  expired = {expired},
}
\DefineBibliographyStrings{french}{%
  expired = {échu},
}

% patent
\DeclareDriverSourcemap[datatype=bibtex]{
  \map{
    \step[fieldsource=publisheddate,        fieldtarget=date]
  }
}

\DeclareFieldFormat{patentdates}{\mkbibparens{#1}}

\renewbibmacro*{date}{%
  \printdate%
  {%
  \ifboolexpr{%
      test {\iffieldundef{filedyear}} and
      test {\iffieldundef{grantedyear}} and 
      test {\iffieldundef{expiredyear}}
    }%
    {}%
    {%
      \newunit%
      \printtext[patentdates]{%
          \iffieldundef{filedyear}{}{\bibstring{filed}\space \printfileddate}%
          \setunit*{\addcomma\space}%
          \iffieldundef{grantedyear}{}{\bibstring{granted}\space \printgranteddate}%
          \setunit*{\addcomma\space}%
          \iffieldundef{expiredyear}{}{\bibstring{expired}\space \printexpireddate}%
      }% 
    }%
  }%  
}
bastien-roucaries commented 5 years ago

Ok I have made a pull request https://github.com/plk/biblatex/pull/907