1 | %% |
---|
2 | %% This is file `model4-names.bst', |
---|
3 | %% |
---|
4 | %% Copyright 2009 Elsevier Ltd |
---|
5 | %% |
---|
6 | %% This file is part of the 'Elsarticle Bundle'. |
---|
7 | %% --------------------------------------------- |
---|
8 | %% |
---|
9 | %% It may be distributed under the conditions of the LaTeX Project Public |
---|
10 | %% License, either version 1.2 of this license or (at your option) any |
---|
11 | %% later version. The latest version of this license is in |
---|
12 | %% http://www.latex-project.org/lppl.txt |
---|
13 | %% and version 1.2 or later is part of all distributions of LaTeX |
---|
14 | %% version 1999/12/01 or later. |
---|
15 | %% |
---|
16 | %% $Id: model4-names.bst 132 2009-10-07 11:51:44Z rishi $ |
---|
17 | %% |
---|
18 | %% $URL: http://lenova.river-valley.com/svn/elsbst/trunk/New-Model-4/model4-names.bst $ |
---|
19 | %% |
---|
20 | %% |
---|
21 | |
---|
22 | |
---|
23 | ENTRY |
---|
24 | { address |
---|
25 | author |
---|
26 | booktitle |
---|
27 | chapter |
---|
28 | edition |
---|
29 | editor |
---|
30 | howpublished |
---|
31 | institution |
---|
32 | journal |
---|
33 | key |
---|
34 | month |
---|
35 | note |
---|
36 | number |
---|
37 | organization |
---|
38 | pages |
---|
39 | publisher |
---|
40 | school |
---|
41 | series |
---|
42 | title |
---|
43 | type |
---|
44 | volume |
---|
45 | year |
---|
46 | } |
---|
47 | {} |
---|
48 | { label extra.label sort.label short.list } |
---|
49 | INTEGERS { output.state before.all mid.sentence after.sentence after.block } |
---|
50 | FUNCTION {init.state.consts} |
---|
51 | { #0 'before.all := |
---|
52 | #1 'mid.sentence := |
---|
53 | #2 'after.sentence := |
---|
54 | #3 'after.block := |
---|
55 | } |
---|
56 | STRINGS { s t} |
---|
57 | FUNCTION {output.nonnull} |
---|
58 | { 's := |
---|
59 | output.state mid.sentence = |
---|
60 | { "; " * write$ } |
---|
61 | { output.state after.block = |
---|
62 | { add.period$ write$ |
---|
63 | newline$ |
---|
64 | "\newblock " write$ |
---|
65 | } |
---|
66 | { output.state before.all = |
---|
67 | 'write$ |
---|
68 | { add.period$ " " * write$ } |
---|
69 | if$ |
---|
70 | } |
---|
71 | if$ |
---|
72 | mid.sentence 'output.state := |
---|
73 | } |
---|
74 | if$ |
---|
75 | s |
---|
76 | } |
---|
77 | FUNCTION {output} |
---|
78 | { duplicate$ empty$ |
---|
79 | 'pop$ |
---|
80 | 'output.nonnull |
---|
81 | if$ |
---|
82 | } |
---|
83 | FUNCTION {output.check} |
---|
84 | { 't := |
---|
85 | duplicate$ empty$ |
---|
86 | { pop$ "empty " t * " in " * cite$ * warning$ } |
---|
87 | 'output.nonnull |
---|
88 | if$ |
---|
89 | } |
---|
90 | FUNCTION {fin.entry} |
---|
91 | { add.period$ |
---|
92 | write$ |
---|
93 | newline$ |
---|
94 | } |
---|
95 | |
---|
96 | FUNCTION {new.block} |
---|
97 | { output.state before.all = |
---|
98 | 'skip$ |
---|
99 | { after.block 'output.state := } |
---|
100 | if$ |
---|
101 | } |
---|
102 | FUNCTION {new.sentence} |
---|
103 | { output.state after.block = |
---|
104 | 'skip$ |
---|
105 | { output.state before.all = |
---|
106 | 'skip$ |
---|
107 | { after.sentence 'output.state := } |
---|
108 | if$ |
---|
109 | } |
---|
110 | if$ |
---|
111 | } |
---|
112 | FUNCTION {add.blank} |
---|
113 | { " " * before.all 'output.state := |
---|
114 | } |
---|
115 | |
---|
116 | FUNCTION {no.blank.or.punct} |
---|
117 | { "" * before.all 'output.state := |
---|
118 | } |
---|
119 | |
---|
120 | FUNCTION {date.block} |
---|
121 | { |
---|
122 | ";" * |
---|
123 | no.blank.or.punct |
---|
124 | } |
---|
125 | |
---|
126 | FUNCTION {not} |
---|
127 | { { #0 } |
---|
128 | { #1 } |
---|
129 | if$ |
---|
130 | } |
---|
131 | FUNCTION {and} |
---|
132 | { 'skip$ |
---|
133 | { pop$ #0 } |
---|
134 | if$ |
---|
135 | } |
---|
136 | FUNCTION {or} |
---|
137 | { { pop$ #1 } |
---|
138 | 'skip$ |
---|
139 | if$ |
---|
140 | } |
---|
141 | STRINGS {z} |
---|
142 | FUNCTION {remove.dots} |
---|
143 | { 'z := |
---|
144 | "" |
---|
145 | { z empty$ not } |
---|
146 | { z #1 #1 substring$ |
---|
147 | z #2 global.max$ substring$ 'z := |
---|
148 | duplicate$ "." = 'pop$ |
---|
149 | { * } |
---|
150 | if$ |
---|
151 | } |
---|
152 | while$ |
---|
153 | } |
---|
154 | FUNCTION {new.block.checkb} |
---|
155 | { empty$ |
---|
156 | swap$ empty$ |
---|
157 | and |
---|
158 | 'skip$ |
---|
159 | 'new.block |
---|
160 | if$ |
---|
161 | } |
---|
162 | FUNCTION {field.or.null} |
---|
163 | { duplicate$ empty$ |
---|
164 | { pop$ "" } |
---|
165 | 'skip$ |
---|
166 | if$ |
---|
167 | } |
---|
168 | FUNCTION {emphasize} |
---|
169 | { duplicate$ empty$ |
---|
170 | { pop$ "" } |
---|
171 | { "\textit{" swap$ * "}" * } |
---|
172 | if$ |
---|
173 | } |
---|
174 | FUNCTION {tie.or.space.prefix} |
---|
175 | { duplicate$ text.length$ #3 < |
---|
176 | { "~" } |
---|
177 | { " " } |
---|
178 | if$ |
---|
179 | swap$ |
---|
180 | } |
---|
181 | |
---|
182 | FUNCTION {capitalize} |
---|
183 | { "u" change.case$ "t" change.case$ } |
---|
184 | |
---|
185 | FUNCTION {space.word} |
---|
186 | { " " swap$ * " " * } |
---|
187 | % Here are the language-specific definitions for explicit words. |
---|
188 | % Each function has a name bbl.xxx where xxx is the English word. |
---|
189 | % The language selected here is ENGLISH |
---|
190 | FUNCTION {bbl.and} |
---|
191 | { "and"} |
---|
192 | |
---|
193 | FUNCTION {bbl.etal} |
---|
194 | { "et~al." } |
---|
195 | |
---|
196 | FUNCTION {bbl.editors} |
---|
197 | { "editors" } |
---|
198 | |
---|
199 | FUNCTION {bbl.editor} |
---|
200 | { "editor" } |
---|
201 | |
---|
202 | FUNCTION {bbl.edby} |
---|
203 | { "edited by" } |
---|
204 | |
---|
205 | FUNCTION {bbl.edition} |
---|
206 | { "ed." } |
---|
207 | |
---|
208 | FUNCTION {bbl.volume} |
---|
209 | { "volume" } |
---|
210 | |
---|
211 | FUNCTION {bbl.of} |
---|
212 | { "of" } |
---|
213 | |
---|
214 | FUNCTION {bbl.number} |
---|
215 | { "number" } |
---|
216 | |
---|
217 | FUNCTION {bbl.nr} |
---|
218 | { "no." } |
---|
219 | |
---|
220 | FUNCTION {bbl.in} |
---|
221 | { "in" } |
---|
222 | |
---|
223 | FUNCTION {bbl.pages} |
---|
224 | { "p." } |
---|
225 | |
---|
226 | FUNCTION {bbl.page} |
---|
227 | { "p." } |
---|
228 | |
---|
229 | FUNCTION {bbl.chapter} |
---|
230 | { "chapter" } |
---|
231 | |
---|
232 | FUNCTION {bbl.techrep} |
---|
233 | { "Technical Report" } |
---|
234 | |
---|
235 | FUNCTION {bbl.mthesis} |
---|
236 | { "Master's thesis" } |
---|
237 | |
---|
238 | FUNCTION {bbl.phdthesis} |
---|
239 | { "Ph.D. thesis" } |
---|
240 | |
---|
241 | FUNCTION {bbl.first} |
---|
242 | { "1st" } |
---|
243 | |
---|
244 | FUNCTION {bbl.second} |
---|
245 | { "2nd" } |
---|
246 | |
---|
247 | FUNCTION {bbl.third} |
---|
248 | { "3rd" } |
---|
249 | |
---|
250 | FUNCTION {bbl.fourth} |
---|
251 | { "4th" } |
---|
252 | |
---|
253 | FUNCTION {bbl.fifth} |
---|
254 | { "5th" } |
---|
255 | |
---|
256 | FUNCTION {bbl.st} |
---|
257 | { "st" } |
---|
258 | |
---|
259 | FUNCTION {bbl.nd} |
---|
260 | { "nd" } |
---|
261 | |
---|
262 | FUNCTION {bbl.rd} |
---|
263 | { "rd" } |
---|
264 | |
---|
265 | FUNCTION {bbl.th} |
---|
266 | { "th" } |
---|
267 | |
---|
268 | MACRO {jan} {"January"} |
---|
269 | |
---|
270 | MACRO {feb} {"February"} |
---|
271 | |
---|
272 | MACRO {mar} {"March"} |
---|
273 | |
---|
274 | MACRO {apr} {"April"} |
---|
275 | |
---|
276 | MACRO {may} {"May"} |
---|
277 | |
---|
278 | MACRO {jun} {"June"} |
---|
279 | |
---|
280 | MACRO {jul} {"July"} |
---|
281 | |
---|
282 | MACRO {aug} {"August"} |
---|
283 | |
---|
284 | MACRO {sep} {"September"} |
---|
285 | |
---|
286 | MACRO {oct} {"October"} |
---|
287 | |
---|
288 | MACRO {nov} {"November"} |
---|
289 | |
---|
290 | MACRO {dec} {"December"} |
---|
291 | |
---|
292 | FUNCTION {eng.ord} |
---|
293 | { duplicate$ "1" swap$ * |
---|
294 | #-2 #1 substring$ "1" = |
---|
295 | { bbl.th * } |
---|
296 | { duplicate$ #-1 #1 substring$ |
---|
297 | duplicate$ "1" = |
---|
298 | { pop$ bbl.st * } |
---|
299 | { duplicate$ "2" = |
---|
300 | { pop$ bbl.nd * } |
---|
301 | { "3" = |
---|
302 | { bbl.rd * } |
---|
303 | { bbl.th * } |
---|
304 | if$ |
---|
305 | } |
---|
306 | if$ |
---|
307 | } |
---|
308 | if$ |
---|
309 | } |
---|
310 | if$ |
---|
311 | } |
---|
312 | |
---|
313 | MACRO {acmcs} {"ACM Comput. Surv."} |
---|
314 | |
---|
315 | MACRO {acta} {"Acta Inf."} |
---|
316 | |
---|
317 | MACRO {cacm} {"Commun. ACM"} |
---|
318 | |
---|
319 | MACRO {ibmjrd} {"IBM J. Res. Dev."} |
---|
320 | |
---|
321 | MACRO {ibmsj} {"IBM Syst.~J."} |
---|
322 | |
---|
323 | MACRO {ieeese} {"IEEE Trans. Software Eng."} |
---|
324 | |
---|
325 | MACRO {ieeetc} {"IEEE Trans. Comput."} |
---|
326 | |
---|
327 | MACRO {ieeetcad} |
---|
328 | {"IEEE Trans. Comput. Aid. Des."} |
---|
329 | |
---|
330 | MACRO {ipl} {"Inf. Process. Lett."} |
---|
331 | |
---|
332 | MACRO {jacm} {"J.~ACM"} |
---|
333 | |
---|
334 | MACRO {jcss} {"J.~Comput. Syst. Sci."} |
---|
335 | |
---|
336 | MACRO {scp} {"Sci. Comput. Program."} |
---|
337 | |
---|
338 | MACRO {sicomp} {"SIAM J. Comput."} |
---|
339 | |
---|
340 | MACRO {tocs} {"ACM Trans. Comput. Syst."} |
---|
341 | |
---|
342 | MACRO {tods} {"ACM Trans. Database Syst."} |
---|
343 | |
---|
344 | MACRO {tog} {"ACM Trans. Graphic."} |
---|
345 | |
---|
346 | MACRO {toms} {"ACM Trans. Math. Software"} |
---|
347 | |
---|
348 | MACRO {toois} {"ACM Trans. Office Inf. Syst."} |
---|
349 | |
---|
350 | MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} |
---|
351 | |
---|
352 | MACRO {tcs} {"Theor. Comput. Sci."} |
---|
353 | |
---|
354 | FUNCTION {bibinfo.check} |
---|
355 | { swap$ |
---|
356 | duplicate$ missing$ |
---|
357 | { |
---|
358 | pop$ pop$ |
---|
359 | "" |
---|
360 | } |
---|
361 | { duplicate$ empty$ |
---|
362 | { |
---|
363 | swap$ pop$ |
---|
364 | } |
---|
365 | { swap$ |
---|
366 | "\bibinfo{" swap$ * "}{" * swap$ * "}" * |
---|
367 | } |
---|
368 | if$ |
---|
369 | } |
---|
370 | if$ |
---|
371 | } |
---|
372 | FUNCTION {bibinfo.warn} |
---|
373 | { swap$ |
---|
374 | duplicate$ missing$ |
---|
375 | { |
---|
376 | swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ |
---|
377 | "" |
---|
378 | } |
---|
379 | { duplicate$ empty$ |
---|
380 | { |
---|
381 | swap$ "empty " swap$ * " in " * cite$ * warning$ |
---|
382 | } |
---|
383 | { swap$ |
---|
384 | pop$ |
---|
385 | } |
---|
386 | if$ |
---|
387 | } |
---|
388 | if$ |
---|
389 | } |
---|
390 | STRINGS { bibinfo} |
---|
391 | INTEGERS { nameptr namesleft numnames } |
---|
392 | |
---|
393 | FUNCTION {format.names} |
---|
394 | { 'bibinfo := |
---|
395 | duplicate$ empty$ 'skip$ { |
---|
396 | 's := |
---|
397 | "" 't := |
---|
398 | #1 'nameptr := |
---|
399 | s num.names$ 'numnames := |
---|
400 | numnames 'namesleft := |
---|
401 | { namesleft #0 > } |
---|
402 | { s nameptr |
---|
403 | "{vv~}{ll}{ jj}\xfnm[{ f{.}.}]" |
---|
404 | format.name$ |
---|
405 | % remove.dots |
---|
406 | bibinfo bibinfo.check |
---|
407 | 't := |
---|
408 | nameptr #1 > |
---|
409 | { |
---|
410 | namesleft #1 > |
---|
411 | { ", " * t * } |
---|
412 | { |
---|
413 | "," * |
---|
414 | s nameptr "{ll}" format.name$ duplicate$ "others" = |
---|
415 | { 't := } |
---|
416 | { pop$ } |
---|
417 | if$ |
---|
418 | t "others" = |
---|
419 | { |
---|
420 | " " * bbl.etal * |
---|
421 | } |
---|
422 | { " " * t * } |
---|
423 | if$ |
---|
424 | } |
---|
425 | if$ |
---|
426 | } |
---|
427 | 't |
---|
428 | if$ |
---|
429 | nameptr #1 + 'nameptr := |
---|
430 | namesleft #1 - 'namesleft := |
---|
431 | } |
---|
432 | while$ |
---|
433 | } if$ |
---|
434 | } |
---|
435 | FUNCTION {format.names.ed} |
---|
436 | { |
---|
437 | format.names |
---|
438 | } |
---|
439 | FUNCTION {format.key} |
---|
440 | { empty$ |
---|
441 | { key field.or.null } |
---|
442 | { "" } |
---|
443 | if$ |
---|
444 | } |
---|
445 | |
---|
446 | FUNCTION {format.authors} |
---|
447 | { author "author" format.names |
---|
448 | } |
---|
449 | FUNCTION {get.bbl.editor} |
---|
450 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } |
---|
451 | |
---|
452 | FUNCTION {format.editors} |
---|
453 | { editor "editor" format.names duplicate$ empty$ 'skip$ |
---|
454 | { |
---|
455 | "," * |
---|
456 | " " * |
---|
457 | get.bbl.editor |
---|
458 | * |
---|
459 | } |
---|
460 | if$ |
---|
461 | } |
---|
462 | FUNCTION {format.note} |
---|
463 | { |
---|
464 | note empty$ |
---|
465 | { "" } |
---|
466 | { note #1 #1 substring$ |
---|
467 | duplicate$ "{" = |
---|
468 | 'skip$ |
---|
469 | { output.state mid.sentence = |
---|
470 | { "l" } |
---|
471 | { "u" } |
---|
472 | if$ |
---|
473 | change.case$ |
---|
474 | } |
---|
475 | if$ |
---|
476 | note #2 global.max$ substring$ * "note" bibinfo.check |
---|
477 | } |
---|
478 | if$ |
---|
479 | } |
---|
480 | |
---|
481 | FUNCTION {format.title} |
---|
482 | { title |
---|
483 | duplicate$ empty$ 'skip$ |
---|
484 | { "t" change.case$ } |
---|
485 | if$ |
---|
486 | "title" bibinfo.check |
---|
487 | } |
---|
488 | FUNCTION {format.full.names} |
---|
489 | {'s := |
---|
490 | "" 't := |
---|
491 | #1 'nameptr := |
---|
492 | s num.names$ 'numnames := |
---|
493 | numnames 'namesleft := |
---|
494 | { namesleft #0 > } |
---|
495 | { s nameptr |
---|
496 | "{vv~}{ll}" format.name$ |
---|
497 | 't := |
---|
498 | nameptr #1 > |
---|
499 | { |
---|
500 | namesleft #1 > |
---|
501 | { ", " * t * } |
---|
502 | { |
---|
503 | s nameptr "{ll}" format.name$ duplicate$ "others" = |
---|
504 | { 't := } |
---|
505 | { pop$ } |
---|
506 | if$ |
---|
507 | t "others" = |
---|
508 | { |
---|
509 | " " * bbl.etal * |
---|
510 | } |
---|
511 | { |
---|
512 | bbl.and |
---|
513 | space.word * t * |
---|
514 | } |
---|
515 | if$ |
---|
516 | } |
---|
517 | if$ |
---|
518 | } |
---|
519 | 't |
---|
520 | if$ |
---|
521 | nameptr #1 + 'nameptr := |
---|
522 | namesleft #1 - 'namesleft := |
---|
523 | } |
---|
524 | while$ |
---|
525 | } |
---|
526 | |
---|
527 | FUNCTION {author.editor.key.full} |
---|
528 | { author empty$ |
---|
529 | { editor empty$ |
---|
530 | { key empty$ |
---|
531 | { cite$ #1 #3 substring$ } |
---|
532 | 'key |
---|
533 | if$ |
---|
534 | } |
---|
535 | { editor format.full.names } |
---|
536 | if$ |
---|
537 | } |
---|
538 | { author format.full.names } |
---|
539 | if$ |
---|
540 | } |
---|
541 | |
---|
542 | FUNCTION {author.key.full} |
---|
543 | { author empty$ |
---|
544 | { key empty$ |
---|
545 | { cite$ #1 #3 substring$ } |
---|
546 | 'key |
---|
547 | if$ |
---|
548 | } |
---|
549 | { author format.full.names } |
---|
550 | if$ |
---|
551 | } |
---|
552 | |
---|
553 | FUNCTION {editor.key.full} |
---|
554 | { editor empty$ |
---|
555 | { key empty$ |
---|
556 | { cite$ #1 #3 substring$ } |
---|
557 | 'key |
---|
558 | if$ |
---|
559 | } |
---|
560 | { editor format.full.names } |
---|
561 | if$ |
---|
562 | } |
---|
563 | |
---|
564 | FUNCTION {make.full.names} |
---|
565 | { type$ "book" = |
---|
566 | type$ "inbook" = |
---|
567 | or |
---|
568 | 'author.editor.key.full |
---|
569 | { type$ "proceedings" = |
---|
570 | 'editor.key.full |
---|
571 | 'author.key.full |
---|
572 | if$ |
---|
573 | } |
---|
574 | if$ |
---|
575 | } |
---|
576 | |
---|
577 | FUNCTION {output.bibitem} |
---|
578 | { newline$ |
---|
579 | "\bibitem[{" write$ |
---|
580 | label write$ |
---|
581 | ")" make.full.names duplicate$ short.list = |
---|
582 | { pop$ } |
---|
583 | { * } |
---|
584 | if$ |
---|
585 | "}]{" * write$ |
---|
586 | cite$ write$ |
---|
587 | "}" write$ |
---|
588 | newline$ |
---|
589 | "" |
---|
590 | before.all 'output.state := |
---|
591 | } |
---|
592 | |
---|
593 | FUNCTION {n.dashify} |
---|
594 | { |
---|
595 | 't := |
---|
596 | "" |
---|
597 | { t empty$ not } |
---|
598 | { t #1 #1 substring$ "-" = |
---|
599 | { t #1 #2 substring$ "--" = not |
---|
600 | { "--" * |
---|
601 | t #2 global.max$ substring$ 't := |
---|
602 | } |
---|
603 | { { t #1 #1 substring$ "-" = } |
---|
604 | { "-" * |
---|
605 | t #2 global.max$ substring$ 't := |
---|
606 | } |
---|
607 | while$ |
---|
608 | } |
---|
609 | if$ |
---|
610 | } |
---|
611 | { t #1 #1 substring$ * |
---|
612 | t #2 global.max$ substring$ 't := |
---|
613 | } |
---|
614 | if$ |
---|
615 | } |
---|
616 | while$ |
---|
617 | } |
---|
618 | |
---|
619 | FUNCTION {word.in} |
---|
620 | { bbl.in capitalize |
---|
621 | ":" * |
---|
622 | " " * } |
---|
623 | |
---|
624 | FUNCTION {format.date} |
---|
625 | { year "year" bibinfo.check duplicate$ empty$ |
---|
626 | { |
---|
627 | } |
---|
628 | 'skip$ |
---|
629 | if$ |
---|
630 | extra.label * |
---|
631 | } |
---|
632 | FUNCTION {format.btitle} |
---|
633 | { title "title" bibinfo.check |
---|
634 | duplicate$ empty$ 'skip$ |
---|
635 | { |
---|
636 | } |
---|
637 | if$ |
---|
638 | } |
---|
639 | FUNCTION {either.or.check} |
---|
640 | { empty$ |
---|
641 | 'pop$ |
---|
642 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } |
---|
643 | if$ |
---|
644 | } |
---|
645 | FUNCTION {format.bvolume} |
---|
646 | { volume empty$ |
---|
647 | { "" } |
---|
648 | { bbl.volume volume tie.or.space.prefix |
---|
649 | "volume" bibinfo.check * * |
---|
650 | series "series" bibinfo.check |
---|
651 | duplicate$ empty$ 'pop$ |
---|
652 | { swap$ bbl.of space.word * swap$ |
---|
653 | emphasize * } |
---|
654 | if$ |
---|
655 | "volume and number" number either.or.check |
---|
656 | } |
---|
657 | if$ |
---|
658 | } |
---|
659 | FUNCTION {format.number.series} |
---|
660 | { volume empty$ |
---|
661 | { number empty$ |
---|
662 | { series field.or.null } |
---|
663 | { output.state mid.sentence = |
---|
664 | { bbl.number } |
---|
665 | { bbl.number capitalize } |
---|
666 | if$ |
---|
667 | number tie.or.space.prefix "number" bibinfo.check * * |
---|
668 | series empty$ |
---|
669 | { "there's a number but no series in " cite$ * warning$ } |
---|
670 | { bbl.in space.word * |
---|
671 | series "series" bibinfo.check * |
---|
672 | } |
---|
673 | if$ |
---|
674 | } |
---|
675 | if$ |
---|
676 | } |
---|
677 | { "" } |
---|
678 | if$ |
---|
679 | } |
---|
680 | FUNCTION {is.num} |
---|
681 | { chr.to.int$ |
---|
682 | duplicate$ "0" chr.to.int$ < not |
---|
683 | swap$ "9" chr.to.int$ > not and |
---|
684 | } |
---|
685 | |
---|
686 | FUNCTION {extract.num} |
---|
687 | { duplicate$ 't := |
---|
688 | "" 's := |
---|
689 | { t empty$ not } |
---|
690 | { t #1 #1 substring$ |
---|
691 | t #2 global.max$ substring$ 't := |
---|
692 | duplicate$ is.num |
---|
693 | { s swap$ * 's := } |
---|
694 | { pop$ "" 't := } |
---|
695 | if$ |
---|
696 | } |
---|
697 | while$ |
---|
698 | s empty$ |
---|
699 | 'skip$ |
---|
700 | { pop$ s } |
---|
701 | if$ |
---|
702 | } |
---|
703 | |
---|
704 | FUNCTION {convert.edition} |
---|
705 | { extract.num "l" change.case$ 's := |
---|
706 | s "first" = s "1" = or |
---|
707 | { bbl.first 't := } |
---|
708 | { s "second" = s "2" = or |
---|
709 | { bbl.second 't := } |
---|
710 | { s "third" = s "3" = or |
---|
711 | { bbl.third 't := } |
---|
712 | { s "fourth" = s "4" = or |
---|
713 | { bbl.fourth 't := } |
---|
714 | { s "fifth" = s "5" = or |
---|
715 | { bbl.fifth 't := } |
---|
716 | { s #1 #1 substring$ is.num |
---|
717 | { s eng.ord 't := } |
---|
718 | { edition 't := } |
---|
719 | if$ |
---|
720 | } |
---|
721 | if$ |
---|
722 | } |
---|
723 | if$ |
---|
724 | } |
---|
725 | if$ |
---|
726 | } |
---|
727 | if$ |
---|
728 | } |
---|
729 | if$ |
---|
730 | t |
---|
731 | } |
---|
732 | |
---|
733 | FUNCTION {format.edition} |
---|
734 | { edition duplicate$ empty$ 'skip$ |
---|
735 | { |
---|
736 | convert.edition |
---|
737 | output.state mid.sentence = |
---|
738 | { "l" } |
---|
739 | { "t" } |
---|
740 | if$ change.case$ |
---|
741 | "edition" bibinfo.check |
---|
742 | " " * bbl.edition * |
---|
743 | } |
---|
744 | if$ |
---|
745 | } |
---|
746 | INTEGERS { multiresult } |
---|
747 | FUNCTION {multi.page.check} |
---|
748 | { 't := |
---|
749 | #0 'multiresult := |
---|
750 | { multiresult not |
---|
751 | t empty$ not |
---|
752 | and |
---|
753 | } |
---|
754 | { t #1 #1 substring$ |
---|
755 | duplicate$ "-" = |
---|
756 | swap$ duplicate$ "," = |
---|
757 | swap$ "+" = |
---|
758 | or or |
---|
759 | { #1 'multiresult := } |
---|
760 | { t #2 global.max$ substring$ 't := } |
---|
761 | if$ |
---|
762 | } |
---|
763 | while$ |
---|
764 | multiresult |
---|
765 | } |
---|
766 | FUNCTION {format.pages} |
---|
767 | { pages duplicate$ empty$ 'skip$ |
---|
768 | { duplicate$ multi.page.check |
---|
769 | { |
---|
770 | bbl.pages swap$ |
---|
771 | n.dashify |
---|
772 | } |
---|
773 | { |
---|
774 | bbl.page swap$ |
---|
775 | } |
---|
776 | if$ |
---|
777 | tie.or.space.prefix |
---|
778 | "pages" bibinfo.check |
---|
779 | * * |
---|
780 | } |
---|
781 | if$ |
---|
782 | } |
---|
783 | FUNCTION {format.journal.pages} |
---|
784 | { pages duplicate$ empty$ 'pop$ |
---|
785 | { swap$ duplicate$ empty$ |
---|
786 | { pop$ pop$ format.pages } |
---|
787 | { |
---|
788 | ":" * |
---|
789 | swap$ |
---|
790 | n.dashify |
---|
791 | "pages" bibinfo.check |
---|
792 | * |
---|
793 | } |
---|
794 | if$ |
---|
795 | } |
---|
796 | if$ |
---|
797 | } |
---|
798 | FUNCTION {format.vol.num.pages} |
---|
799 | { volume field.or.null |
---|
800 | duplicate$ empty$ 'skip$ |
---|
801 | { |
---|
802 | "volume" bibinfo.check |
---|
803 | } |
---|
804 | if$ |
---|
805 | number "number" bibinfo.check duplicate$ empty$ 'skip$ |
---|
806 | { |
---|
807 | swap$ duplicate$ empty$ |
---|
808 | { "there's a number but no volume in " cite$ * warning$ } |
---|
809 | 'skip$ |
---|
810 | if$ |
---|
811 | swap$ |
---|
812 | "(" swap$ * ")" * |
---|
813 | } |
---|
814 | if$ * |
---|
815 | } |
---|
816 | |
---|
817 | FUNCTION {format.chapter.pages} |
---|
818 | { chapter empty$ |
---|
819 | { "" } |
---|
820 | { type empty$ |
---|
821 | { bbl.chapter } |
---|
822 | { type "l" change.case$ |
---|
823 | "type" bibinfo.check |
---|
824 | } |
---|
825 | if$ |
---|
826 | chapter tie.or.space.prefix |
---|
827 | "chapter" bibinfo.check |
---|
828 | * * |
---|
829 | } |
---|
830 | if$ |
---|
831 | } |
---|
832 | |
---|
833 | FUNCTION {format.booktitle} |
---|
834 | { |
---|
835 | booktitle "booktitle" bibinfo.check |
---|
836 | } |
---|
837 | FUNCTION {format.in.ed.booktitle} |
---|
838 | { format.booktitle duplicate$ empty$ 'skip$ |
---|
839 | { |
---|
840 | editor "editor" format.names.ed duplicate$ empty$ 'pop$ |
---|
841 | { |
---|
842 | "," * |
---|
843 | " " * |
---|
844 | get.bbl.editor |
---|
845 | ". " * |
---|
846 | * swap$ |
---|
847 | * } |
---|
848 | if$ |
---|
849 | word.in swap$ * |
---|
850 | } |
---|
851 | if$ |
---|
852 | } |
---|
853 | FUNCTION {format.thesis.type} |
---|
854 | { type duplicate$ empty$ |
---|
855 | 'pop$ |
---|
856 | { swap$ pop$ |
---|
857 | "t" change.case$ "type" bibinfo.check |
---|
858 | } |
---|
859 | if$ |
---|
860 | } |
---|
861 | FUNCTION {format.tr.number} |
---|
862 | { number "number" bibinfo.check |
---|
863 | type duplicate$ empty$ |
---|
864 | { pop$ bbl.techrep } |
---|
865 | 'skip$ |
---|
866 | if$ |
---|
867 | "type" bibinfo.check |
---|
868 | swap$ duplicate$ empty$ |
---|
869 | { pop$ "t" change.case$ } |
---|
870 | { tie.or.space.prefix * * } |
---|
871 | if$ |
---|
872 | } |
---|
873 | FUNCTION {format.article.crossref} |
---|
874 | { |
---|
875 | word.in |
---|
876 | " \cite{" * crossref * "}" * |
---|
877 | } |
---|
878 | FUNCTION {format.book.crossref} |
---|
879 | { volume duplicate$ empty$ |
---|
880 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ |
---|
881 | pop$ word.in |
---|
882 | } |
---|
883 | { bbl.volume |
---|
884 | capitalize |
---|
885 | swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * |
---|
886 | } |
---|
887 | if$ |
---|
888 | " \cite{" * crossref * "}" * |
---|
889 | } |
---|
890 | FUNCTION {format.incoll.inproc.crossref} |
---|
891 | { |
---|
892 | word.in |
---|
893 | " \cite{" * crossref * "}" * |
---|
894 | } |
---|
895 | FUNCTION {format.org.or.pub} |
---|
896 | { 't := |
---|
897 | "" |
---|
898 | address empty$ t empty$ and |
---|
899 | 'skip$ |
---|
900 | { |
---|
901 | address "address" bibinfo.check * |
---|
902 | t empty$ |
---|
903 | 'skip$ |
---|
904 | { address empty$ |
---|
905 | 'skip$ |
---|
906 | { ": " * } |
---|
907 | if$ |
---|
908 | t * |
---|
909 | } |
---|
910 | if$ |
---|
911 | } |
---|
912 | if$ |
---|
913 | } |
---|
914 | FUNCTION {format.publisher.address} |
---|
915 | { publisher "publisher" bibinfo.check format.org.or.pub |
---|
916 | } |
---|
917 | |
---|
918 | FUNCTION {format.organization.address} |
---|
919 | { organization "organization" bibinfo.check format.org.or.pub |
---|
920 | } |
---|
921 | |
---|
922 | FUNCTION {book.date.block} |
---|
923 | { |
---|
924 | ", " * |
---|
925 | no.blank.or.punct |
---|
926 | } |
---|
927 | |
---|
928 | FUNCTION {inbook.date.block} |
---|
929 | { |
---|
930 | ". " * |
---|
931 | no.blank.or.punct |
---|
932 | } |
---|
933 | |
---|
934 | |
---|
935 | FUNCTION {article} |
---|
936 | { "%Type = Article" write$ |
---|
937 | output.bibitem |
---|
938 | format.authors "author" output.check |
---|
939 | author format.key output |
---|
940 | new.block |
---|
941 | format.title "title" output.check |
---|
942 | new.block |
---|
943 | crossref missing$ |
---|
944 | { |
---|
945 | journal |
---|
946 | remove.dots |
---|
947 | "journal" bibinfo.check |
---|
948 | "journal" output.check |
---|
949 | add.blank |
---|
950 | format.date "year" output.check |
---|
951 | date.block |
---|
952 | format.vol.num.pages output |
---|
953 | } |
---|
954 | { format.article.crossref output.nonnull |
---|
955 | } |
---|
956 | if$ |
---|
957 | format.journal.pages |
---|
958 | new.block |
---|
959 | format.note output |
---|
960 | fin.entry |
---|
961 | } |
---|
962 | FUNCTION {book} |
---|
963 | { "%Type = Book" write$ |
---|
964 | output.bibitem |
---|
965 | author empty$ |
---|
966 | { format.editors "author and editor" output.check |
---|
967 | editor format.key output |
---|
968 | } |
---|
969 | { format.authors output.nonnull |
---|
970 | crossref missing$ |
---|
971 | { "author and editor" editor either.or.check } |
---|
972 | 'skip$ |
---|
973 | if$ |
---|
974 | } |
---|
975 | if$ |
---|
976 | new.block |
---|
977 | format.btitle "title" output.check |
---|
978 | new.block |
---|
979 | format.edition output |
---|
980 | crossref missing$ |
---|
981 | { format.bvolume output |
---|
982 | new.block |
---|
983 | format.number.series output |
---|
984 | new.sentence |
---|
985 | format.publisher.address output |
---|
986 | } |
---|
987 | { |
---|
988 | new.block |
---|
989 | format.book.crossref output.nonnull |
---|
990 | } |
---|
991 | if$ |
---|
992 | new.block |
---|
993 | book.date.block |
---|
994 | format.date "year" output.check |
---|
995 | new.block |
---|
996 | format.note output |
---|
997 | fin.entry |
---|
998 | } |
---|
999 | FUNCTION {booklet} |
---|
1000 | { "%Type = Booklet" write$ |
---|
1001 | output.bibitem |
---|
1002 | format.authors output |
---|
1003 | author format.key output |
---|
1004 | new.block |
---|
1005 | format.title "title" output.check |
---|
1006 | new.block |
---|
1007 | howpublished "howpublished" bibinfo.check output |
---|
1008 | address "address" bibinfo.check output |
---|
1009 | format.date "year" output.check |
---|
1010 | new.block |
---|
1011 | format.note output |
---|
1012 | fin.entry |
---|
1013 | } |
---|
1014 | |
---|
1015 | FUNCTION {inbook} |
---|
1016 | { "%Type = Inbook" write$ |
---|
1017 | output.bibitem |
---|
1018 | author empty$ |
---|
1019 | { format.editors "author and editor" output.check |
---|
1020 | editor format.key output |
---|
1021 | } |
---|
1022 | { format.authors output.nonnull |
---|
1023 | crossref missing$ |
---|
1024 | { "author and editor" editor either.or.check } |
---|
1025 | 'skip$ |
---|
1026 | if$ |
---|
1027 | } |
---|
1028 | if$ |
---|
1029 | new.block |
---|
1030 | format.btitle "title" output.check |
---|
1031 | crossref missing$ |
---|
1032 | { |
---|
1033 | format.publisher.address output |
---|
1034 | format.bvolume output |
---|
1035 | new.block |
---|
1036 | format.number.series output |
---|
1037 | new.sentence |
---|
1038 | } |
---|
1039 | { |
---|
1040 | new.block |
---|
1041 | format.book.crossref output.nonnull |
---|
1042 | } |
---|
1043 | if$ |
---|
1044 | format.edition output |
---|
1045 | format.pages "pages" output.check |
---|
1046 | new.block |
---|
1047 | format.note output |
---|
1048 | fin.entry |
---|
1049 | } |
---|
1050 | |
---|
1051 | FUNCTION {incollection} |
---|
1052 | { "%Type = Incollection" write$ |
---|
1053 | output.bibitem |
---|
1054 | format.authors "author" output.check |
---|
1055 | author format.key output |
---|
1056 | new.block |
---|
1057 | format.title "title" output.check |
---|
1058 | new.block |
---|
1059 | crossref missing$ |
---|
1060 | { format.in.ed.booktitle "booktitle" output.check |
---|
1061 | new.sentence |
---|
1062 | publisher empty$ |
---|
1063 | { format.organization.address output } |
---|
1064 | { organization "organization" bibinfo.check output |
---|
1065 | format.publisher.address output |
---|
1066 | } |
---|
1067 | if$ |
---|
1068 | format.bvolume output |
---|
1069 | format.number.series output |
---|
1070 | format.edition output |
---|
1071 | } |
---|
1072 | { format.incoll.inproc.crossref output.nonnull |
---|
1073 | } |
---|
1074 | if$ |
---|
1075 | format.date "year" output.check |
---|
1076 | inbook.date.block |
---|
1077 | format.pages "pages" output.check |
---|
1078 | new.block |
---|
1079 | format.note output |
---|
1080 | fin.entry |
---|
1081 | } |
---|
1082 | FUNCTION {inproceedings} |
---|
1083 | { "%Type = Inproceedings" write$ |
---|
1084 | output.bibitem |
---|
1085 | format.authors "author" output.check |
---|
1086 | author format.key output |
---|
1087 | new.block |
---|
1088 | format.title "title" output.check |
---|
1089 | new.block |
---|
1090 | crossref missing$ |
---|
1091 | { format.in.ed.booktitle "booktitle" output.check |
---|
1092 | new.sentence |
---|
1093 | publisher empty$ |
---|
1094 | { format.organization.address output } |
---|
1095 | { organization "organization" bibinfo.check output |
---|
1096 | format.publisher.address output |
---|
1097 | } |
---|
1098 | if$ |
---|
1099 | format.bvolume output |
---|
1100 | format.number.series output |
---|
1101 | } |
---|
1102 | { format.incoll.inproc.crossref output.nonnull |
---|
1103 | } |
---|
1104 | if$ |
---|
1105 | format.date "year" output.check |
---|
1106 | inbook.date.block |
---|
1107 | format.pages "pages" output.check |
---|
1108 | new.block |
---|
1109 | format.note output |
---|
1110 | fin.entry |
---|
1111 | } |
---|
1112 | FUNCTION {conference} { inproceedings } |
---|
1113 | FUNCTION {manual} |
---|
1114 | { "%Type = Manual" write$ |
---|
1115 | output.bibitem |
---|
1116 | format.authors output |
---|
1117 | author format.key output |
---|
1118 | new.block |
---|
1119 | format.btitle "title" output.check |
---|
1120 | organization address new.block.checkb |
---|
1121 | organization "organization" bibinfo.check output |
---|
1122 | address "address" bibinfo.check output |
---|
1123 | format.edition output |
---|
1124 | format.date "year" output.check |
---|
1125 | inbook.date.block |
---|
1126 | format.pages "pages" output.check |
---|
1127 | new.block |
---|
1128 | format.note output |
---|
1129 | fin.entry |
---|
1130 | } |
---|
1131 | |
---|
1132 | FUNCTION {mastersthesis} |
---|
1133 | { "%Type = Masterthesis" write$ |
---|
1134 | output.bibitem |
---|
1135 | format.authors "author" output.check |
---|
1136 | author format.key output |
---|
1137 | new.block |
---|
1138 | format.btitle |
---|
1139 | "title" output.check |
---|
1140 | new.block |
---|
1141 | bbl.mthesis format.thesis.type output.nonnull |
---|
1142 | school "school" bibinfo.warn output |
---|
1143 | address "address" bibinfo.check output |
---|
1144 | format.date "year" output.check |
---|
1145 | new.block |
---|
1146 | format.note output |
---|
1147 | fin.entry |
---|
1148 | } |
---|
1149 | |
---|
1150 | FUNCTION {misc} |
---|
1151 | { "%Type = Misc" write$ |
---|
1152 | output.bibitem |
---|
1153 | format.authors output |
---|
1154 | author format.key output |
---|
1155 | new.block |
---|
1156 | format.title output |
---|
1157 | new.block |
---|
1158 | howpublished "howpublished" bibinfo.check output |
---|
1159 | format.date "year" output.check |
---|
1160 | new.block |
---|
1161 | format.note output |
---|
1162 | fin.entry |
---|
1163 | } |
---|
1164 | FUNCTION {phdthesis} |
---|
1165 | { "%Type = Phdthesis" write$ |
---|
1166 | output.bibitem |
---|
1167 | format.authors "author" output.check |
---|
1168 | author format.key output |
---|
1169 | new.block |
---|
1170 | format.btitle |
---|
1171 | "title" output.check |
---|
1172 | new.block |
---|
1173 | bbl.phdthesis format.thesis.type output.nonnull |
---|
1174 | school "school" bibinfo.warn output |
---|
1175 | address "address" bibinfo.check output |
---|
1176 | format.date "year" output.check |
---|
1177 | new.block |
---|
1178 | format.note output |
---|
1179 | fin.entry |
---|
1180 | } |
---|
1181 | |
---|
1182 | FUNCTION {proceedings} |
---|
1183 | { "%Type = Proceedings" write$ |
---|
1184 | output.bibitem |
---|
1185 | format.editors output |
---|
1186 | editor format.key output |
---|
1187 | new.block |
---|
1188 | format.btitle "title" output.check |
---|
1189 | format.bvolume output |
---|
1190 | format.number.series output |
---|
1191 | new.sentence |
---|
1192 | publisher empty$ |
---|
1193 | { format.organization.address output } |
---|
1194 | { organization "organization" bibinfo.check output |
---|
1195 | format.publisher.address output |
---|
1196 | } |
---|
1197 | if$ |
---|
1198 | format.date "year" output.check |
---|
1199 | new.block |
---|
1200 | format.note output |
---|
1201 | fin.entry |
---|
1202 | } |
---|
1203 | |
---|
1204 | FUNCTION {techreport} |
---|
1205 | { "%Type = Techreport" write$ |
---|
1206 | output.bibitem |
---|
1207 | format.authors "author" output.check |
---|
1208 | author format.key output |
---|
1209 | new.block |
---|
1210 | format.btitle |
---|
1211 | "title" output.check |
---|
1212 | new.block |
---|
1213 | format.tr.number output.nonnull |
---|
1214 | institution "institution" bibinfo.warn output |
---|
1215 | address "address" bibinfo.check output |
---|
1216 | format.date "year" output.check |
---|
1217 | new.block |
---|
1218 | format.note output |
---|
1219 | fin.entry |
---|
1220 | } |
---|
1221 | |
---|
1222 | FUNCTION {unpublished} |
---|
1223 | { "%Type = Unpublished" write$ |
---|
1224 | output.bibitem |
---|
1225 | format.authors "author" output.check |
---|
1226 | author format.key output |
---|
1227 | new.block |
---|
1228 | format.title "title" output.check |
---|
1229 | format.date "year" output.check |
---|
1230 | new.block |
---|
1231 | format.note "note" output.check |
---|
1232 | fin.entry |
---|
1233 | } |
---|
1234 | |
---|
1235 | FUNCTION {default.type} { misc } |
---|
1236 | READ |
---|
1237 | FUNCTION {sortify} |
---|
1238 | { purify$ |
---|
1239 | "l" change.case$ |
---|
1240 | } |
---|
1241 | INTEGERS { len } |
---|
1242 | FUNCTION {chop.word} |
---|
1243 | { 's := |
---|
1244 | 'len := |
---|
1245 | s #1 len substring$ = |
---|
1246 | { s len #1 + global.max$ substring$ } |
---|
1247 | 's |
---|
1248 | if$ |
---|
1249 | } |
---|
1250 | FUNCTION {format.lab.names} |
---|
1251 | { 's := |
---|
1252 | "" 't := |
---|
1253 | s #1 "{vv~}{ll}" format.name$ |
---|
1254 | s num.names$ duplicate$ |
---|
1255 | #2 > |
---|
1256 | { pop$ |
---|
1257 | " " * bbl.etal * |
---|
1258 | } |
---|
1259 | { #2 < |
---|
1260 | 'skip$ |
---|
1261 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = |
---|
1262 | { |
---|
1263 | " " * bbl.etal * |
---|
1264 | } |
---|
1265 | { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ |
---|
1266 | * } |
---|
1267 | if$ |
---|
1268 | } |
---|
1269 | if$ |
---|
1270 | } |
---|
1271 | if$ |
---|
1272 | } |
---|
1273 | |
---|
1274 | FUNCTION {author.key.label} |
---|
1275 | { author empty$ |
---|
1276 | { key empty$ |
---|
1277 | { cite$ #1 #3 substring$ } |
---|
1278 | 'key |
---|
1279 | if$ |
---|
1280 | } |
---|
1281 | { author format.lab.names } |
---|
1282 | if$ |
---|
1283 | } |
---|
1284 | |
---|
1285 | FUNCTION {author.editor.key.label} |
---|
1286 | { author empty$ |
---|
1287 | { editor empty$ |
---|
1288 | { key empty$ |
---|
1289 | { cite$ #1 #3 substring$ } |
---|
1290 | 'key |
---|
1291 | if$ |
---|
1292 | } |
---|
1293 | { editor format.lab.names } |
---|
1294 | if$ |
---|
1295 | } |
---|
1296 | { author format.lab.names } |
---|
1297 | if$ |
---|
1298 | } |
---|
1299 | |
---|
1300 | FUNCTION {editor.key.label} |
---|
1301 | { editor empty$ |
---|
1302 | { key empty$ |
---|
1303 | { cite$ #1 #3 substring$ } |
---|
1304 | 'key |
---|
1305 | if$ |
---|
1306 | } |
---|
1307 | { editor format.lab.names } |
---|
1308 | if$ |
---|
1309 | } |
---|
1310 | |
---|
1311 | FUNCTION {calc.short.authors} |
---|
1312 | { type$ "book" = |
---|
1313 | type$ "inbook" = |
---|
1314 | or |
---|
1315 | 'author.editor.key.label |
---|
1316 | { type$ "proceedings" = |
---|
1317 | 'editor.key.label |
---|
1318 | 'author.key.label |
---|
1319 | if$ |
---|
1320 | } |
---|
1321 | if$ |
---|
1322 | 'short.list := |
---|
1323 | } |
---|
1324 | |
---|
1325 | FUNCTION {calc.label} |
---|
1326 | { calc.short.authors |
---|
1327 | short.list |
---|
1328 | "(" |
---|
1329 | * |
---|
1330 | year duplicate$ empty$ |
---|
1331 | short.list key field.or.null = or |
---|
1332 | { pop$ "" } |
---|
1333 | 'skip$ |
---|
1334 | if$ |
---|
1335 | * |
---|
1336 | 'label := |
---|
1337 | } |
---|
1338 | |
---|
1339 | FUNCTION {sort.format.names} |
---|
1340 | { 's := |
---|
1341 | #1 'nameptr := |
---|
1342 | "" |
---|
1343 | s num.names$ 'numnames := |
---|
1344 | numnames 'namesleft := |
---|
1345 | { namesleft #0 > } |
---|
1346 | { s nameptr |
---|
1347 | "{ll{ }}{ f{ }}{ jj{ }}" |
---|
1348 | format.name$ 't := |
---|
1349 | nameptr #1 > |
---|
1350 | { |
---|
1351 | " " * |
---|
1352 | namesleft #1 = t "others" = and |
---|
1353 | { "zzzzz" * } |
---|
1354 | { t sortify * } |
---|
1355 | if$ |
---|
1356 | } |
---|
1357 | { t sortify * } |
---|
1358 | if$ |
---|
1359 | nameptr #1 + 'nameptr := |
---|
1360 | namesleft #1 - 'namesleft := |
---|
1361 | } |
---|
1362 | while$ |
---|
1363 | } |
---|
1364 | |
---|
1365 | FUNCTION {sort.format.title} |
---|
1366 | { 't := |
---|
1367 | "A " #2 |
---|
1368 | "An " #3 |
---|
1369 | "The " #4 t chop.word |
---|
1370 | chop.word |
---|
1371 | chop.word |
---|
1372 | sortify |
---|
1373 | #1 global.max$ substring$ |
---|
1374 | } |
---|
1375 | FUNCTION {author.sort} |
---|
1376 | { author empty$ |
---|
1377 | { key empty$ |
---|
1378 | { "to sort, need author or key in " cite$ * warning$ |
---|
1379 | "" |
---|
1380 | } |
---|
1381 | { key sortify } |
---|
1382 | if$ |
---|
1383 | } |
---|
1384 | { author sort.format.names } |
---|
1385 | if$ |
---|
1386 | } |
---|
1387 | FUNCTION {author.editor.sort} |
---|
1388 | { author empty$ |
---|
1389 | { editor empty$ |
---|
1390 | { key empty$ |
---|
1391 | { "to sort, need author, editor, or key in " cite$ * warning$ |
---|
1392 | "" |
---|
1393 | } |
---|
1394 | { key sortify } |
---|
1395 | if$ |
---|
1396 | } |
---|
1397 | { editor sort.format.names } |
---|
1398 | if$ |
---|
1399 | } |
---|
1400 | { author sort.format.names } |
---|
1401 | if$ |
---|
1402 | } |
---|
1403 | FUNCTION {editor.sort} |
---|
1404 | { editor empty$ |
---|
1405 | { key empty$ |
---|
1406 | { "to sort, need editor or key in " cite$ * warning$ |
---|
1407 | "" |
---|
1408 | } |
---|
1409 | { key sortify } |
---|
1410 | if$ |
---|
1411 | } |
---|
1412 | { editor sort.format.names } |
---|
1413 | if$ |
---|
1414 | } |
---|
1415 | FUNCTION {presort} |
---|
1416 | { calc.label |
---|
1417 | label sortify |
---|
1418 | " " |
---|
1419 | * |
---|
1420 | type$ "book" = |
---|
1421 | type$ "inbook" = |
---|
1422 | or |
---|
1423 | 'author.editor.sort |
---|
1424 | { type$ "proceedings" = |
---|
1425 | 'editor.sort |
---|
1426 | 'author.sort |
---|
1427 | if$ |
---|
1428 | } |
---|
1429 | if$ |
---|
1430 | #1 entry.max$ substring$ |
---|
1431 | 'sort.label := |
---|
1432 | sort.label |
---|
1433 | * |
---|
1434 | " " |
---|
1435 | * |
---|
1436 | title field.or.null |
---|
1437 | sort.format.title |
---|
1438 | * |
---|
1439 | #1 entry.max$ substring$ |
---|
1440 | 'sort.key$ := |
---|
1441 | } |
---|
1442 | |
---|
1443 | ITERATE {presort} |
---|
1444 | SORT |
---|
1445 | STRINGS { last.label next.extra } |
---|
1446 | INTEGERS { last.extra.num number.label } |
---|
1447 | FUNCTION {initialize.extra.label.stuff} |
---|
1448 | { #0 int.to.chr$ 'last.label := |
---|
1449 | "" 'next.extra := |
---|
1450 | #0 'last.extra.num := |
---|
1451 | #0 'number.label := |
---|
1452 | } |
---|
1453 | FUNCTION {forward.pass} |
---|
1454 | { last.label label = |
---|
1455 | { last.extra.num #1 + 'last.extra.num := |
---|
1456 | last.extra.num int.to.chr$ 'extra.label := |
---|
1457 | } |
---|
1458 | { "a" chr.to.int$ 'last.extra.num := |
---|
1459 | "" 'extra.label := |
---|
1460 | label 'last.label := |
---|
1461 | } |
---|
1462 | if$ |
---|
1463 | number.label #1 + 'number.label := |
---|
1464 | } |
---|
1465 | FUNCTION {reverse.pass} |
---|
1466 | { next.extra "b" = |
---|
1467 | { "a" 'extra.label := } |
---|
1468 | 'skip$ |
---|
1469 | if$ |
---|
1470 | extra.label 'next.extra := |
---|
1471 | extra.label |
---|
1472 | duplicate$ empty$ |
---|
1473 | 'skip$ |
---|
1474 | { "{\natexlab{" swap$ * "}}" * } |
---|
1475 | if$ |
---|
1476 | 'extra.label := |
---|
1477 | label extra.label * 'label := |
---|
1478 | } |
---|
1479 | EXECUTE {initialize.extra.label.stuff} |
---|
1480 | ITERATE {forward.pass} |
---|
1481 | REVERSE {reverse.pass} |
---|
1482 | FUNCTION {bib.sort.order} |
---|
1483 | { sort.label |
---|
1484 | " " |
---|
1485 | * |
---|
1486 | year field.or.null sortify |
---|
1487 | * |
---|
1488 | " " |
---|
1489 | * |
---|
1490 | title field.or.null |
---|
1491 | sort.format.title |
---|
1492 | * |
---|
1493 | #1 entry.max$ substring$ |
---|
1494 | 'sort.key$ := |
---|
1495 | } |
---|
1496 | ITERATE {bib.sort.order} |
---|
1497 | SORT |
---|
1498 | FUNCTION {begin.bib} |
---|
1499 | { preamble$ empty$ |
---|
1500 | 'skip$ |
---|
1501 | { preamble$ write$ newline$ } |
---|
1502 | if$ |
---|
1503 | "\begin{thebibliography}{" number.label int.to.str$ * "}" * |
---|
1504 | write$ newline$ |
---|
1505 | "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi" |
---|
1506 | write$ newline$ |
---|
1507 | "\providecommand{\bibinfo}[2]{#2}" |
---|
1508 | write$ newline$ |
---|
1509 | "\ifx\xfnm\undefined \def\xfnm[#1]{\unskip,\space#1}\fi" |
---|
1510 | write$ newline$ |
---|
1511 | } |
---|
1512 | EXECUTE {begin.bib} |
---|
1513 | EXECUTE {init.state.consts} |
---|
1514 | ITERATE {call.type$} |
---|
1515 | FUNCTION {end.bib} |
---|
1516 | { newline$ |
---|
1517 | "\end{thebibliography}" write$ newline$ |
---|
1518 | } |
---|
1519 | EXECUTE {end.bib} |
---|
1520 | %% End of customized bst file |
---|
1521 | %% |
---|
1522 | %% End of file `model4-names.bst'. |
---|
1523 | |
---|