summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/bbx/authoryear.bbx
blob: 5429cf55f803d9f686a43354f2981b8d92b9cfc9 (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
% $Id: authoryear.bbx,v 0.9 2010/02/14 15:42:33 lehman beta $

\ProvidesFile{authoryear.bbx}
[\abx@bbxid $Id: authoryear.bbx,v 0.9 2010/02/14 15:42:33 lehman beta $]

\RequireBibliographyStyle{standard}
\ExecuteBibliographyOptions{labelyear,sorting=nyt,pagetracker}

\DeclareBibliographyOption{dashed}[true]{%
  \ifstrequal{#1}{true}
    {\ExecuteBibliographyOptions{pagetracker}%
     \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}}
    {\ExecuteBibliographyOptions{pagetracker=false}%
     \renewbibmacro*{bbx:savehash}{}}}

\DeclareFieldFormat{shorthandwidth}{#1}
\renewcommand*{\thebibitem}{\item}
\renewcommand*{\thelositem}{\item}
\setlength{\bibitemsep}{0pt}

\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

\renewenvironment*{thebibliography}
  {\list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}

\renewenvironment*{theshorthands}
  {\list
     {\printfield[shorthandwidth]{shorthand}}
     {\setlength{\labelwidth}{\shorthandwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}%
      \renewcommand*{\makelabel}[1]{##1\hss}}}
  {\endlist}

\InitializeBibliographyStyle{%
  \global\undef\bbx@lasthash}

\newbibmacro*{bbx:savehash}{%
  \savefield{fullhash}{\bbx@lasthash}}

\newbool{bbx@inset}
\DeclareBibliographyDriver{set}{%
  \booltrue{bbx@inset}%
  \entryset{}{}%
  \finentry}

\renewbibmacro*{author}{%
  \ifthenelse{\ifuseauthor\AND\NOT\ifnameundef{author}}
    {\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND
                 \NOT\iffirstonpage\AND
		 \(\NOT\boolean{bbx@inset}\OR
		   \iffieldequalstr{entrysetcount}{1}\)}
       {\bibnamedash}
       {\usebibmacro{bbx:savehash}%
        \printnames{author}%
	\iffieldundef{authortype}
	  {\setunit{\addspace}}
	  {\setunit{\addcomma\space}}}%
     \iffieldundef{authortype}
       {}
       {\usebibmacro{authorstrg}%
	\setunit{\addspace}}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addspace}}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{editor}{%
  \usebibmacro{bbx:editor}{editorstrg}}
\renewbibmacro*{editor+others}{%
  \usebibmacro{bbx:editor}{editor+othersstrg}}
\newbibmacro*{bbx:editor}[1]{%
  \ifthenelse{\ifuseeditor\AND\NOT\ifnameundef{editor}}
    {\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND
                 \NOT\iffirstonpage\AND
		 \(\NOT\boolean{bbx@inset}\OR
		   \iffieldequalstr{entrysetcount}{1}\)}
       {\bibnamedash}
       {\printnames{editor}%
	\setunit{\addcomma\space}%
	\usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \setunit{\addspace}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addspace}}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{translator}{%
  \usebibmacro{bbx:translator}{translatorstrg}}
\renewbibmacro*{translator+others}{%
  \usebibmacro{bbx:translator}{translator+othersstrg}}
\newbibmacro*{bbx:translator}[1]{%
  \ifthenelse{\ifusetranslator\AND\NOT\ifnameundef{translator}}
    {\ifthenelse{\iffieldequals{fullhash}{\bbx@lasthash}\AND
                 \NOT\iffirstonpage\AND
		 \(\NOT\boolean{bbx@inset}\OR
		   \iffieldequalstr{entrysetcount}{1}\)}
       {\bibnamedash}
       {\printnames{translator}%
	\setunit{\addcomma\space}%
	\usebibmacro{bbx:savehash}}%
     \usebibmacro{translator+othersstrg}%
     \clearname{translator}%
     \setunit{\addspace}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\addspace}}%
  \usebibmacro{date+extrayear}}

\newbibmacro*{date+extrayear}{%
  \iffieldundef{year}
    {}
    {\printtext[parens]{\printdateextra}}}

\newbibmacro*{labeltitle}{%
  \iffieldundef{label}
    {\iffieldundef{shorttitle}
       {\printfield{title}%
        \clearfield{title}}
       {\printfield[title]{shorttitle}}}
    {\printfield{label}}}

\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \setunit*{\addcolon\space}%
  \printlist{publisher}%
  \newunit}

\renewbibmacro*{institution+location+date}{%
  \printlist{location}%
  \setunit*{\addcolon\space}%
  \printlist{institution}%
  \newunit}

\renewbibmacro*{organization+location+date}{%
  \printlist{location}%
  \setunit*{\addcolon\space}%
  \printlist{organization}%
  \newunit}

\renewbibmacro*{location+date}{%
  \printlist{location}}

\renewbibmacro*{issue+date}{%
  \iffieldundef{issue}
    {}
    {\printtext[parens]{\printfield{issue}}}%
  \newunit}

\renewbibmacro*{date}{}

\endinput