-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnd.cbx
56 lines (47 loc) · 1.5 KB
/
nd.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
\ProvidesFile{nd.cbx}
\newbibmacro{authors}{%
\ifnameundef{translator}{\printnames{labelname}}%
{\printnames[default]{translator}〔譯〕}%
}
\newbibmacro{citea}{%
\ifnameundef{translator}{\printnames{labelname}}%
{\printnames[default]{translator}(譯)}%
}
% 根據文獻輸出作者、全半形逗號、年份,也就是:作者,年份和作者, 年份
\DeclareCiteCommand{\citeay}
{}
{\usebibmacro{authors}\cecomma\printfield[bibhyperref]{year}}
{\multicitedelim}
{}
% 根據文獻輸出帶括號的年份,不過英文文獻如果用了中文名就會錯了,這時候還是用\citeyear比較好
\DeclareCiteCommand{\ycite}
{\cegen{}{\addspace}\celbracket}
{\printfield[bibhyperref]{year}}
{\multicitedelim}
{\cerbracket}
% 僅年份
\DeclareCiteCommand{\citeyear}
{}
{\printfield[bibhyperref]{year}}
{\multicitedelim}
{}
% 僅作者
\DeclareCiteCommand{\citeauthor}
{}
{\usebibmacro{authors}}
{\multicitedelim}
{}
% 不在括號內的譯者使用圓括號(囉嗦)
\DeclareCiteCommand{\citea}
{}
{\usebibmacro{citea}}
{\multicitedelim}
{}
\DeclareCiteCommand{\ayp}
{}
{\usebibmacro{authors}\cecomma\printfield[bibhyperref]{year}\cecolon}
{\multicitedelim}
{}
\renewcommand{\cite}[1]{(\citeay{#1})} % (作者,年份)和(作者, 年份)
\newcommand{\pcite}[2]{(\ayp{#1}{#2})} % (作者,年份:頁碼)和(作者, 年份: 頁碼)
\newcommand{\citep}[2]{\ayp{#1}{#2}} % 作者,年份:頁碼和作者, 年份: 頁碼