Debian Codegraph @

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