summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-verbose.cbx
blob: 208ef6819437754e0e7214bec160ae074ce93f5d (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
%%
%% This is file `philosophy-verbose.cbx',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% biblatex-philosophy.dtx  (with options: `verbose-cbx')
%%   ______________________________________________________
%%   The biblatex-philosophy package
%%   Copyright (C) 2009-2014 Ivan Valbusa
%%   All rights reserved
%% 
%%   License information appended
%% 
\ProvidesFile{philosophy-verbose.cbx}
    [2015/01/14 v0.9h valbusa beta]

\RequireCitationStyle{verbose-trad2}

\newtoggle{cbx:scauthorscite}
\newtoggle{cbx:latinemph}
\newtoggle{cbx:commacit}

\DeclareBibliographyOption{scauthorscite}[true]{%
  \settoggle{cbx:scauthorscite}{#1}}
\DeclareBibliographyOption{latinemph}[true]{%
  \settoggle{cbx:latinemph}{#1}}
\DeclareBibliographyOption{commacit}[true]{%
  \settoggle{cbx:commacit}{#1}}

\ExecuteBibliographyOptions{%
  idemtracker=false,
  loccittracker=strict,
  scauthorscite=false,
  latinemph=false,
  commacit=false}

\AtEveryCite{%
\togglefalse{bbx:annotation}%
\iftoggle{cbx:latinemph}{\renewcommand*{\mkibid}{\emph}}{}%
\renewbibmacro*{name:andothers}{%
  \ifboolexpr{%
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
    and
    test \ifmorenames
  }%
    {\ifnumgreater{\value{liststop}}{1}%
       {\finalandcomma}%
       {}%
     \andothersdelim\bibstring[\mkibid]{andothers}}%
    {}}%
\renewbibmacro*{list:andothers}{%
  \ifboolexpr{%
    test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
    and
    test \ifmoreitems
  }%
    {\ifnumgreater{\value{liststop}}{1}%
       {\finalandcomma}%
       {}%
     \andmoredelim\bibstring[\mkibid]{andmore}}%
    {}}%
\iftoggle{cbx:scauthorscite}{%
\DeclareNameFormat{labelname}{%
   \let\mkbibnamelast\mkbibsc%
   \let\mkbibnamefirst\mkbibsc%
   \let\mkbibnameprefix\mkbibsc%
   \let\mkbibnameaffix\mkbibsc
  \ifcase\value{uniquename}%
    \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
  \or
    \ifuseprefix
      {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}%
      {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
  \or
    \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
  \fi
  \usebibmacro{name:andothers}}}{}}%

\DeclareNameFormat{scdefault}{%
   \let\mkbibnamelast\mkbibsc%
   \let\mkbibnamefirst\mkbibsc%
   \let\mkbibnameprefix\mkbibsc%
   \let\mkbibnameaffix\mkbibsc
  \iffirstinits
    {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}%
    {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}%
  \usebibmacro{name:andothers}}
\newbibmacro*{cite:opcit}{%
  \printtext[bibhyperlink]{\bibstring[\mkibid]{opcit}}}

\newbibmacro*{cite:loccit}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \bibstring[\mkibid]{loccit}}}%
  \global\toggletrue{cbx:loccit}}

\renewbibmacro*{cite:ibid}{%
 \ifloccit
   {\usebibmacro{cite:loccit}}{%
  \printtext{%
    \bibhyperlink{cite\csuse{cbx@lastcite@\thefield{entrykey}}}{%
      \bibstring[\mkibid]{ibidem}}}}}%

\renewbibmacro*{cite:title}{%OK
 \ifsingletitle{\usebibmacro{cite:opcit}}{%
  \printtext[bibhyperlink]{%
    \printfield[citetitle]{labeltitle}%
    \iftoggle{cbx:commacit}{\setunit{\addcomma\space}}%
    {\setunit{\addspace\midsentence}}}%
      \bibstring{cited}}}

 \renewbibmacro*{cite:full}{%OK
  \usebibmacro{cite:full:citepages}%
  \global\toggletrue{cbx:fullcite}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\iftoggle{cbx:scauthorscite}{%
      \DeclareNameAlias{sortname}{scdefault}}%
      {\DeclareNameAlias{sortname}{default}}}%
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\renewbibmacro*{cite:idem}{%
\iftoggle{cbx:scauthorscite}{%
  \bibstring[\mkbibsc]{idem\thefield{gender}}}{%
  \bibstring[\mkibid]{idem\thefield{gender}}}%
  \setunit{\nametitledelim}}

\newbibmacro*{ccite:cite}{%
\usebibmacro{related:clearauthors}%
  \usebibmacro{cite:citepages}%
  \global\togglefalse{cbx:fullcite}%
  \global\togglefalse{cbx:loccit}%
  \bibhypertarget{cite\the\value{instcount}}{%
    \ifciteseen
      {\iffieldundef{shorthand}
         {\usebibmacro{cite:title}%
  \usebibmacro{cite:save}}
         {\usebibmacro{cite:shorthand}}}
      {\usebibmacro{cite:full}%
       \usebibmacro{cite:save}}}}
\DeclareCiteCommand{\ccite}
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
   \usebibmacro{ccite:cite}}
{\multicitedelim}
{\usebibmacro{cite:postnote}}
\DeclareCiteCommand{\fullcite}
  {\usebibmacro{prenote}}
  {\usedriver
     {\iftoggle{cbx:scauthorscite}%
       {\DeclareNameAlias{sortname}{scdefault}}%
       {\DeclareNameAlias{sortname}{default}}}%
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
%% 
%%  Copyright 2009-2014 by Ivan Valbusa
%% 
%%  This program is provided under the terms of the
%%  LaTeX Project Public License distributed from CTAN
%%  archives in directory macros/latex/base/lppl.txt.
%% 
%%  Author: Ivan Valbusa
%%          ivan dot valbusa at univr dot it
%% 
%%  This work has the LPPL maintenance status "author-maintained".
%% 
%%
%% End of file `philosophy-verbose.cbx'.