| 1 |
%% email.bst |
| 2 |
%% Copyright 1998-2003 Christophe Geuzaine <[email protected]> |
| 3 |
% |
| 4 |
% $Id: email.bst,v 1.6 2003/09/14 09:47:49 geuzaine Exp $ |
| 5 |
% |
| 6 |
% This program can be redistributed and/or modified under the terms |
| 7 |
% of the LaTeX Project Public License distributed from CTAN |
| 8 |
% archives in directory macros/latex/base/lppl.txt; either |
| 9 |
% version 1 of the License, or (at your option) any later version. |
| 10 |
% |
| 11 |
% BibTeX bibliography style `email.bst' |
| 12 |
% 'directory' database: only email field |
| 13 |
% |
| 14 |
% The parts you may want to customize are labeled with "CUSTOM" |
| 15 |
% |
| 16 |
|
| 17 |
INTEGERS { nameptr namesleft numnames numaux len } |
| 18 |
STRINGS { s t u v } |
| 19 |
|
| 20 |
% ------------------------------------------------------------ |
| 21 |
% E N T R I E S |
| 22 |
% ------------------------------------------------------------ |
| 23 |
|
| 24 |
ENTRY |
| 25 |
{ name |
| 26 |
email |
| 27 |
p.email |
| 28 |
r.email |
| 29 |
w.email |
| 30 |
} |
| 31 |
{} |
| 32 |
{} |
| 33 |
|
| 34 |
% ------------------------------------------------------------ |
| 35 |
% G E N E R A L |
| 36 |
% ------------------------------------------------------------ |
| 37 |
|
| 38 |
FUNCTION {output} |
| 39 |
{ 's := |
| 40 |
s empty$ |
| 41 |
{} |
| 42 |
{ s write$ |
| 43 |
newline$ |
| 44 |
"\dirblock" write$ |
| 45 |
newline$ |
| 46 |
} |
| 47 |
if$ |
| 48 |
} |
| 49 |
|
| 50 |
FUNCTION {output.flag} |
| 51 |
{ 's := |
| 52 |
s empty$ |
| 53 |
{} |
| 54 |
{ s write$ |
| 55 |
newline$ |
| 56 |
} |
| 57 |
if$ |
| 58 |
} |
| 59 |
|
| 60 |
FUNCTION {not} |
| 61 |
{ { #0 } |
| 62 |
{ #1 } |
| 63 |
if$ |
| 64 |
} |
| 65 |
|
| 66 |
FUNCTION {and} |
| 67 |
{ 'skip$ |
| 68 |
{ pop$ #0 } |
| 69 |
if$ |
| 70 |
} |
| 71 |
|
| 72 |
FUNCTION {or} |
| 73 |
{ { pop$ #1 } |
| 74 |
'skip$ |
| 75 |
if$ |
| 76 |
} |
| 77 |
|
| 78 |
FUNCTION {chop.word} |
| 79 |
{ 's := |
| 80 |
'len := |
| 81 |
s #1 len substring$ = |
| 82 |
{ s len #1 + global.max$ substring$ } |
| 83 |
's |
| 84 |
if$ |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
% ------------------------------------------------------------ |
| 89 |
% S O R T I N G F U N C T I O N S |
| 90 |
% ------------------------------------------------------------ |
| 91 |
|
| 92 |
FUNCTION {sortify} |
| 93 |
{ purify$ |
| 94 |
"l" change.case$ |
| 95 |
} |
| 96 |
|
| 97 |
FUNCTION {sort.names} |
| 98 |
{ 's := |
| 99 |
#1 'nameptr := |
| 100 |
"" |
| 101 |
s num.names$ 'numnames := |
| 102 |
numnames 'namesleft := |
| 103 |
{ namesleft #0 > } |
| 104 |
{ nameptr #1 > |
| 105 |
{ " " * } |
| 106 |
'skip$ |
| 107 |
if$ |
| 108 |
s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := |
| 109 |
nameptr numnames = t "others" = and |
| 110 |
{ "et al" * } |
| 111 |
{ t sortify * } |
| 112 |
if$ |
| 113 |
nameptr #1 + 'nameptr := |
| 114 |
namesleft #1 - 'namesleft := |
| 115 |
} |
| 116 |
while$ |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
FUNCTION {sort.raw.names} |
| 121 |
{ 't := |
| 122 |
"A " #2 "L'" #2 |
| 123 |
"An " #3 "Au " #3 "Le " #3 "La " #3 |
| 124 |
"The " #4 "Les " #4 "Aux " #4 |
| 125 |
t |
| 126 |
chop.word chop.word |
| 127 |
chop.word chop.word chop.word chop.word |
| 128 |
chop.word chop.word chop.word |
| 129 |
sortify |
| 130 |
#1 global.max$ substring$ |
| 131 |
} |
| 132 |
|
| 133 |
FUNCTION {name.sort} |
| 134 |
{ name empty$ |
| 135 |
{ " Name field missing in entry '" cite$ * "'" * warning$ "" } |
| 136 |
{ name sort.names } |
| 137 |
if$ |
| 138 |
} |
| 139 |
|
| 140 |
FUNCTION {raw.name.sort} |
| 141 |
{ name empty$ |
| 142 |
{ " Name field missing in entry '" cite$ * "'" * warning$ "" } |
| 143 |
{ name sort.raw.names } |
| 144 |
if$ |
| 145 |
} |
| 146 |
|
| 147 |
FUNCTION {presort} |
| 148 |
{ type$ "company" = |
| 149 |
type$ "place" = |
| 150 |
or |
| 151 |
{ raw.name.sort } |
| 152 |
{ name.sort } |
| 153 |
if$ |
| 154 |
" " |
| 155 |
* |
| 156 |
#1 entry.max$ substring$ |
| 157 |
'sort.key$ := |
| 158 |
} |
| 159 |
|
| 160 |
FUNCTION {format.first.letter} |
| 161 |
{ type$ "company" = |
| 162 |
type$ "place" = |
| 163 |
or |
| 164 |
{ raw.name.sort } |
| 165 |
{ name.sort } |
| 166 |
if$ |
| 167 |
#1 #1 substring$ |
| 168 |
} |
| 169 |
|
| 170 |
|
| 171 |
% ------------------------------------------------------------ |
| 172 |
% P R E - A N D P O S T - H E A D E R S |
| 173 |
% ------------------------------------------------------------ |
| 174 |
|
| 175 |
FUNCTION {begin.bib} |
| 176 |
{ "\begin{thephonebook}" write$ |
| 177 |
newline$ |
| 178 |
} |
| 179 |
|
| 180 |
FUNCTION {end.bib} |
| 181 |
{ newline$ |
| 182 |
"\end{thephonebook}" write$ |
| 183 |
newline$ |
| 184 |
} |
| 185 |
|
| 186 |
% ------------------------------------------------------------ |
| 187 |
% F O R M A T S |
| 188 |
% ------------------------------------------------------------ |
| 189 |
|
| 190 |
FUNCTION {format.names} |
| 191 |
{ 's := |
| 192 |
#1 'nameptr := |
| 193 |
s num.names$ 'numnames := |
| 194 |
numnames 'namesleft := |
| 195 |
{ namesleft #0 > } |
| 196 |
{ |
| 197 |
% CUSTOM uncomment one of the following lines to have the behaviour on the right |
| 198 |
s nameptr "{ff }{vv }{ll}{, jj}" format.name$ 't := % Christophe de Geuzaine, jr |
| 199 |
% s nameptr "{f. }{vv }{ll}{, jj}" format.name$ 't := % C. de Geuzaine, jr |
| 200 |
% s nameptr "{vv }{ll}{ f.}{, jj}" format.name$ 't := % de Geuzaine C., jr |
| 201 |
% s nameptr "{vv }{ll}{, ff}{, jj}" format.name$ 't := % de Geuzaine, Christophe, jr |
| 202 |
|
| 203 |
nameptr #1 > |
| 204 |
{ namesleft #1 > |
| 205 |
{ ", " * t * } |
| 206 |
{ " {\dirandf} " * t * } |
| 207 |
if$ |
| 208 |
} |
| 209 |
't |
| 210 |
if$ |
| 211 |
nameptr #1 + 'nameptr := |
| 212 |
namesleft #1 - 'namesleft := |
| 213 |
} |
| 214 |
while$ |
| 215 |
} |
| 216 |
|
| 217 |
FUNCTION {format.name} |
| 218 |
{ name empty$ |
| 219 |
{ "" } |
| 220 |
{ name format.names } |
| 221 |
if$ |
| 222 |
} |
| 223 |
|
| 224 |
FUNCTION {format.email} |
| 225 |
{ email empty$ |
| 226 |
{ "" } |
| 227 |
{ "\diremaa{" email "}" * * } |
| 228 |
if$ |
| 229 |
} |
| 230 |
|
| 231 |
FUNCTION {format.p.flag} |
| 232 |
{ p.email empty$ not |
| 233 |
{ "\dirprif " } |
| 234 |
{ "" } |
| 235 |
if$ |
| 236 |
} |
| 237 |
|
| 238 |
FUNCTION {format.p.email} |
| 239 |
{ p.email empty$ |
| 240 |
{ "" } |
| 241 |
{ "\dirpemaa{" p.email "}" * * } |
| 242 |
if$ |
| 243 |
} |
| 244 |
|
| 245 |
FUNCTION {format.r.flag} |
| 246 |
{ r.email empty$ not |
| 247 |
{ "\dirresf " } |
| 248 |
{ "" } |
| 249 |
if$ |
| 250 |
} |
| 251 |
|
| 252 |
FUNCTION {format.r.email} |
| 253 |
{ r.email empty$ |
| 254 |
{ "" } |
| 255 |
{ "\dirremaa{" r.email "}" * * } |
| 256 |
if$ |
| 257 |
} |
| 258 |
|
| 259 |
FUNCTION {format.w.flag} |
| 260 |
{ w.email empty$ not |
| 261 |
{ "\dirworf " } |
| 262 |
{ "" } |
| 263 |
if$ |
| 264 |
} |
| 265 |
|
| 266 |
FUNCTION {format.w.email} |
| 267 |
{ w.email empty$ |
| 268 |
{ "" } |
| 269 |
{ "\dirwemaa{" w.email "}" * * } |
| 270 |
if$ |
| 271 |
} |
| 272 |
|
| 273 |
% ------------------------------------------------------------ |
| 274 |
% P E R S O N E N T R Y |
| 275 |
% ------------------------------------------------------------ |
| 276 |
|
| 277 |
FUNCTION { person } |
| 278 |
{ |
| 279 |
p.email empty$ not |
| 280 |
r.email empty$ not |
| 281 |
w.email empty$ not |
| 282 |
or or |
| 283 |
{ newline$ |
| 284 |
|
| 285 |
"\dircheck{" write$ |
| 286 |
format.first.letter write$ |
| 287 |
"}" write$ |
| 288 |
newline$ |
| 289 |
|
| 290 |
"\diritem[" write$ |
| 291 |
format.name write$ |
| 292 |
"]{" write$ |
| 293 |
"d." cite$ * write$ |
| 294 |
"}\dirgroup" write$ |
| 295 |
newline$ |
| 296 |
"\dirblock" write$ |
| 297 |
newline$ |
| 298 |
|
| 299 |
format.p.flag output.flag |
| 300 |
format.p.email output |
| 301 |
|
| 302 |
format.r.flag output.flag |
| 303 |
format.r.email output |
| 304 |
|
| 305 |
format.w.flag output.flag |
| 306 |
format.w.email output |
| 307 |
|
| 308 |
"\direndgroup" write$ |
| 309 |
newline$ |
| 310 |
} |
| 311 |
{ } |
| 312 |
if$ |
| 313 |
} |
| 314 |
|
| 315 |
% ------------------------------------------------------------ |
| 316 |
% C O M P A N Y E N T R Y |
| 317 |
% ------------------------------------------------------------ |
| 318 |
|
| 319 |
|
| 320 |
FUNCTION { company } |
| 321 |
{ |
| 322 |
email empty$ not |
| 323 |
{ newline$ |
| 324 |
|
| 325 |
"\dircheck{" write$ |
| 326 |
format.first.letter write$ |
| 327 |
"}" write$ |
| 328 |
newline$ |
| 329 |
|
| 330 |
"\diritem[" write$ |
| 331 |
name write$ |
| 332 |
"]{" write$ |
| 333 |
"d." cite$ * write$ |
| 334 |
"}\dirgroup" write$ |
| 335 |
newline$ |
| 336 |
"\dirblock" write$ |
| 337 |
newline$ |
| 338 |
|
| 339 |
format.email output |
| 340 |
|
| 341 |
"\direndgroup" write$ |
| 342 |
newline$ |
| 343 |
} |
| 344 |
{ } |
| 345 |
if$ |
| 346 |
} |
| 347 |
|
| 348 |
% ------------------------------------------------------------ |
| 349 |
% P L A C E E N T R Y |
| 350 |
% ------------------------------------------------------------ |
| 351 |
|
| 352 |
|
| 353 |
FUNCTION { place } |
| 354 |
{ |
| 355 |
} |
| 356 |
|
| 357 |
% ------------------------------------------------------------ |
| 358 |
% M A I N |
| 359 |
% ------------------------------------------------------------ |
| 360 |
|
| 361 |
READ |
| 362 |
ITERATE {presort} |
| 363 |
SORT |
| 364 |
EXECUTE {begin.bib} |
| 365 |
ITERATE {call.type$} |
| 366 |
EXECUTE {end.bib} |