Debian Codegraph @

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

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