Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wg030/biblatex-iso690 int…
Browse files Browse the repository at this point in the history
…o wg030-master
  • Loading branch information
michal-h21 committed Mar 13, 2022
2 parents c1cb927 + 979fe0f commit 247a525
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 36 deletions.
2 changes: 2 additions & 0 deletions bulgarian-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
{онлайн}},
film = {{филм}%
{филм}},
% application = {{}%
% {}},% FIXME: missing
}

\endinput
2 changes: 2 additions & 0 deletions czech-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
{online}},
film = {{film}%
{film}},
% application = {{}%
% {}},% FIXME: missing
}

\endinput
2 changes: 2 additions & 0 deletions english-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{online}},
film = {{film}%
{film}},
application = {{application}%
{application}},
}

\endinput
2 changes: 2 additions & 0 deletions french-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
{en ligne}},
film = {{film}%
{film}},
% application = {{}%
% {}},% FIXME: missing
}

\endinput
2 changes: 2 additions & 0 deletions german-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{online}},
film = {{Film}
{Film}},
application = {{Anmeldung}%
{Anmeldung}},
}

\endinput
38 changes: 19 additions & 19 deletions iso-authoryear.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@
\renewbibmacro*{date}{}%

% Overwrite names:primary to print year right after:
% 0) holder (only for patents)
% 1) author
% 2) editor
% 3) label/title
% Need to handle not to print editor twice (primary
% and subsidiary names): editor macro includes \clearname{editor}
\renewbibmacro*{names:primary}{%
% First check if we have author(s) available
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{author}%
\setunit{\addspace}%
\printfield{nameaddon}%
\setunit{\printdelim{nameyeardelim}}}%
{% If no author(s) is available, check for editor(s)
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
% If we have a patent with holder field, we will use that.
\ifboolexpr{test \ifuseholder and test {\ifentrytype{patent}}
and not test {\ifnameundef{holder}}}
{\usebibmacro{byholder}%
\setunit{\addspace}%
\printfield{nameaddon}%
\setunit{\printdelim{nameyeardelim}}}%
{% Otherwise, first check if we have author(s) available
\ifboolexpr{test \ifuseauthor and not test {\ifnameundef{author}}}
{\usebibmacro{author}%
\setunit{\addspace}%
\printfield{nameaddon}%
\setunit{\printdelim{nameyeardelim}}}%
{% If no author(s) is available, check for editor(s)
\ifboolexpr{test \ifuseeditor and not test {\ifnameundef{editor}}}
{\usebibmacro{editor}%
\setunit{\printdelim{nameyeardelim}}}%
\setunit{\printdelim{nameyeardelim}}}%
{% If no editor(s) is available, use label/title
\usebibmacro{labeltitle}%
\setunit{\printdelim{nonameyeardelim}}}}%
\usebibmacro{labeltitle}%
\setunit{\printdelim{nonameyeardelim}}}}}%
% And finally print date
\usebibmacro{date+extradate}%
}
Expand Down
122 changes: 105 additions & 17 deletions iso.bbx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
\DeclareLanguageMappingSuffix{-iso}
% Currently needed the following additional language strings:
\NewBibliographyString{at,bysupervisor,urlalso,
director,bydirector,inventor,byinventor,online,film}
director,bydirector,inventor,byinventor,online,film,application}

% PACKAGE OPTIONS

Expand Down Expand Up @@ -122,6 +122,9 @@
% The separator between 'dates' and the numeration section
\newcommand{\numerationpunct}{\addcomma\space}

% No seperator at the very end of an entry
\renewcommand{\finentrypunct}{}

