diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx | 94 |
1 files changed, 77 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx b/Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx index a7a84cb7bc2..6a8da0a12d4 100644 --- a/Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx @@ -1,41 +1,101 @@ -\ProvidesFile{iso-authoryear.bbx}[2017/04/25 v0.3.2 biblatex bibliography style] +\ProvidesFile{iso-authoryear.bbx} + [2020/03/25 v0.4.0 ISO 690 biblatex bibliography style] \RequireBibliographyStyle{iso} \ExecuteBibliographyOptions{% - sorting=nyt + sorting=nyt, } -\def\printextrayear{% - \ifentrytype{patent} - {} - {\printfield{year}\printfield{extradate}}% +% 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 +% Remove second appearance of year in a reference \renewbibmacro*{date}{}% -% overwrite names:primary to print year right after +% 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) +% 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}}% - {\usebibmacro{editor}}% - \setunit{\addspace}\printfield{nameaddon}% - \setunit{\addcomma\space}\printextrayear% + {\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}% } -\InitializeBibliographyStyle{\global\undef\bbx@lasthash} +% 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}}} -\newbibmacro*{bbx:savehash}{% - \savefield{fullhash}{\bbx@lasthash}} \newbool{bbx@inset} \DeclareBibliographyDriver{set}{% |