Debian Codegraph @

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

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