% A colon preceded with or without space
\newcommand{\addspacecolon}{%
\iftoggle{bbx:spcolon}
Expand Down Expand Up @@ -236,6 +239,11 @@
{\mainlangbibstring{#1}}
{#1}%
}
\DeclareFieldFormat[patent]{type}{%
\ifbibstring{#1}
{\mainlangbiblstring{#1}}
{#1}%
}

% Format supervisor of thesis (precedes the name with a localisation string)
\DeclareFieldFormat{supervisor}{%
Expand Down Expand Up @@ -309,19 +317,63 @@
{#1}}% This is the go-to format
}

% Define names to consider for 'labelname', based on
% the default definition, but adding holder as the
% very first choice for patents.
\DeclareLabelname[patent]{%
\field{holder}
\field{shortauthor}
\field{author}
\field{shorteditor}
\field{editor}
\field{translator}
}

% Define dates to consider for 'labeldate', based on
% the default definition, but without 'urldate' field,
% preventing printing url seen date in place of the year
% of a publication.
\DeclareLabeldate{%
\field{origdate}
\field{date}
\field{year}
\field{dateaddon}% <---- biblatex-iso690 data model extension
\field{eventdate}
\field{origdate}
\literal{nodate}
}

% Sorting
\DeclareSortingTemplate{nyt}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort{
\field{sortname}
\field{holder}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sortyear}
\field{origyear}
\field{year}
}
\sort{
\field{sorttitle}
\field{title}
}
\sort{
\field{volume}
\literal{0}
}
}

% Format chapter of book with preceding localisation string
\DeclareFieldFormat{chapter}{\bibstring{chapter}\addnbspace#1\isdot}

Expand Down Expand Up @@ -363,6 +415,9 @@
% given (first) name followed by last (family) name,
% so it may sound more naturally in this order
\DeclareNameAlias{supervisor}{given-family}
% For patents the author field is supposed to be the inventor
% of the patent, which we want to be reverse name order
\DeclareNameAlias[patent]{author}{given-family}

% BIBLIOGRAPHY MACROS

Expand All @@ -371,15 +426,16 @@
% Based on author/editor macro
% Adds nameaddon field to author names
\newbibmacro*{names:primary}{%
\ifboolexpr{
test \ifuseauthor
and
not test {\ifnameundef{author}}
}
{\usebibmacro{author}%
\setunit{\addspace}%
\printfield{nameaddon}}%
{\usebibmacro{editor}}%
\ifboolexpr{test \ifuseholder and test {\ifentrytype{patent}}
and not test {\ifnameundef{holder}}}
{\usebibmacro{byholder}%
\setunit{\addspace}%
\printfield{nameaddon}}%
{\ifboolexpr{test \ifuseauthor and not test {\ifnameundef{author}}}
{\usebibmacro{author}%
\setunit{\addspace}%
\printfield{nameaddon}}%
{\usebibmacro{editor}}}%
}

% Macro for secondary authors with their role
Expand Down Expand Up @@ -407,6 +463,16 @@
\printnames{supervisor}}%
}

% Macro for printing the inventor of a patent
\newbibmacro*{patentinventor}{%
\ifnameundef{author}
{}
{\mainlangbibstring{inventor}%
\setunit{\addcolon\space}%
\usebibmacro{author}}%
}


% TITLES MACROS

% Macro for formatting <prefix>titles
Expand Down Expand Up @@ -471,6 +537,7 @@
{\usebibmacro{titles}{issue}{}}%
}


% MEDIUM TYPE MACROS

\newbibmacro*{medium-type}{%
Expand Down Expand Up @@ -504,6 +571,17 @@
{\printfield{howpublished}}}%
}


% EDITION INFO MACROS

% Application date
\newbibmacro{applicationdate}{%
\iffieldundef{origyear}
{}
{\mainlangbibstring{application}\addcolon\space\printorigdate}
}


% PUBLICATION INFO MACROS

% By default only year is used, but for some entries,
Expand Down Expand Up @@ -558,6 +636,7 @@
\newbibmacro*{location+publisher+fulldate}{%
\usebibmacro{location+publisher+dateform}{full}}


% NUMERATION MACROS

\newbibmacro*{serial:numeration}{%
Expand All @@ -574,6 +653,7 @@
\printfield{chapter}%
}


% SERIES TITLE AND NUMBER MACROS

% Based on series+number macro (defined in standard.bbx)
Expand All @@ -584,6 +664,7 @@
\printfield{number}%
}%


% STANDARD IDENTIFIERS MACROS

% Bunch of standard identifiers
Expand All @@ -604,6 +685,7 @@
{}%
}


% AVAILABILITY AND ACCESS MACROS

% Precedes DOI field with urlfrom localisation string
Expand Down Expand Up @@ -681,6 +763,7 @@
\printfield{library}}%
}


% OTHER MACROS

% Redeclare in: bibmacro to use the main document language.
Expand All @@ -700,6 +783,7 @@
\printunit{\intitlepunct}%
}


% BIBLATEX CORE ADJUSTMENTS

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand All @@ -720,7 +804,7 @@
\blx@mainlangbibstring{#1}{abx@sstr}{#2}}

% We use Babel or Polyglossia main document language for some
% bibliography strings. With currentlang option, the currently
% bibliography strings. With currentlang option, the currently
% selected language is used instead. It is useful in some classes
% that don't support selection of the main language.
% https://github.com/michal-h21/biblatex-iso690/issues/90
Expand Down Expand Up @@ -1400,22 +1484,26 @@
\newunit\newblock
\usebibmacro{names:subsidiary}%
\newunit\newblock
\usebibmacro{patentinventor}%
\newunit
\printdate%
\newunit
\usebibmacro{applicationdate}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{location}%
\newunit\newblock
\iffieldundef{type}
{}
{\printfield{type}%
\setunit*{\addcomma\space}}%
\setunit*{\addspace}}%
\printfield{number}%
\newunit\newblock
\usebibmacro{fulldate}%
\setunit{\addspace}%
\usebibmacro{urldate}%
\newunit\newblock
\usebibmacro{availability+access}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\usebibmacro{finentry}}%
Expand Down
2 changes: 2 additions & 0 deletions polish-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
% {}},% FIXME: missing
% film = {{}%
% {}},% FIXME: missing
% application = {{}%
% {}},% FIXME: missing
}

\endinput
2 changes: 2 additions & 0 deletions slovak-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
{online}},
film = {{film}%
{film}},
% application = {{}%
% {}},% FIXME: missing
}

\endinput
2 changes: 2 additions & 0 deletions spanish-iso.lbx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
andothers = {{et\addabbrvspace al\adddot}%
{et\addabbrvspace al\adddot}},
% if not, y col. will be used instead of et al.
% application = {{}%
% {}},% FIXME: missing
}

\endinput

0 comments on commit 247a525

Please sign in to comment.