forked from zousiyu1995/Study-LaTeX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gb7714-2015.cbx
75 lines (67 loc) · 2.1 KB
/
gb7714-2015.cbx
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%%
%% ---------------------------------------------------------------
%% biblatex-gb7714-2015 --- A biblatex implementation of the
%% GBT7714-2015 citation style,numerical sequence
%% Maintained by huzhenzhen
%% history:
%% 2016/05/20 v1.0
%% 2016/10/23 v1.0a
%% 2016/11/11 v1.0b
%% 2016/11/14 v1.0c
%% 2016/11/24 v1.0d
%% 2016/12/07 v1.0e
%% E-mail: [email protected]
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
\ProvidesFile{gb7714-2015.cbx}[2016/12/07 v1.0e biblatex citation style]
\RequireCitationStyle{numeric-comp}
%\RequireCitationStyle{numeric}
\ExecuteBibliographyOptions{
autocite = superscript ,
autopunct = true ,
sorting = none ,
}
%\DeclareCiteCommand{\cite}[\mkbibparens]{⟨precode⟩}{⟨loopcode⟩}{⟨sepcode⟩}{⟨postcode⟩}
%
\DeclareCiteCommand{\cite}[\mkbibsuperscript]
{[\usebibmacro{cite:init}%直接添加方括号
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}]}
\DeclareCiteCommand{\parencite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
{[\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}]}
\newbibmacro*{postpages}{%
\iffieldundef{postnote}
{\printfield{pages}}
{\printfield{postnote}}}
%修改括号外带页码的引用格式
\DeclareFieldFormat{postnote}{#1}
\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
{[\usebibmacro{cite:init}%
\usebibmacro{prenote}%
}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}]%
\usebibmacro{postpages}}
%增加一个命令yearpagescite为与ay样式兼容,命令等同于\pagescite
\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
{[\usebibmacro{cite:init}%
\usebibmacro{prenote}%
}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}]%
\usebibmacro{postpages}}