Debian Codegraph @

texmf-dist/bibtex/bst/bibhtml/alphahtmldater.bst

raw
1 %%
2 %% DO NOT EDIT
3 %%
4 %% This is alphahtmldater.bst, edited from alphahtml.bst by alphahtmldater.sed
5 %%
6 %% alphahtml.bst
7 %%
8 %% Part of bibhtml, version 2.0.2, released 2013 September 8
9 %% Hg node 7076ce83a035.
10 %% See <http://purl.org/nxg/dist/bibhtml>
11 %%
12 %% Copyright 1999, 2005, 2006, 2009, Norman Gray <[email protected]>
13 %%
14 %% This is a modification of a modification!
15 %%
16 %%% Modification of BibTeX style file /usr/local/texlive/2008/texmf-dist/bibtex/bst/base/alpha.bst
17 %%% ... by urlbst, version 0.6-4 (marked with "% urlbst")
18 %%% See <http://purl.org/nxg/dist/urlbst>
19 %%% Added webpage entry type, and url and lastchecked fields.
20 %%% Added eprint support.
21 %%% Added DOI support.
22 %%% Added PUBMED support.
23 %%% Added hyperref support.
24 %%% Original headers follow...
25 ENTRY
26 { address
27 author
28 booktitle
29 chapter
30 edition
31 editor
32 howpublished
33 institution
34 journal
35 key
36 month
37 note
38 number
39 organization
40 pages
41 publisher
42 school
43 series
44 title
45 type
46 volume
47 year
48 eprint % urlbst
49 doi % urlbst
50 pubmed % urlbst
51 url % urlbst
52 lastchecked % urlbst
53 }
54 {}
55 { label extra.label sort.label }
56 INTEGERS { output.state before.all mid.sentence after.sentence after.block doiform }
57 STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
58 INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
59 FUNCTION {init.urlbst.variables}
60 {
61 "Available from: " 'urlintro := % prefix before URL
62 "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
63 "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
64 "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
65 "doi:" 'doiprefix := % text prefix printed before DOI ref
66 "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED
67 "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref
68 #1 'addeprints := % 0=no eprints; 1=include eprints
69 #1 'adddoiresolver := % 0=no DOI resolver; 1=include it
70 #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it
71 #1 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles
72 #1 'doiform := % 0=simple, but can produce invalid HTML; 1=needs post-processing
73 #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink
74 "" 'openinlinelink := % ditto
75 "" 'closeinlinelink := % ditto
76 }
77 INTEGERS {
78 bracket.state
79 outside.brackets
80 open.brackets
81 within.brackets
82 close.brackets
83 close.first.block
84 }
85 FUNCTION {init.state.consts}
86 { #0 'outside.brackets := % urlbst
87 #1 'open.brackets :=
88 #2 'within.brackets :=
89 #3 'close.brackets :=
90 #0 'before.all :=
91 #1 'mid.sentence :=
92 #2 'after.sentence :=
93 #3 'after.block :=
94 #0 'close.first.block :=
95 }
96 STRINGS { s t }
97 FUNCTION {output.nonnull.original}
98 { 's :=
99 output.state mid.sentence =
100 { ", " * write$ }
101 { output.state after.block =
102 { add.period$ write$
103 close.first.block
104 { "</a></dt>" write$ newline$ "<dd>" write$
105 #0 'close.first.block := }
106 { newline$ }
107 if$
108 }
109 { output.state before.all =
110 'write$
111 { add.period$ " " * write$ }
112 if$
113 }
114 if$
115 mid.sentence 'output.state :=
116 }
117 if$
118 s
119 }
120 FUNCTION {possibly.setup.inlinelink}
121 { makeinlinelink
122 { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
123 "</a>" 'closeinlinelink :=
124 #0 'makeinlinelink := }
125 'skip$
126 if$ % makeinlinelink
127 }
128 FUNCTION {add.inlinelink}
129 { openinlinelink empty$
130 'skip$
131 { openinlinelink swap$ * closeinlinelink *
132 "" 'openinlinelink :=
133 }
134 if$
135 }
136 FUNCTION {output.nonnull}
137 { % Save the thing we've been asked to output
138 's :=
139 bracket.state close.brackets =
140 { "]" *
141 outside.brackets 'bracket.state :=
142 }
143 'skip$
144 if$
145 bracket.state outside.brackets =
146 { % We're outside all brackets -- this is the normal situation.
147 s
148 add.inlinelink
149 output.nonnull.original % invoke the original output.nonnull
150 }
151 { % Still in brackets. Add open-bracket or (continuation) comma, add the
152 bracket.state open.brackets =
153 { " [" * }
154 { ", " * } % bracket.state will be within.brackets
155 if$
156 s *
157 close.brackets 'bracket.state :=
158 }
159 if$
160 }
161 FUNCTION {inbrackets}
162 { bracket.state close.brackets =
163 { within.brackets 'bracket.state := } % reset the state: not open nor closed
164 { open.brackets 'bracket.state := }
165 if$
166 }
167 FUNCTION {format.lastchecked}
168 { lastchecked empty$
169 { "" }
170 { inbrackets "cited " lastchecked * }
171 if$
172 }
173 FUNCTION {output}
174 { duplicate$ empty$
175 'pop$
176 'output.nonnull
177 if$
178 }
179 FUNCTION {output.check}
180 { 't :=
181 duplicate$ empty$
182 { pop$ "empty " t * " in " * cite$ * warning$ }
183 'output.nonnull
184 if$
185 }
186 FUNCTION {output.bibitem.original}
187 { newline$
188 "<dt><a name='" write$
189 cite$ write$
190 "'>[" cite$ * "] " * write$
191 #1 'close.first.block :=
192 newline$
193 ""
194 before.all 'output.state :=
195 }
196 FUNCTION {fin.entry.original}
197 { add.period$ "</dd>" *
198 write$
199 newline$
200 }
201 FUNCTION {new.block}
202 { output.state before.all =
203 'skip$
204 { after.block 'output.state := }
205 if$
206 }
207 FUNCTION {new.sentence}
208 { output.state after.block =
209 'skip$
210 { output.state before.all =
211 'skip$
212 { after.sentence 'output.state := }
213 if$
214 }
215 if$
216 }
217 FUNCTION {not}
218 { { #0 }
219 { #1 }
220 if$
221 }
222 FUNCTION {and}
223 { 'skip$
224 { pop$ #0 }
225 if$
226 }
227 FUNCTION {or}
228 { { pop$ #1 }
229 'skip$
230 if$
231 }
232 FUNCTION {new.block.checka}
233 { empty$
234 'skip$
235 'new.block
236 if$
237 }
238 FUNCTION {new.block.checkb}
239 { empty$
240 swap$ empty$
241 and
242 'skip$
243 'new.block
244 if$
245 }
246 FUNCTION {new.sentence.checka}
247 { empty$
248 'skip$
249 'new.sentence
250 if$
251 }
252 FUNCTION {new.sentence.checkb}
253 { empty$
254 swap$ empty$
255 and
256 'skip$
257 'new.sentence
258 if$
259 }
260 FUNCTION {field.or.null}
261 { duplicate$ empty$
262 { pop$ "" }
263 'skip$
264 if$
265 }
266 FUNCTION {emphasize}
267 { duplicate$ empty$
268 { pop$ "" }
269 { "<em>" swap$ * "</em>" * }
270 if$
271 }
272 INTEGERS { nameptr namesleft numnames }
273 FUNCTION {format.names}
274 { 's :=
275 #1 'nameptr :=
276 s num.names$ 'numnames :=
277 numnames 'namesleft :=
278 { namesleft #0 > }
279 { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
280 nameptr #1 >
281 { namesleft #1 >
282 { ", " * t * }
283 { numnames #2 >
284 { "," * }
285 'skip$
286 if$
287 t "others" =
288 { " et~al." * }
289 { " and " * t * }
290 if$
291 }
292 if$
293 }
294 't
295 if$
296 nameptr #1 + 'nameptr :=
297 namesleft #1 - 'namesleft :=
298 }
299 while$
300 }
301 FUNCTION {format.authors}
302 { author empty$
303 { "" }
304 { author format.names }
305 if$
306 }
307 FUNCTION {format.editors}
308 { editor empty$
309 { "" }
310 { editor format.names
311 editor num.names$ #1 >
312 { ", editors" * }
313 { ", editor" * }
314 if$
315 }
316 if$
317 }
318 FUNCTION {format.title}
319 { title empty$
320 { "" }
321 { title "t" change.case$ }
322 if$
323 }
324 FUNCTION {n.dashify}
325 { 't :=
326 ""
327 { t empty$ not }
328 { t #1 #1 substring$ "-" =
329 { t #1 #2 substring$ "--" = not
330 { "--" *
331 t #2 global.max$ substring$ 't :=
332 }
333 { { t #1 #1 substring$ "-" = }
334 { "-" *
335 t #2 global.max$ substring$ 't :=
336 }
337 while$
338 }
339 if$
340 }
341 { t #1 #1 substring$ *
342 t #2 global.max$ substring$ 't :=
343 }
344 if$
345 }
346 while$
347 }
348 FUNCTION {format.date}
349 { year empty$
350 { month empty$
351 { "" }
352 { "there's a month but no year in " cite$ * warning$
353 month
354 }
355 if$
356 }
357 { month empty$
358 'year
359 { month " " * year * }
360 if$
361 }
362 if$
363 }
364 FUNCTION {format.btitle}
365 { title emphasize
366 }
367 FUNCTION {tie.or.space.connect}
368 { duplicate$ text.length$ #3 <
369 { "~" }
370 { " " }
371 if$
372 swap$ * *
373 }
374 FUNCTION {either.or.check}
375 { empty$
376 'pop$
377 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
378 if$
379 }
380 FUNCTION {format.bvolume}
381 { volume empty$
382 { "" }
383 { "volume" volume tie.or.space.connect
384 series empty$
385 'skip$
386 { " of " * series emphasize * }
387 if$
388 "volume and number" number either.or.check
389 }
390 if$
391 }
392 FUNCTION {format.number.series}
393 { volume empty$
394 { number empty$
395 { series field.or.null }
396 { output.state mid.sentence =
397 { "number" }
398 { "Number" }
399 if$
400 number tie.or.space.connect
401 series empty$
402 { "there's a number but no series in " cite$ * warning$ }
403 { " in " * series * }
404 if$
405 }
406 if$
407 }
408 { "" }
409 if$
410 }
411 FUNCTION {format.edition}
412 { edition empty$
413 { "" }
414 { output.state mid.sentence =
415 { edition "l" change.case$ " edition" * }
416 { edition "t" change.case$ " edition" * }
417 if$
418 }
419 if$
420 }
421 INTEGERS { multiresult }
422 FUNCTION {multi.page.check}
423 { 't :=
424 #0 'multiresult :=
425 { multiresult not
426 t empty$ not
427 and
428 }
429 { t #1 #1 substring$
430 duplicate$ "-" =
431 swap$ duplicate$ "," =
432 swap$ "+" =
433 or or
434 { #1 'multiresult := }
435 { t #2 global.max$ substring$ 't := }
436 if$
437 }
438 while$
439 multiresult
440 }
441 FUNCTION {format.pages}
442 { pages empty$
443 { "" }
444 { pages multi.page.check
445 { "pages" pages n.dashify tie.or.space.connect }
446 { "page" pages tie.or.space.connect }
447 if$
448 }
449 if$
450 }
451 FUNCTION {format.vol.num.pages}
452 { volume field.or.null
453 number empty$
454 'skip$
455 { "(" number * ")" * *
456 volume empty$
457 { "there's a number but no volume in " cite$ * warning$ }
458 'skip$
459 if$
460 }
461 if$
462 pages empty$
463 'skip$
464 { duplicate$ empty$
465 { pop$ format.pages }
466 { ":" * pages n.dashify * }
467 if$
468 }
469 if$
470 }
471 FUNCTION {format.chapter.pages}
472 { chapter empty$
473 'format.pages
474 { type empty$
475 { "chapter" }
476 { type "l" change.case$ }
477 if$
478 chapter tie.or.space.connect
479 pages empty$
480 'skip$
481 { ", " * format.pages * }
482 if$
483 }
484 if$
485 }
486 FUNCTION {format.in.ed.booktitle}
487 { booktitle empty$
488 { "" }
489 { editor empty$
490 { "In " booktitle emphasize * }
491 { "In " format.editors * ", " * booktitle emphasize * }
492 if$
493 }
494 if$
495 }
496 FUNCTION {empty.misc.check}
497 { author empty$ title empty$ howpublished empty$
498 month empty$ year empty$ note empty$
499 and and and and and
500 key empty$ not and
501 { "all relevant fields are empty in " cite$ * warning$ }
502 'skip$
503 if$
504 }
505 FUNCTION {format.thesis.type}
506 { type empty$
507 'skip$
508 { pop$
509 type "t" change.case$
510 }
511 if$
512 }
513 FUNCTION {format.tr.number}
514 { type empty$
515 { "Technical Report" }
516 'type
517 if$
518 number empty$
519 { "t" change.case$ }
520 { number tie.or.space.connect }
521 if$
522 }
523 FUNCTION {format.article.crossref}
524 { key empty$
525 { journal empty$
526 { "need key or journal for " cite$ * " to crossref " * crossref *
527 warning$
528 ""
529 }
530 { "In {\em " journal * "\/}" * }
531 if$
532 }
533 { "In " key * }
534 if$
535 " <span class='cite'>" * crossref * "</span>" *
536 }
537 FUNCTION {format.crossref.editor}
538 { editor #1 "{vv~}{ll}" format.name$
539 editor num.names$ duplicate$
540 #2 >
541 { pop$ " et~al." * }
542 { #2 <
543 'skip$
544 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
545 { " et~al." * }
546 { " and " * editor #2 "{vv~}{ll}" format.name$ * }
547 if$
548 }
549 if$
550 }
551 if$
552 }
553 FUNCTION {format.book.crossref}
554 { volume empty$
555 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
556 "In "
557 }
558 { "Volume" volume tie.or.space.connect
559 " of " *
560 }
561 if$
562 editor empty$
563 editor field.or.null author field.or.null =
564 or
565 { key empty$
566 { series empty$
567 { "need editor, key, or series for " cite$ * " to crossref " *
568 crossref * warning$
569 "" *
570 }
571 { "<em>" * series * "</em>" * }
572 if$
573 }
574 { key * }
575 if$
576 }
577 { format.crossref.editor * }
578 if$
579 " <span class='cite'>" * crossref * "</span>" *
580 }
581 FUNCTION {format.incoll.inproc.crossref}
582 { editor empty$
583 editor field.or.null author field.or.null =
584 or
585 { key empty$
586 { booktitle empty$
587 { "need editor, key, or booktitle for " cite$ * " to crossref " *
588 crossref * warning$
589 ""
590 }
591 { "In <em>" booktitle * "</em>" * }
592 if$
593 }
594 { "In " key * }
595 if$
596 }
597 { "In " format.crossref.editor * }
598 if$
599 " <span class='cite'>" * crossref * "</span>" *
600 }
601 FUNCTION {make.href}
602 {
603 "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
604 }
605 FUNCTION {format.url}
606 { inlinelinks #1 = url empty$ or
607 { "" }
608 { urlintro "<code>" * url * "</code>" * }
609 if$
610 }
611 FUNCTION {format.eprint}
612 { eprint empty$
613 { "" }
614 { eprintprefix eprint * eprinturl eprint * make.href }
615 if$
616 }
617 FUNCTION {format.doi}
618 { doi empty$
619 { "" }
620 { doiform #0 =
621 { doiprefix doi * doiurl doi * make.href }
622 { "DOI:{" doi * "}" * }
623 if$
624 }
625 if$
626 }
627 FUNCTION {format.pubmed}
628 { pubmed empty$
629 { "" }
630 { pubmedprefix pubmed * pubmedurl pubmed * make.href }
631 if$
632 }
633 FUNCTION {output.url}
634 { url empty$
635 'skip$
636 { new.block
637 format.url output
638 format.lastchecked output
639 }
640 if$
641 }
642 FUNCTION {output.web.refs}
643 {
644 new.block
645 output.url
646 addeprints eprint empty$ not and
647 { format.eprint output.nonnull }
648 'skip$
649 if$
650 adddoiresolver doi empty$ not and
651 { format.doi output.nonnull }
652 'skip$
653 if$
654 addpubmedresolver pubmed empty$ not and
655 { format.pubmed output.nonnull }
656 'skip$
657 if$
658 }
659 FUNCTION {output.bibitem}
660 { outside.brackets 'bracket.state :=
661 output.bibitem.original
662 inlinelinks url empty$ not and
663 { #1 'makeinlinelink := }
664 { #0 'makeinlinelink := }
665 if$
666 }
667 FUNCTION {fin.entry}
668 { output.web.refs % urlbst
669 makeinlinelink % ooops, it appears we didn't have a title for inlinelink
670 { possibly.setup.inlinelink % add some artificial link text here, as a fallback
671 "[link]" output.nonnull }
672 'skip$
673 if$
674 bracket.state close.brackets = % urlbst
675 { "]" * }
676 'skip$
677 if$
678 fin.entry.original
679 }
680 FUNCTION {webpage}
681 { output.bibitem
682 author empty$
683 { editor empty$
684 'skip$ % author and editor both optional
685 { format.editors output.nonnull }
686 if$
687 }
688 { editor empty$
689 { format.authors output.nonnull }
690 { "can't use both author and editor fields in " cite$ * warning$ }
691 if$
692 }
693 if$
694 new.block
695 title empty$ 'skip$ 'possibly.setup.inlinelink if$
696 format.title "title" output.check
697 inbrackets "online" output
698 new.block
699 year empty$
700 'skip$
701 { format.date "year" output.check }
702 if$
703 new.block
704 note output
705 fin.entry
706 }
707 FUNCTION {article}
708 { output.bibitem
709 format.authors "author" output.check
710 new.block
711 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
712 format.title "title" output.check
713 new.block
714 crossref missing$
715 { journal emphasize "journal" output.check
716 possibly.setup.inlinelink format.vol.num.pages output% urlbst
717 format.date "year" output.check
718 }
719 { format.article.crossref output.nonnull
720 format.pages output
721 }
722 if$
723 new.block
724 note output
725 fin.entry
726 }
727 FUNCTION {book}
728 { output.bibitem
729 author empty$
730 { format.editors "author and editor" output.check }
731 { format.authors output.nonnull
732 crossref missing$
733 { "author and editor" editor either.or.check }
734 'skip$
735 if$
736 }
737 if$
738 new.block
739 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
740 format.btitle "title" output.check
741 crossref missing$
742 { format.bvolume output
743 new.block
744 format.number.series output
745 new.sentence
746 publisher "publisher" output.check
747 address output
748 }
749 { new.block
750 format.book.crossref output.nonnull
751 }
752 if$
753 format.edition output
754 format.date "year" output.check
755 new.block
756 note output
757 fin.entry
758 }
759 FUNCTION {booklet}
760 { output.bibitem
761 format.authors output
762 new.block
763 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
764 format.title "title" output.check
765 howpublished address new.block.checkb
766 howpublished output
767 address output
768 format.date output
769 new.block
770 note output
771 fin.entry
772 }
773 FUNCTION {inbook}
774 { output.bibitem
775 author empty$
776 { format.editors "author and editor" output.check }
777 { format.authors output.nonnull
778 crossref missing$
779 { "author and editor" editor either.or.check }
780 'skip$
781 if$
782 }
783 if$
784 new.block
785 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
786 format.btitle "title" output.check
787 crossref missing$
788 { format.bvolume output
789 format.chapter.pages "chapter and pages" output.check
790 new.block
791 format.number.series output
792 new.sentence
793 publisher "publisher" output.check
794 address output
795 }
796 { format.chapter.pages "chapter and pages" output.check
797 new.block
798 format.book.crossref output.nonnull
799 }
800 if$
801 format.edition output
802 format.date "year" output.check
803 new.block
804 note output
805 fin.entry
806 }
807 FUNCTION {incollection}
808 { output.bibitem
809 format.authors "author" output.check
810 new.block
811 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
812 format.title "title" output.check
813 new.block
814 crossref missing$
815 { format.in.ed.booktitle "booktitle" output.check
816 format.bvolume output
817 format.number.series output
818 format.chapter.pages output
819 new.sentence
820 publisher "publisher" output.check
821 address output
822 format.edition output
823 format.date "year" output.check
824 }
825 { format.incoll.inproc.crossref output.nonnull
826 format.chapter.pages output
827 }
828 if$
829 new.block
830 note output
831 fin.entry
832 }
833 FUNCTION {inproceedings}
834 { output.bibitem
835 format.authors "author" output.check
836 new.block
837 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
838 format.title "title" output.check
839 new.block
840 crossref missing$
841 { format.in.ed.booktitle "booktitle" output.check
842 format.bvolume output
843 format.number.series output
844 format.pages output
845 address empty$
846 { organization publisher new.sentence.checkb
847 organization output
848 publisher output
849 format.date "year" output.check
850 }
851 { address output.nonnull
852 format.date "year" output.check
853 new.sentence
854 organization output
855 publisher output
856 }
857 if$
858 }
859 { format.incoll.inproc.crossref output.nonnull
860 format.pages output
861 }
862 if$
863 new.block
864 note output
865 fin.entry
866 }
867 FUNCTION {conference} { inproceedings }
868 FUNCTION {manual}
869 { output.bibitem
870 author empty$
871 { organization empty$
872 'skip$
873 { organization output.nonnull
874 address output
875 }
876 if$
877 }
878 { format.authors output.nonnull }
879 if$
880 new.block
881 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
882 format.btitle "title" output.check
883 author empty$
884 { organization empty$
885 { address new.block.checka
886 address output
887 }
888 'skip$
889 if$
890 }
891 { organization address new.block.checkb
892 organization output
893 address output
894 }
895 if$
896 format.edition output
897 format.date output
898 new.block
899 note output
900 fin.entry
901 }
902 FUNCTION {mastersthesis}
903 { output.bibitem
904 format.authors "author" output.check
905 new.block
906 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
907 format.title "title" output.check
908 new.block
909 "Master's thesis" format.thesis.type output.nonnull
910 school "school" output.check
911 address output
912 format.date "year" output.check
913 new.block
914 note output
915 fin.entry
916 }
917 FUNCTION {misc}
918 { output.bibitem
919 format.authors output
920 title howpublished new.block.checkb
921 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
922 format.title output
923 howpublished new.block.checka
924 howpublished output
925 format.date output
926 new.block
927 note output
928 fin.entry
929 empty.misc.check
930 }
931 FUNCTION {phdthesis}
932 { output.bibitem
933 format.authors "author" output.check
934 new.block
935 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
936 format.btitle "title" output.check
937 new.block
938 "PhD thesis" format.thesis.type output.nonnull
939 school "school" output.check
940 address output
941 format.date "year" output.check
942 new.block
943 note output
944 fin.entry
945 }
946 FUNCTION {proceedings}
947 { output.bibitem
948 editor empty$
949 { organization output }
950 { format.editors output.nonnull }
951 if$
952 new.block
953 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
954 format.btitle "title" output.check
955 format.bvolume output
956 format.number.series output
957 address empty$
958 { editor empty$
959 { publisher new.sentence.checka }
960 { organization publisher new.sentence.checkb
961 organization output
962 }
963 if$
964 publisher output
965 format.date "year" output.check
966 }
967 { address output.nonnull
968 format.date "year" output.check
969 new.sentence
970 editor empty$
971 'skip$
972 { organization output }
973 if$
974 publisher output
975 }
976 if$
977 new.block
978 note output
979 fin.entry
980 }
981 FUNCTION {techreport}
982 { output.bibitem
983 format.authors "author" output.check
984 new.block
985 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
986 format.title "title" output.check
987 new.block
988 format.tr.number output.nonnull
989 institution "institution" output.check
990 address output
991 format.date "year" output.check
992 new.block
993 note output
994 fin.entry
995 }
996 FUNCTION {unpublished}
997 { output.bibitem
998 format.authors "author" output.check
999 new.block
1000 title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
1001 format.title "title" output.check
1002 new.block
1003 note "note" output.check
1004 format.date output
1005 fin.entry
1006 }
1007 FUNCTION {default.type} { misc }
1008 MACRO {jan} {"January"}
1009 MACRO {feb} {"February"}
1010 MACRO {mar} {"March"}
1011 MACRO {apr} {"April"}
1012 MACRO {may} {"May"}
1013 MACRO {jun} {"June"}
1014 MACRO {jul} {"July"}
1015 MACRO {aug} {"August"}
1016 MACRO {sep} {"September"}
1017 MACRO {oct} {"October"}
1018 MACRO {nov} {"November"}
1019 MACRO {dec} {"December"}
1020 MACRO {acmcs} {"ACM Computing Surveys"}
1021 MACRO {acta} {"Acta Informatica"}
1022 MACRO {cacm} {"Communications of the ACM"}
1023 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1024 MACRO {ibmsj} {"IBM Systems Journal"}
1025 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1026 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1027 MACRO {ieeetcad}
1028 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1029 MACRO {ipl} {"Information Processing Letters"}
1030 MACRO {jacm} {"Journal of the ACM"}
1031 MACRO {jcss} {"Journal of Computer and System Sciences"}
1032 MACRO {scp} {"Science of Computer Programming"}
1033 MACRO {sicomp} {"SIAM Journal on Computing"}
1034 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1035 MACRO {tods} {"ACM Transactions on Database Systems"}
1036 MACRO {tog} {"ACM Transactions on Graphics"}
1037 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1038 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1039 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1040 MACRO {tcs} {"Theoretical Computer Science"}
1041 READ
1042 FUNCTION {sortify}
1043 { purify$
1044 "l" change.case$
1045 }
1046 INTEGERS { len }
1047 FUNCTION {chop.word}
1048 { 's :=
1049 'len :=
1050 s #1 len substring$ =
1051 { s len #1 + global.max$ substring$ }
1052 's
1053 if$
1054 }
1055 INTEGERS { et.al.char.used }
1056 FUNCTION {initialize.et.al.char.used}
1057 { #0 'et.al.char.used :=
1058 }
1059 EXECUTE {initialize.et.al.char.used}
1060 FUNCTION {format.lab.names}
1061 { 's :=
1062 s num.names$ 'numnames :=
1063 numnames #1 >
1064 { numnames #4 >
1065 { #3 'namesleft := }
1066 { numnames 'namesleft := }
1067 if$
1068 #1 'nameptr :=
1069 ""
1070 { namesleft #0 > }
1071 { nameptr numnames =
1072 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1073 { "{\etalchar{+}}" *
1074 #1 'et.al.char.used :=
1075 }
1076 { s nameptr "{v{}}{l{}}" format.name$ * }
1077 if$
1078 }
1079 { s nameptr "{v{}}{l{}}" format.name$ * }
1080 if$
1081 nameptr #1 + 'nameptr :=
1082 namesleft #1 - 'namesleft :=
1083 }
1084 while$
1085 numnames #4 >
1086 { "{\etalchar{+}}" *
1087 #1 'et.al.char.used :=
1088 }
1089 'skip$
1090 if$
1091 }
1092 { s #1 "{v{}}{l{}}" format.name$
1093 duplicate$ text.length$ #2 <
1094 { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1095 'skip$
1096 if$
1097 }
1098 if$
1099 }
1100 FUNCTION {author.key.label}
1101 { author empty$
1102 { key empty$
1103 { cite$ #1 #3 substring$ }
1104 { key #3 text.prefix$ }
1105 if$
1106 }
1107 { author format.lab.names }
1108 if$
1109 }
1110 FUNCTION {author.editor.key.label}
1111 { author empty$
1112 { editor empty$
1113 { key empty$
1114 { cite$ #1 #3 substring$ }
1115 { key #3 text.prefix$ }
1116 if$
1117 }
1118 { editor format.lab.names }
1119 if$
1120 }
1121 { author format.lab.names }
1122 if$
1123 }
1124 FUNCTION {author.key.organization.label}
1125 { author empty$
1126 { key empty$
1127 { organization empty$
1128 { cite$ #1 #3 substring$ }
1129 { "The " #4 organization chop.word #3 text.prefix$ }
1130 if$
1131 }
1132 { key #3 text.prefix$ }
1133 if$
1134 }
1135 { author format.lab.names }
1136 if$
1137 }
1138 FUNCTION {editor.key.organization.label}
1139 { editor empty$
1140 { key empty$
1141 { organization empty$
1142 { cite$ #1 #3 substring$ }
1143 { "The " #4 organization chop.word #3 text.prefix$ }
1144 if$
1145 }
1146 { key #3 text.prefix$ }
1147 if$
1148 }
1149 { editor format.lab.names }
1150 if$
1151 }
1152 FUNCTION {calc.label}
1153 { type$ "book" =
1154 type$ "inbook" =
1155 or
1156 'author.editor.key.label
1157 { type$ "proceedings" =
1158 'editor.key.organization.label
1159 { type$ "manual" =
1160 'author.key.organization.label
1161 'author.key.label
1162 if$
1163 }
1164 if$
1165 }
1166 if$
1167 duplicate$
1168 year field.or.null purify$ #-1 #2 substring$
1169 *
1170 'label :=
1171 year field.or.null purify$ #-1 #4 substring$
1172 *
1173 sortify 'sort.label :=
1174 }
1175 FUNCTION {sort.format.names}
1176 { 's :=
1177 #1 'nameptr :=
1178 ""
1179 s num.names$ 'numnames :=
1180 numnames 'namesleft :=
1181 { namesleft #0 > }
1182 { nameptr #1 >
1183 { " " * }
1184 'skip$
1185 if$
1186 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1187 nameptr numnames = t "others" = and
1188 { "et al" * }
1189 { t sortify * }
1190 if$
1191 nameptr #1 + 'nameptr :=
1192 namesleft #1 - 'namesleft :=
1193 }
1194 while$
1195 }
1196 FUNCTION {sort.format.title}
1197 { 't :=
1198 "A " #2
1199 "An " #3
1200 "The " #4 t chop.word
1201 chop.word
1202 chop.word
1203 sortify
1204 #1 global.max$ substring$
1205 }
1206 FUNCTION {author.sort}
1207 { author empty$
1208 { key empty$
1209 { "to sort, need author or key in " cite$ * warning$
1210 ""
1211 }
1212 { key sortify }
1213 if$
1214 }
1215 { author sort.format.names }
1216 if$
1217 }
1218 FUNCTION {author.editor.sort}
1219 { author empty$
1220 { editor empty$
1221 { key empty$
1222 { "to sort, need author, editor, or key in " cite$ * warning$
1223 ""
1224 }
1225 { key sortify }
1226 if$
1227 }
1228 { editor sort.format.names }
1229 if$
1230 }
1231 { author sort.format.names }
1232 if$
1233 }
1234 FUNCTION {author.organization.sort}
1235 { author empty$
1236 { organization empty$
1237 { key empty$
1238 { "to sort, need author, organization, or key in " cite$ * warning$
1239 ""
1240 }
1241 { key sortify }
1242 if$
1243 }
1244 { "The " #4 organization chop.word sortify }
1245 if$
1246 }
1247 { author sort.format.names }
1248 if$
1249 }
1250 FUNCTION {editor.organization.sort}
1251 { editor empty$
1252 { organization empty$
1253 { key empty$
1254 { "to sort, need editor, organization, or key in " cite$ * warning$
1255 ""
1256 }
1257 { key sortify }
1258 if$
1259 }
1260 { "The " #4 organization chop.word sortify }
1261 if$
1262 }
1263 { editor sort.format.names }
1264 if$
1265 }
1266 FUNCTION {presort}
1267 { calc.label
1268 year field.or.null sortify
1269 " "
1270 *
1271 sort.label
1272 *
1273 " "
1274 *
1275 type$ "book" =
1276 type$ "inbook" =
1277 or
1278 'author.editor.sort
1279 { type$ "proceedings" =
1280 'editor.organization.sort
1281 { type$ "manual" =
1282 'author.organization.sort
1283 'author.sort
1284 if$
1285 }
1286 if$
1287 }
1288 if$
1289 *
1290 " "
1291 *
1292 year field.or.null sortify
1293 *
1294 " "
1295 *
1296 title field.or.null
1297 sort.format.title
1298 *
1299 #1 entry.max$ substring$
1300 'sort.key$ :=
1301 }
1302 ITERATE {presort}
1303 SORT
1304 STRINGS { longest.label last.sort.label next.extra }
1305 INTEGERS { longest.label.width last.extra.num }
1306 FUNCTION {initialize.longest.label}
1307 { "" 'longest.label :=
1308 #0 int.to.chr$ 'last.sort.label :=
1309 "" 'next.extra :=
1310 #0 'longest.label.width :=
1311 #0 'last.extra.num :=
1312 }
1313 FUNCTION {forward.pass}
1314 { last.sort.label sort.label =
1315 { last.extra.num #1 + 'last.extra.num :=
1316 last.extra.num int.to.chr$ 'extra.label :=
1317 }
1318 { "a" chr.to.int$ 'last.extra.num :=
1319 "" 'extra.label :=
1320 sort.label 'last.sort.label :=
1321 }
1322 if$
1323 }
1324 FUNCTION {reverse.pass}
1325 { next.extra "b" =
1326 { "a" 'extra.label := }
1327 'skip$
1328 if$
1329 label extra.label * 'label :=
1330 label width$ longest.label.width >
1331 { label 'longest.label :=
1332 label width$ 'longest.label.width :=
1333 }
1334 'skip$
1335 if$
1336 extra.label 'next.extra :=
1337 }
1338 EXECUTE {initialize.longest.label}
1339 ITERATE {forward.pass}
1340 REVERSE {reverse.pass}
1341 %%% XXX The macro \etalchar is generated in function format.lab.names.
1342 %%% I have no idea what format.lab.names does,
1343 %%% and it doesn't seem to do anything in my test cases.
1344 %%% However the \etalchar definition messes up the HTML output,
1345 %%% so I'll simply skip that for now...
1346 FUNCTION {begin.bib}
1347 { %et.al.char.used
1348 preamble$ empty$
1349 'skip$
1350 { preamble$ write$ newline$ }
1351 if$
1352 "<dl>" write$ newline$
1353 }
1354 EXECUTE {begin.bib}
1355 EXECUTE {init.urlbst.variables}
1356 EXECUTE {init.state.consts}
1357 REVERSE {call.type$}
1358 FUNCTION {end.bib}
1359 { newline$
1360 "</dl>" write$ newline$
1361 }
1362 EXECUTE {end.bib}