summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-jura2/jura2.cbx
blob: 00f193c671377480d024e4bcf2b2bc43fc733ff7 (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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
\ProvidesFile{biblatex-jura2.cbx}[2020/08/19 v0.4]
% biblatex-jura2 is released under the LaTeX Project Public License v1.3c or later.

\RequireCitationStyle{ext-authortitle-ibid}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Globale Änderungen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Namen kursiv (außer bei commentary mit Option citedbytitle)
\renewcommand*{\mkbibnamefamily}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary}}%
    and
    test {\iftoggle{tnbcbx@citedbytitle}}%
    }%
  {#1}%
  {\mkbibemph{#1}}%
}

\renewcommand*{\mkbibnamegiven}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary}}%
    and
    test {\iftoggle{tnbcbx@citedbytitle}}%
    }%
  {#1}%
  {\mkbibemph{#1}}%
}

\renewcommand*{\mkbibnameprefix}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary}}%
    and
    test {\iftoggle{tnbcbx@citedbytitle}}%
    }%
  {#1}%
  {\mkbibemph{#1}}%
}

\renewcommand*{\mkbibnamesuffix}[1]{%
  \ifboolexpr{%
    test {\ifentrytype{commentary}}%
    and
    test {\iftoggle{tnbcbx@citedbytitle}}%
    }%
  {#1}%
  {\mkbibemph{#1}}%
}

%%%  Schrägstriche zwischen den Autoren außer bei commentary mit citedbytitle und dem Hrsg. bei incollection
% DeclareFieldFormat funktioniert nicht
\renewcommand*{\multinamedelim}{%
  \ifboolexpr{
    ( test {\ifentrytype{commentary}} and  test {\iftoggle{tnbcbx@citedbytitle}} )
    or
    ( test {\ifentrytype{incollection}} and test {\ifcurrentname{editor}} )
    }
    {\addcomma\space}%
    {\addslash}%
}

% \DeclareDelimAlias* funktioniert nicht
\renewcommand*{\finalnamedelim}{%
  \ifboolexpr{
    ( test {\ifentrytype{commentary}} and  test {\iftoggle{tnbcbx@citedbytitle}} )
    or
    ( test {\ifentrytype{incollection}} and test {\ifcurrentname{editor}} )
    }
    {\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
    \addspace%
    \ifboolexpr{ test {\ifentrytype{incollection}} and test {\ifcurrentname{editor}}} 
      {\mkbibemph{\bibstring{and}}}%
      {\bibstring{and}}%
    \space}%
    {\addslash}%
}

%%% ebd. kursiv
\renewcommand*{\mkibid}{\ifentrytype{jurisdiction}{}{\mkbibemph}}

%%% Keine Ausgabe des Verlags
\AtEveryCitekey{\clearlist{publisher}}

%%% Keine Ausgabe des Ortes
%\AtEveryCitekey{\clearlist{location}}

%%% Namen sortiert als Nachname, Vorname
\DeclareNameAlias{sortname}{family-given}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'book'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% 'title' nicht kursiv
\DeclareFieldFormat[book]{title}{\normalfont{#1}}
\DeclareFieldFormat[book]{citetitle}{\normalfont{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'article'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Weiche für verschiedene Zitate, siehe https://tex.stackexchange.com/q/466985/35864
\renewbibmacro*{cite:title}{%
  \ifbibmacroundef{cite:title:\strfield{entrytype}}
    {\printtext[extblx@inner\blx@delimcontext delims]{%
    \printtext[bibhyperref]{%
      \printfield[citetitle]{labeltitle}}}}%
    {\usebibmacro*{cite:title:\strfield{entrytype}}}}


\newbibmacro*{cite:title:article}{%
  \printtext[extblx@inner\blx@delimcontext delims]{%
    \printtext[bibhyperref]{%
      %NEU Option für Ausgabe des Titels des Artikels in der Fußnote
      %\printfield{title}%
      %\addcomma\addspace%
      %ENDE NEU
      \printfield{journaltitle}% 
      \addspace%
      \iffieldundef{volume}%
        {\printfield{year}}%
        {\printfield{volume}%
         \addspace%
         \mkbibparens{\printfield{year}}}%
      \addcomma\addspace%
      \printfield{pages}%
      %\nopunct%
    }}}%
  
%%% Bei Article kein "S. " für die konkrete Fundstelle, dafür in Klammern: 
\DeclareFieldFormat[article]{postnote}{\mkbibparens{#1}}   
% Option für < > 
%\DeclareFieldFormat[article]{postnote}{\textless#1\textgreater}   
% Option für einfache französische guillemets
%\DeclareFieldFormat[article]{postnote}{\mkfrenchopenquote{\guilsinglleft}#1\mkfrenchclosequote{\guilsinglright}}   


%%% Kein Komma vor postnote (auch bei jurisdiction)
\renewcommand*{\postnotedelim}{%
  \ifboolexpr{
    test {\ifentrytype{article}}%
    or
    test {\ifentrytype{jurisdiction}}
    }
  {\addspace}%
  {\addcomma\space}%
  }%

%%% Bei Article wird nur die erste Seite angegeben
% Besser: ein eigenes Feldformat für pages in Zitaten definieren und das dann nutzen. Z.B. 
% \DeclareFieldFormat[article]{pages:cite}{\mkfirstpage{#1}}
% das man dann mit \printfield[pages:cite]{pages} statt einem einfachen \printfield{pages} in den Definitionen für die Zitate nutzt.
\AtEveryCite{% 
  \DeclareFieldFormat[article]{pages}{\mkfirstpage{#1}}% 
}% 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'commentary'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% aus https://tex.stackexchange.com/a/95205/202233 und https://tex.stackexchange.com/a/430758/202233
\let\oldpostnotedelim\postnotedelim
\renewcommand*{\postnotedelim}{%  
  \ifentrytype{commentary}%
    {}%
    {\oldpostnotedelim}}% 

%\makeatletter
\newrobustcmd*{\mkpostnote}[1]{\mkpostnote@i#1&}

\def\mkpostnote@i{%
  \@ifnextchar(%)
    {\mkpostnote@ii}
    {\mkpostnote@ii()}}

\def\mkpostnote@ii(#1)#2&{%
  \ifblank{#1}{}{%
    \blx@getformat\cbx@postnote@prefix@fmt{ffd}{}{postnote:prefix}%
    \cbx@postnote@prefix@fmt{#1}}%
  \ifblank{#2}{}{%
    \blx@getformat\cbx@postnote@stem@fmt{ffd}{}{postnote:stem}%
    \cbx@postnote@stem@fmt{#2}}%
  }
\def\cbx@postnote@stem@fmt{}
\def\cbx@postnote@prefix@fmt{}
%\makeatother

\DeclareFieldFormat{postnote:stem}{\oldpostnotedelim\mkpageprefix[pagination][\mknormrange]{#1}}
\DeclareFieldFormat{postnote:prefix}{\addslash\mkbibemph{#1}}
\DeclareFieldFormat{postnote}{\mkpostnote{#1}}

%%% Punkt nach 'postnote'
%\DeclareFieldFormat[commentary]{postnote}{\mknormrange{#1}\adddot}
%\DeclareFieldFormat[commentary]{multipostnote}{\mknormrange{#1}\adddot}

%%% Kursive Schrift für Bearbeiter von Kommentaren und "in: "
\DeclareFieldFormat[commentary]{prenote}{\mkbibemph{#1}\space\bibstring{kommentarin}}%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'incollection'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Titel ohne Anführungszeichen 
\DeclareFieldFormat[incollection]{citetitle}{\normalfont{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'online' und andere
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareFieldFormat[online]{citetitle}{\normalfont{#1}}

\DeclareFieldFormat[misc]{citetitle}{\normalfont{#1}}

\DeclareFieldFormat[report]{citetitle}{\normalfont{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen betr. 'jurisdiction'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtoggle{tnbcbx@citedbypage}
\DeclareEntryOption[boolean]{citedbypage}[true]{\settoggle{tnbcbx@citedbypage}{#1}}
\DeclareBibliographyOption[boolean]{citedbypage}[true]{\settoggle{tnbcbx@citedbypage}{#1}}
\DeclareTypeOption[boolean]{citedbypage}[true]{\settoggle{tnbcbx@citedbypage}{#1}}

\newbibmacro*{cite:title:jurisdiction}{%
  \printtext[extblx@inner\blx@delimcontext delims]{%
    \printtext[bibhyperref]{%
      {\printlist{institution}\addcomma\addspace%
       \printfield{usera}\addspace%
       \printtext{vom}\addspace%
       \usebibmacro{date}%
       \addspace\textendash\addspace%
       \printfield{userb}%
       % Entfernen für Verwendung der ECLI
       %\iffieldundef{usere}{}{\addspace\mkbibbrackets{\printfield{usere}}}%
       \iffieldundef{userf}{}{\addcomma\addspace\printfield{userf}}%
       \addspace\textendash%
       \iffieldundef{userc}{}{\addspace\printfield{userc}}%
       \iffieldundef{userd}{}{\addspace\printfield{userd}}%
    }}}}%

\DeclareFieldFormat[jurisdiction]{author}{#1}
\DeclareFieldFormat[jurisdiction]{citetitle}{\normalfont{#1}}

\DeclareFieldFormat[jurisdiction]{postnote}{\iftoggle{tnbcbx@citedbypage}{\mkbibparens{#1}}{#1}}
% Option für < >
%\DeclareFieldFormat[jurisdiction]{postnote}{\iftoggle{tnbcbx@citedbypage}{\textless#1\textgreater}{#1}}
% Option für französische guillemets
%\DeclareFieldFormat[jurisdiction]{postnote}{\iftoggle{tnbcbx@citedbypage}{\mkfrenchopenquote{\guilsinglleft}#1\mkfrenchclosequote{\guilsinglright}}{#1}}



\endinput