-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjapuzkbib.cbx
166 lines (166 loc) · 5.87 KB
/
japuzkbib.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
\ProvidesFile{japuzkbib.cbx}%
[2020/08/15 v0.1 japuzkbib -- %
biblatex für Japanologen, cbx-Datei]%
\ExecuteBibliographyOptions{%
citetracker=true,%
idemtracker=true,%
ibidtracker=true,%
opcittracker=false,%
loccittracker=false,%
sortcites=false%
}%
\newbool{cbx:seen}%
\newbool{cbx:mitjahr}%
\newbool{cbx:mitvn}%
\newbool{cbx:mits}%
\newbool{cbx:fnverweise}%
\newbool{cbx:jahrkeineklammern}%
\newbool{cbx:neueseitevollzitat}%
\DeclareBibliographyOption{mitjahr}[true]{\csuse{bool#1}%
{cbx:mitjahr}}%
\DeclareBibliographyOption{mitvn}[true]{\csuse{bool#1}%
{cbx:mitvn}}%
\DeclareBibliographyOption{mits}[true]{\csuse{bool#1}{cbx:mits}}%
\DeclareBibliographyOption{fnverweise}[true]{\csuse{bool#1}%
{cbx:fnverweise}}%
\newbool{cbx:ibidpages}%
\DeclareBibliographyOption{ibidpages}[true]{\csuse{bool#1}%
{cbx:ibidpages}}%
\DeclareBibliographyOption{jahrkeineklammern}[true]{\csuse{bool#1}%
{cbx:jahrkeineklammern}}%
\DeclareBibliographyOption{neueseitevollzitat}[true]{\csuse{bool#1}%
{cbx:neueseitevollzitat}}%
\newbool{cbx:nurinit}%
\DeclareBibliographyOption{citeinit}[true]{\csuse{bool#1}%
{cbx:nurinit}}%
\AtBeginDocument{\ifbool{bbx:nurinit}%
{\global\booltrue{cbx:nurinit}}{}}%
\newbool{cbx:ebd}
\global\booltrue{cbx:ebd}
\newbool{cbx:endpunkt}
\global\booltrue{cbx:endpunkt}
\ExecuteBibliographyOptions{citeinit,mitjahr,neueseitevollzitat}%
\DeclareFieldFormat{prenote}{#1\isdot}%
\DeclareFieldFormat{postnote}{#1}%
\DeclareFieldFormat{shorttitle}{#1}%
\renewcommand*{\multicitedelim}{\setunit{\addsemicolon\addspace}}%
\newcommand*{\citeautorenschriftart}{\scshape}%
\newcommand*{\citeautorentrennzeichen}%
{\addcomma\addspace}%
\DeclareNameFormat{cite:author}{%
\nameparts{#1}%
{\citeautorenschriftart%
\ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}%
\namepartfamily}%
\ifbool{cbx:mitvn}{%
\ifdefvoid{\namepartgiven}{}{\addcomma\space%
\ifbool{cbx:nurinit}{\namepartgiveni}{\namepartgiven}}}{%
\ifbool{cbx:nurinit}{\addcomma\addspace\namepartgiveni}{}%
}%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\citeautorentrennzeichen}{}%
\isdot%
}%
\renewbibmacro*{prenote}{%
\iffieldundef{prenote}{}%
{\printfield{prenote}%
\setunit{\addspace}}}%
\renewbibmacro*{postnote}{%
\setunit{\printdelim{postnotedelim}}%
\iffieldundef{postnote}{}%
{\ifboolexpr{not bool{cbx:seen}%
and not test {\iffieldundef{pages}}}%
{\printtext{hier}\addspace}{}%
\ifboolexpr{test {\iffieldequals{postnote}{\cbx@lastpagenumber}}%
and test {\iffieldequals{entrykey}{\cbx@lastentrykey}}%
and not (bool{cbx:neueseitevollzitat} and test {\iffirstonpage})%
and not bool{cbx:ibidpages}}{}{%
\ifbool{cbx:mits}{\printtext{S\adddot\addspace}}{}%
\printfield{postnote}%
}%
}%
\ifbool{cbx:endpunkt}{\setunit{\addperiod}}{}%
\savefield{postnote}{\cbx@lastpagenumber}%
\savefield{entrykey}{\cbx@lastentrykey}%
}%
\newbibmacro*{cite:name}{%
\ifnameundef{author}{%
\ifnameundef{editor}{}{%
\printnames[cite:author]{editor}}%
}{%
\printnames[cite:author]{author}%
}}%
\newbibmacro*{cite:title}{%
\iffieldundef{shorttitle}{%
\usebibmacro{title}%
}{\printfield{shorttitle}}%
}%
\newbibmacro*{fnverweis}{%
\ifbool{cbx:fnverweise}{%
\setunit{\addspace}%
\printtext[parens]{wie Anm\adddot\addspace%
\ref{footref:\thefield{entrykey}}}}%
}%
\newbibmacro*{cite:year}{%
\ifbool{cbx:jahrkeineklammern}%
{\printfield{year}}%
{\printfield[parens]{year}}}%
\newbibmacro*{cite:short}{%
\ifboolexpr{test \ifciteibid and bool{cbx:ebd}%
not (bool{cbx:neueseitevollzitat} and%
test {\iffirstonpage})}%
{\bibstring{ibidem}\isdot}%
{\ifbool{cbx:nurshorthand}%
{\printfield{shorthand}}%
{\ifboolexpr{test \ifciteidem and not%
(bool{cbx:neueseitevollzitat} and%
test {\iffirstonpage})}%
{\bibnamedash}%
{\usebibmacro{cite:name}}%
\setunit{\addcolon\addspace}%
\usebibmacro{cite:title}%
\ifbool{cbx:mitjahr}{\setunit{\addspace}%
\usebibmacro{cite:year}}{}}%
\usebibmacro{fnverweis}}%
}%
\newbibmacro*{cite}{%
\ifciteseen{\bibhyperlink{ref:\thefield{entrykey}}{%
\usebibmacro{cite:short}}}%
{\bibhypertarget{ref:\thefield{entrykey}}{%
\bibhyperref{\usedriver{}{\thefield{entrytype}}}%
\iffootnote{\label{footref:\thefield{entrykey}}}{}%
}}%
\ifciteseen{\global\booltrue{cbx:seen}}%
{\global\boolfalse{cbx:seen}}%
\usebibmacro{savestuff}%
}%
\DeclareCiteCommand{\cite}[\mkbibfootnote]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}\usebibmacro{cite}}%
{\multicitedelim}%
{\usebibmacro{postnote}}%
\DeclareCiteCommand{\parencite}[\mkbibparens]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}\usebibmacro{cite}}%
{\multicitedelim}%
{\usebibmacro{postnote}}%
\DeclareCiteCommand{\footcite}[\mkbibfootnote]%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}\usebibmacro{cite}}%
{\multicitedelim}%
{\usebibmacro{postnote}}%
\DeclareCiteCommand{\textcite}%
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}\usebibmacro{cite}}%
{\multicitedelim}%
{\usebibmacro{postnote}%
\ifnum\themulticitetotal=\themulticitecount\ifbool{cbx:endpunkt}{\finentry}{}\fi%
\ifnum\thecitetotal=\thecitecount\ifbool{cbx:endpunkt}{\finentry}{}\fi}%
\DeclareMultiCiteCommand{\cites}[\mkbibfootnote]{\cite}%
{\multicitedelim}%
\DeclareMultiCiteCommand{\parencites}[\mkbibparens]{\parencite}%
{\multicitedelim}%
\DeclareMultiCiteCommand{\footcites}[\mkbibfootnote]{\footcite}%
{\multicitedelim}%
\DeclareMultiCiteCommand{\textcites}{\textcite}{\multicitedelim}%
\endinput