summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-iso690/iso-authoryear.bbx
blob: a7a84cb7bc2307c20835b81711fb31c51d1cd930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\ProvidesFile{iso-authoryear.bbx}[2017/04/25 v0.3.2 biblatex bibliography style]

\RequireBibliographyStyle{iso}
\ExecuteBibliographyOptions{%
  sorting=nyt
}

\def\printextrayear{%
  \ifentrytype{patent}
    {}
    {\printfield{year}\printfield{extradate}}%
}

% 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)
\renewbibmacro*{names:primary}{%
  \ifboolexpr{
    test \ifuseauthor
    and
    not test {\ifnameundef{author}}
  }
    {\usebibmacro{author}}%
    {\usebibmacro{editor}}%
  \setunit{\addspace}\printfield{nameaddon}%
  \setunit{\addcomma\space}\printextrayear%
}

\InitializeBibliographyStyle{\global\undef\bbx@lasthash}

\newbibmacro*{bbx:savehash}{%
  \savefield{fullhash}{\bbx@lasthash}}

\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
  \booltrue{bbx@inset}%
  \entryset{}{}%
  \newunit\newblock
  \usebibmacro{setpageref}%
  \finentry}


\endinput