summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-NWAFU.cbx
blob: a5f432ec91845ce5e35af9a71bce460abadfc0e7 (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
50
51
52
%%
%% ---------------------------------------------------------------
%% NWAFUthesis.cbx --- A bibliography style for NWAFUthesis template
%% ---------------------------------------------------------------
%%
\ProvidesFile{gb7714-NWAFU.cbx}[a biblatex citation style for NWAFUthesis]

%
%   加载样式
%
\RequireCitationStyle{gb7714-2015ay} %numeric

\ExecuteBibliographyOptions{
    maxcitenames=2,% 引用标注中最多显示2个作者
    mincitenames=1,% 3个及3个以上的作者截断为1个作者
}

\DeclareDelimFormat[textcite,cite,parencite,citet,citep]{nameyeardelim}{\addspace}


%之所以不用\DeclareDelimFormat{andothersdelim}{}这样的设置是因为gb7714-2015中为兼容老版本的biblatex做的处理就是这样的
%所以用相同的方式
\AtEveryCitekey{%
\iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{}}%\addthinspace
  {\renewcommand*{\andothersdelim}{\addspace}}%
}

%标注压缩时,直接用date+extradate代替extradate实现2006a,2006b的效果
\newbibmacro*{cite:extradate}{%
  \iffieldundef{extradate}
    {}
    {\printtext[bibhyperref]{\printlabeldateextra}}}%\printfield{extradate}


\renewbibmacro*{date+extradate}{%
    \iffieldundef{labelyear}
      {}%
      {\ifboolexpr{%
        test {\ifentrytype{patent}}
        or
        (test {\ifentrytype{newspaper}} )%
        }%
        {\printtext{\blx@isodate{}{}}
        %\printtext{\blx@edtfdate{}{}}%
        }%
        {\printtext{%
                 \iflabeldateisdate
                 %\iffieldsequal{year}{labelyear}%for biblatex<=3.7
                   {\printdateextra}
                   {\printlabeldateextra}}}%
      }%
}