Debian Codegraph @

texmf-dist/doc/latex/unamth-template/Latex/Classes/PhDbiblio-url2.bst

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