\ProvidesFile{iso-authoryear.bbx} [2020/03/25 v0.4.0 ISO 690 biblatex bibliography style] \RequireBibliographyStyle{iso} \ExecuteBibliographyOptions{% sorting=nyt, } % The separator between 'titles' and the numeration section. % Overrides the command in 'iso.bbx'. \renewcommand{\numerationpunct}{\newunitpunct} % Delimiter between creator name and year in bibliography \DeclareDelimFormat[bib,biblist]{nameyeardelim}{\addcomma\space} % Delimiter between substitution of creator name (if any) % and year in bibliography \DeclareDelimFormat[bib,biblist]{nonameyeardelim}{\addcomma\space} % a) % The field extradate turns from integer type to a letter % after year to distinguish more works of the author % from the same year, e.g. 1994a, 1994b. % We use 'labeldate' as it is also used in standard styles. % b) % Moreover we print additional date information (dateaddon). \newbibmacro*{date+extradate}{% \printlabeldateextra \setunit{\dateaddonpunct}% \iffieldequalstr{labeldatesource}{dateaddon} {}% Do not print dateaddon twice {\printfield{dateaddon}}% } % Check if 'date' field holds only year or a more specific date. % Inspired by \ifdatehasyearonlyprecision from 'biblatex.sty', % but the test date==year is left out, because we use date=year % in package options so it turned always true. \newcommand{\ifdatehasyearonly}{% \ifboolexpr{not test {\iffieldundef{year}} and (test {\iffieldundef{month}} and test {\iffieldundef{season}})} } % If there is no more specific date available, we shouldn't repeat % the year in publication info section. % Overrides macro 'fulldate' in 'iso.bbx'. \renewbibmacro*{fulldate}{% \ifdatehasyearonly% {}% Print nothing (only year is available) {\mkdaterangeiso{}}% } % Remove second appearance of year in a reference \renewbibmacro*{date}{}% % Overwrite names:primary to print year right after: % 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}} } {\usebibmacro{editor}% \setunit{\printdelim{nameyeardelim}}}% {% If no editor(s) is available, use label/title \usebibmacro{labeltitle}% \setunit{\printdelim{nonameyeardelim}}}}% % And finally print date \usebibmacro{date+extradate}% } % Print label or title in place of names if they are not available \newbibmacro*{labeltitle}{% \iffieldundef{label} {\iffieldundef{shorttitle} {\usebibmacro{titles}{}{emph}% \clearfield{title}% \clearfield{subtitle}% \clearfield{titleaddon}} {\printfield[title]{shorttitle}}} {\printfield{label}}} \newbool{bbx@inset} \DeclareBibliographyDriver{set}{% \booltrue{bbx@inset}% \entryset{}{}% \newunit\newblock \usebibmacro{setpageref}% \finentry} \endinput