summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-philosophy/philosophy-modern.bbx
blob: 37d743565c0ea05353e426139c12d8fe8c799867 (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
% $Id: philosophy-modern.bbx,v 0.6 2010/03/23 Valbusa$
%	Copyright 2009-2010 Ivan Valbusa. This package is author-maintained. 
%	Permission is granted to copy, distribute and/or modify this software under the 
%	terms of the LaTeX Project Public License, version 1.3c 
%	http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt.


\ProvidesFile{philosophy-modern.bbx}[philosophy-modern.bbx,v 0.6 2010/03/23 valbusa beta$]

\RequireBibliographyStyle{philosophy-classic}

\newbool{bbx:yearleft}
\DeclareBibliographyOption{yearleft}[true]{%
  \csuse{bool#1}{bbx:yearleft}}

\ExecuteBibliographyOptions{%
yearleft=false}  
  
%%---------------------------------------------------------------------------------------------
%% 						new lengths
%%---------------------------------------------------------------------------------------------


\newlength{\yeartitle}		
\newlength{\postnamesep}
\setlength{\yeartitle}{0.8em}%		
\setlength{\postnamesep}{0.5ex plus 2pt minus 1pt}
\setlength{\bibitemsep}{\postnamesep}
\setlength{\bibnamesep}{1.5ex plus 2pt minus 1pt}
\setlength{\bibhang}{4\parindent}


%%---------------------------------------------------------------------------------------------
%% 						new commands
%%---------------------------------------------------------------------------------------------

\newcommand{\postsep}{\par\nobreak\vskip\postnamesep\hskip-\bibhang\ignorespaces}

\renewcommand{\labelnamepunct}{\unspace}

%%---------------------------------------------------------------------------------------------
%						List of shorthands
%%---------------------------------------------------------------------------------------------

\AtBeginBibliography{
	\ifbool{bbx:yearleft}{%
		\setlength{\yeartitle}{\fill}}
		{}%
		}

\AtBeginShorthands{%
	\renewcommand{\postsep}{}
	\renewcommand{\labelnamepunct}{\addcomma\space}}


%%---------------------------------------------------------------------------------------------    
%						Macro  
%%---------------------------------------------------------------------------------------------    

\renewbibmacro*{date+extrayear}{%
	\iffieldundef{year}%
    	{}%
	{\makebox[\bibhang][r]{%
		\printtext{\printfield{labelyear}\printfield{extrayear}%
		\hskip\yeartitle}}}}

%		label for entries without 'editor' and 'author'
%%-------------------------------------------------------------
\renewbibmacro*{labeltitle}{%
  \iffieldundef{label}%
	{\iffieldundef{shorttitle}
     		{\printfield{title}%
       		\clearfield{title}}
        		{\printfield[title]{shorttitle}}}
	{\printtext{\printfield{label}}%
	\postsep}}
	
%	 		 macro 'author' OKKKKK
%%----------------------------------------------------
\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}\)}
       {}%MOD
       {\usebibmacro{bbx:savehash}%
        \printnames{author}%
	\postsep%ADD
	\iffieldundef{authortype}
	  {\setunit{\addspace}}
	  {\setunit{\addcomma\space}}}%
     \iffieldundef{authortype}
       {}
       {\usebibmacro{authorstrg}%
	\setunit{\addspace}}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
          \setunit*{\addspace}}%
  \usebibmacro{date+extrayear}}

  
%		  macro 'editor' 
%%----------------------------------------------------
\renewbibmacro*{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}\)}
       {}% removed \bibnamedash
       {\printnames{editor}%
	\postsep%ADD
	\usebibmacro{bbx:savehash}}%
	\clearname{editor}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}}%
  \usebibmacro{date+extrayear}%
      \iffieldundef{label}
      {\usebibmacro{#1}\setunit{\addcomma\space}}{}%
  }

%%---------------------------------------------------------------------------------------------    
%					BIBLIOGRAPHY DRIVERS  
%%---------------------------------------------------------------------------------------------

\DeclareBibliographyDriver{collection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{editor+others}%
  \ifuseeditor{% trick for entry with ``label'' field
  \setunit{\addcomma\space}}
  {}\newblock
  \usebibmacro{maintitle+title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \iffieldundef{maintitle}
    {\printfield{volume}%
     \printfield{part}}
    {}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \newunit\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}

\endinput