mjo-hurwitz.tex: new file for Hurwitz algebras (quaternions and octonions).
[mjotex.git] / mjo.bst
1 %%
2 %% This is file `mjo.bst',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% merlin.mbs (with options: `ed-au,tit-it,jttl-rm,jwdvol,num-xser,isbn,issn,doi,edpar,ppx,ed,abr,ednx,mth-bare,xedn,etal-xc,url,url-blk,nfss,')
8 %% ----------------------------------------
9 %% *** ***
10 %%
11 %% Copyright 1994-2011 Patrick W Daly
12 % ===============================================================
13 % IMPORTANT NOTICE:
14 % This bibliographic style (bst) file has been generated from one or
15 % more master bibliographic style (mbs) files, listed above.
16 %
17 % This generated file can be redistributed and/or modified under the terms
18 % of the LaTeX Project Public License Distributed from CTAN
19 % archives in directory macros/latex/base/lppl.txt; either
20 % version 1 of the License, or any later version.
21 % ===============================================================
22 % Name and version information of the main mbs file:
23 % \ProvidesFile{merlin.mbs}[2011/11/18 4.33 (PWD, AO, DPC)]
24 % For use with BibTeX version 0.99a or later
25 %-------------------------------------------------------------------
26 % This bibliography style file is intended for texts in ENGLISH
27 % This is a numerical citation style, and as such is standard LaTeX.
28 % It requires no extra package to interface to the main text.
29 % The form of the \bibitem entries is
30 % \bibitem{key}...
31 % Usage of \cite is as follows:
32 % \cite{key} ==>> [#]
33 % \cite[chap. 2]{key} ==>> [#, chap. 2]
34 % where # is a number determined by the ordering in the reference list.
35 % The order in the reference list is alphabetical by authors.
36 %---------------------------------------------------------------------
37
38 ENTRY
39 { address
40 author
41 booktitle
42 chapter
43 doi
44 edition
45 editor
46 eid
47 howpublished
48 institution
49 isbn
50 issn
51 journal
52 key
53 month
54 note
55 number
56 organization
57 pages
58 publisher
59 school
60 series
61 title
62 type
63 url
64 volume
65 year
66 }
67 {}
68 { label }
69
70 STRINGS { doiprefix doiurl }
71 FUNCTION {init.doi.variables}
72 {
73 "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
74 "doi:" 'doiprefix := % text prefix printed before DOI ref
75 }
76 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
77 FUNCTION {init.state.consts}
78 { #0 'before.all :=
79 #1 'mid.sentence :=
80 #2 'after.sentence :=
81 #3 'after.block :=
82 }
83 STRINGS { s t}
84 FUNCTION {output.nonnull}
85 { 's :=
86 output.state mid.sentence =
87 { ", " * write$ }
88 { output.state after.block =
89 { add.period$ write$
90 newline$
91 "\newblock " write$
92 }
93 { output.state before.all =
94 'write$
95 { add.period$ " " * write$ }
96 if$
97 }
98 if$
99 mid.sentence 'output.state :=
100 }
101 if$
102 s
103 }
104 FUNCTION {output}
105 { duplicate$ empty$
106 'pop$
107 'output.nonnull
108 if$
109 }
110 FUNCTION {output.check}
111 { 't :=
112 duplicate$ empty$
113 { pop$ "empty " t * " in " * cite$ * warning$ }
114 'output.nonnull
115 if$
116 }
117 FUNCTION {fin.entry}
118 { add.period$
119 write$
120 newline$
121 }
122
123 FUNCTION {new.block}
124 { output.state before.all =
125 'skip$
126 { after.block 'output.state := }
127 if$
128 }
129 FUNCTION {new.sentence}
130 { output.state after.block =
131 'skip$
132 { output.state before.all =
133 'skip$
134 { after.sentence 'output.state := }
135 if$
136 }
137 if$
138 }
139 FUNCTION {add.blank}
140 { " " * before.all 'output.state :=
141 }
142
143 FUNCTION {date.block}
144 {
145 new.block
146 }
147
148 FUNCTION {not}
149 { { #0 }
150 { #1 }
151 if$
152 }
153 FUNCTION {and}
154 { 'skip$
155 { pop$ #0 }
156 if$
157 }
158 FUNCTION {or}
159 { { pop$ #1 }
160 'skip$
161 if$
162 }
163 STRINGS {z}
164
165 FUNCTION {remove.dots}
166 { 'z :=
167 ""
168 { z empty$ not }
169 { z #1 #2 substring$
170 duplicate$ "\." =
171 { z #3 global.max$ substring$ 'z := * }
172 { pop$
173 z #1 #1 substring$
174 z #2 global.max$ substring$ 'z :=
175 duplicate$ "." = 'pop$
176 { * }
177 if$
178 }
179 if$
180 }
181 while$
182 }
183 FUNCTION {new.block.checka}
184 { empty$
185 'skip$
186 'new.block
187 if$
188 }
189 FUNCTION {new.block.checkb}
190 { empty$
191 swap$ empty$
192 and
193 'skip$
194 'new.block
195 if$
196 }
197 FUNCTION {new.sentence.checka}
198 { empty$
199 'skip$
200 'new.sentence
201 if$
202 }
203 FUNCTION {new.sentence.checkb}
204 { empty$
205 swap$ empty$
206 and
207 'skip$
208 'new.sentence
209 if$
210 }
211 FUNCTION {field.or.null}
212 { duplicate$ empty$
213 { pop$ "" }
214 'skip$
215 if$
216 }
217 FUNCTION {emphasize}
218 { duplicate$ empty$
219 { pop$ "" }
220 { "\emph{" swap$ * "}" * }
221 if$
222 }
223 FUNCTION {tie.or.space.prefix}
224 { duplicate$ text.length$ #3 <
225 { "~" }
226 { " " }
227 if$
228 swap$
229 }
230
231 FUNCTION {capitalize}
232 { "u" change.case$ "t" change.case$ }
233
234 FUNCTION {space.word}
235 { " " swap$ * " " * }
236 % Here are the language-specific definitions for explicit words.
237 % Each function has a name bbl.xxx where xxx is the English word.
238 % The language selected here is ENGLISH
239 FUNCTION {bbl.and}
240 { "and"}
241
242 FUNCTION {bbl.etal}
243 { "et~al." }
244
245 FUNCTION {bbl.editors}
246 { "eds." }
247
248 FUNCTION {bbl.editor}
249 { "ed." }
250
251 FUNCTION {bbl.edby}
252 { "edited by" }
253
254 FUNCTION {bbl.edition}
255 { "ed." }
256
257 FUNCTION {bbl.volume}
258 { "vol." }
259
260 FUNCTION {bbl.of}
261 { "of" }
262
263 FUNCTION {bbl.number}
264 { "no." }
265
266 FUNCTION {bbl.nr}
267 { "no." }
268
269 FUNCTION {bbl.in}
270 { "in" }
271
272 FUNCTION {bbl.pages}
273 { "" }
274
275 FUNCTION {bbl.page}
276 { "" }
277
278 FUNCTION {bbl.chapter}
279 { "Chapter" }
280
281 FUNCTION {bbl.techrep}
282 { "Tech. Rep." }
283
284 FUNCTION {bbl.mthesis}
285 { "Master's thesis" }
286
287 FUNCTION {bbl.phdthesis}
288 { "Ph.D. thesis" }
289
290 MACRO {jan} {"Jan."}
291
292 MACRO {feb} {"Feb."}
293
294 MACRO {mar} {"Mar."}
295
296 MACRO {apr} {"Apr."}
297
298 MACRO {may} {"May"}
299
300 MACRO {jun} {"Jun."}
301
302 MACRO {jul} {"Jul."}
303
304 MACRO {aug} {"Aug."}
305
306 MACRO {sep} {"Sep."}
307
308 MACRO {oct} {"Oct."}
309
310 MACRO {nov} {"Nov."}
311
312 MACRO {dec} {"Dec."}
313
314 FUNCTION {bibinfo.check}
315 { swap$
316 duplicate$ missing$
317 {
318 pop$ pop$
319 ""
320 }
321 { duplicate$ empty$
322 {
323 swap$ pop$
324 }
325 { swap$
326 pop$
327 }
328 if$
329 }
330 if$
331 }
332 FUNCTION {bibinfo.warn}
333 { swap$
334 duplicate$ missing$
335 {
336 swap$ "missing " swap$ * " in " * cite$ * warning$ pop$
337 ""
338 }
339 { duplicate$ empty$
340 {
341 swap$ "empty " swap$ * " in " * cite$ * warning$
342 }
343 { swap$
344 pop$
345 }
346 if$
347 }
348 if$
349 }
350 FUNCTION {format.url}
351 {
352 url
353 duplicate$ empty$
354 { pop$ "" }
355 { "\urlprefix\url{" swap$ * "}" * }
356 if$
357 }
358
359 INTEGERS { nameptr namesleft numnames }
360
361
362 STRINGS { bibinfo}
363
364 FUNCTION {format.names}
365 { 'bibinfo :=
366 duplicate$ empty$ 'skip$ {
367 's :=
368 "" 't :=
369 #1 'nameptr :=
370 s num.names$ 'numnames :=
371 numnames 'namesleft :=
372 { namesleft #0 > }
373 { s nameptr
374 "{ff~}{vv~}{ll}{, jj}"
375 format.name$
376 bibinfo bibinfo.check
377 't :=
378 nameptr #1 >
379 {
380 namesleft #1 >
381 { ", " * t * }
382 {
383 s nameptr "{ll}" format.name$ duplicate$ "others" =
384 { 't := }
385 { pop$ }
386 if$
387 numnames #2 >
388 t "others" = not and
389 { "," * }
390 'skip$
391 if$
392 t "others" =
393 {
394 " " * bbl.etal *
395 }
396 {
397 bbl.and
398 space.word * t *
399 }
400 if$
401 }
402 if$
403 }
404 't
405 if$
406 nameptr #1 + 'nameptr :=
407 namesleft #1 - 'namesleft :=
408 }
409 while$
410 } if$
411 }
412 FUNCTION {format.names.ed}
413 {
414 format.names
415 }
416 FUNCTION {format.authors}
417 { author "author" format.names
418 }
419 FUNCTION {get.bbl.editor}
420 { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
421
422 FUNCTION {format.editors}
423 { editor "editor" format.names duplicate$ empty$ 'skip$
424 {
425 " " *
426 get.bbl.editor
427 "(" swap$ * ")" *
428 *
429 }
430 if$
431 }
432 FUNCTION {format.isbn}
433 { isbn "isbn" bibinfo.check
434 duplicate$ empty$ 'skip$
435 {
436 new.block
437 "ISBN " swap$ *
438 }
439 if$
440 }
441
442 FUNCTION {format.issn}
443 { issn "issn" bibinfo.check
444 duplicate$ empty$ 'skip$
445 {
446 new.block
447 "ISSN " swap$ *
448 }
449 if$
450 }
451
452 FUNCTION {make.href}
453 { "\href {" swap$ * "} {\path{" * swap$ * "}}" * }
454
455 FUNCTION {format.doi}
456 { doi empty$
457 { "" }
458 { doiprefix doi * doiurl doi * make.href }
459 if$
460 }
461 FUNCTION {format.note}
462 {
463 note empty$
464 { "" }
465 { note #1 #1 substring$
466 duplicate$ "{" =
467 'skip$
468 { output.state mid.sentence =
469 { "l" }
470 { "u" }
471 if$
472 change.case$
473 }
474 if$
475 note #2 global.max$ substring$ * "note" bibinfo.check
476 }
477 if$
478 }
479
480 FUNCTION {format.title}
481 { title
482 duplicate$ empty$ 'skip$
483 { "t" change.case$ }
484 if$
485 "title" bibinfo.check
486 duplicate$ empty$ 'skip$
487 {
488 emphasize
489 }
490 if$
491 }
492 FUNCTION {output.bibitem}
493 { newline$
494 "\bibitem{" write$
495 cite$ write$
496 "}" write$
497 newline$
498 ""
499 before.all 'output.state :=
500 }
501
502 FUNCTION {n.dashify}
503 {
504 't :=
505 ""
506 { t empty$ not }
507 { t #1 #1 substring$ "-" =
508 { t #1 #2 substring$ "--" = not
509 { "--" *
510 t #2 global.max$ substring$ 't :=
511 }
512 { { t #1 #1 substring$ "-" = }
513 { "-" *
514 t #2 global.max$ substring$ 't :=
515 }
516 while$
517 }
518 if$
519 }
520 { t #1 #1 substring$ *
521 t #2 global.max$ substring$ 't :=
522 }
523 if$
524 }
525 while$
526 }
527
528 FUNCTION {word.in}
529 { bbl.in capitalize
530 " " * }
531
532 FUNCTION {format.date}
533 {
534 month "month" bibinfo.check
535 duplicate$ empty$
536 year "year" bibinfo.check duplicate$ empty$
537 { swap$ 'skip$
538 { "there's a month but no year in " cite$ * warning$ }
539 if$
540 *
541 }
542 { swap$ 'skip$
543 {
544 swap$
545 " " * swap$
546 }
547 if$
548 *
549 remove.dots
550 }
551 if$
552 }
553 FUNCTION {format.btitle}
554 { title "title" bibinfo.check
555 duplicate$ empty$ 'skip$
556 {
557 emphasize
558 }
559 if$
560 }
561 FUNCTION {either.or.check}
562 { empty$
563 'pop$
564 { "can't use both " swap$ * " fields in " * cite$ * warning$ }
565 if$
566 }
567 FUNCTION {format.bvolume}
568 { volume empty$
569 { "" }
570 { bbl.volume volume tie.or.space.prefix
571 "volume" bibinfo.check * *
572 series "series" bibinfo.check
573 duplicate$ empty$ 'pop$
574 { swap$ bbl.of space.word * swap$
575 emphasize * }
576 if$
577 "volume and number" number either.or.check
578 }
579 if$
580 }
581 FUNCTION {format.number.series}
582 { volume empty$
583 { number empty$
584 { series field.or.null }
585 { series empty$
586 { number "number" bibinfo.check }
587 { output.state mid.sentence =
588 { bbl.number }
589 { bbl.number capitalize }
590 if$
591 number tie.or.space.prefix "number" bibinfo.check * *
592 bbl.in space.word *
593 series "series" bibinfo.check *
594 }
595 if$
596 }
597 if$
598 }
599 { "" }
600 if$
601 }
602
603 FUNCTION {format.edition}
604 { edition duplicate$ empty$ 'skip$
605 {
606 output.state mid.sentence =
607 { "l" }
608 { "t" }
609 if$ change.case$
610 "edition" bibinfo.check
611 " " * bbl.edition *
612 }
613 if$
614 }
615 INTEGERS { multiresult }
616 FUNCTION {multi.page.check}
617 { 't :=
618 #0 'multiresult :=
619 { multiresult not
620 t empty$ not
621 and
622 }
623 { t #1 #1 substring$
624 duplicate$ "-" =
625 swap$ duplicate$ "," =
626 swap$ "+" =
627 or or
628 { #1 'multiresult := }
629 { t #2 global.max$ substring$ 't := }
630 if$
631 }
632 while$
633 multiresult
634 }
635 FUNCTION {format.pages}
636 { pages duplicate$ empty$ 'skip$
637 { duplicate$ multi.page.check
638 {
639 n.dashify
640 }
641 {
642 }
643 if$
644 "pages" bibinfo.check
645 }
646 if$
647 }
648 FUNCTION {format.journal.pages}
649 { pages duplicate$ empty$ 'pop$
650 { swap$ duplicate$ empty$
651 { pop$ pop$ format.pages }
652 {
653 ":" *
654 swap$
655 n.dashify
656 "pages" bibinfo.check
657 *
658 }
659 if$
660 }
661 if$
662 }
663 FUNCTION {format.journal.eid}
664 { eid "eid" bibinfo.check
665 duplicate$ empty$ 'pop$
666 { swap$ duplicate$ empty$ 'skip$
667 {
668 ":" *
669 }
670 if$
671 swap$ *
672 }
673 if$
674 }
675 FUNCTION {format.vol.num.pages}
676 { volume field.or.null
677 duplicate$ empty$ 'skip$
678 { % Replaced "vol." with the empty string here.
679 "" swap$ tie.or.space.prefix
680 "volume" bibinfo.check
681 * *
682 }
683 if$
684 number "number" bibinfo.check duplicate$ empty$ 'skip$
685 {
686 swap$ duplicate$ empty$
687 { "there's a number but no volume in " cite$ * warning$ }
688 'skip$
689 if$
690 swap$
691 "(" swap$ * ")" *
692 }
693 if$ *
694 eid empty$
695 { format.journal.pages }
696 { format.journal.eid }
697 if$
698 }
699
700 FUNCTION {format.chapter.pages}
701 { chapter empty$
702 'format.pages
703 { type empty$
704 { bbl.chapter }
705 { type "l" change.case$
706 "type" bibinfo.check
707 }
708 if$
709 chapter tie.or.space.prefix
710 "chapter" bibinfo.check
711 * *
712 pages empty$
713 'skip$
714 { ", " * format.pages * }
715 if$
716 }
717 if$
718 }
719
720 FUNCTION {format.booktitle}
721 {
722 booktitle "booktitle" bibinfo.check
723 emphasize
724 }
725 FUNCTION {format.in.ed.booktitle}
726 { format.booktitle duplicate$ empty$ 'skip$
727 {
728 editor "editor" format.names.ed duplicate$ empty$ 'pop$
729 {
730 " " *
731 get.bbl.editor
732 "(" swap$ * "), " *
733 * swap$
734 * }
735 if$
736 word.in swap$ *
737 }
738 if$
739 }
740 FUNCTION {empty.misc.check}
741 { author empty$ title empty$ howpublished empty$
742 month empty$ year empty$ note empty$
743 and and and and and
744 key empty$ not and
745 { "all relevant fields are empty in " cite$ * warning$ }
746 'skip$
747 if$
748 }
749 FUNCTION {format.thesis.type}
750 { type duplicate$ empty$
751 'pop$
752 { swap$ pop$
753 "t" change.case$ "type" bibinfo.check
754 }
755 if$
756 }
757 FUNCTION {format.tr.number}
758 { number "number" bibinfo.check
759 type duplicate$ empty$
760 { pop$ bbl.techrep }
761 'skip$
762 if$
763 "type" bibinfo.check
764 swap$ duplicate$ empty$
765 { pop$ "t" change.case$ }
766 { tie.or.space.prefix * * }
767 if$
768 }
769 FUNCTION {format.article.crossref}
770 {
771 key duplicate$ empty$
772 { pop$
773 journal duplicate$ empty$
774 { "need key or journal for " cite$ * " to crossref " * crossref * warning$ }
775 { "journal" bibinfo.check emphasize word.in swap$ * }
776 if$
777 }
778 { word.in swap$ * " " *}
779 if$
780 " \cite{" * crossref * "}" *
781 }
782 FUNCTION {format.crossref.editor}
783 { editor #1 "{vv~}{ll}" format.name$
784 "editor" bibinfo.check
785 editor num.names$ duplicate$
786 #2 >
787 { pop$
788 "editor" bibinfo.check
789 " " * bbl.etal
790 *
791 }
792 { #2 <
793 'skip$
794 { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
795 {
796 "editor" bibinfo.check
797 " " * bbl.etal
798 *
799 }
800 {
801 bbl.and space.word
802 * editor #2 "{vv~}{ll}" format.name$
803 "editor" bibinfo.check
804 *
805 }
806 if$
807 }
808 if$
809 }
810 if$
811 }
812 FUNCTION {format.book.crossref}
813 { volume duplicate$ empty$
814 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
815 pop$ word.in
816 }
817 { bbl.volume
818 capitalize
819 swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word *
820 }
821 if$
822 editor empty$
823 editor field.or.null author field.or.null =
824 or
825 { key empty$
826 { series empty$
827 { "need editor, key, or series for " cite$ * " to crossref " *
828 crossref * warning$
829 "" *
830 }
831 { series emphasize * }
832 if$
833 }
834 { key * }
835 if$
836 }
837 { format.crossref.editor * }
838 if$
839 " \cite{" * crossref * "}" *
840 }
841 FUNCTION {format.incoll.inproc.crossref}
842 {
843 editor empty$
844 editor field.or.null author field.or.null =
845 or
846 { key empty$
847 { format.booktitle duplicate$ empty$
848 { "need editor, key, or booktitle for " cite$ * " to crossref " *
849 crossref * warning$
850 }
851 { word.in swap$ * }
852 if$
853 }
854 { word.in key * " " *}
855 if$
856 }
857 { word.in format.crossref.editor * " " *}
858 if$
859 " \cite{" * crossref * "}" *
860 }
861 FUNCTION {format.org.or.pub}
862 { 't :=
863 ""
864 address empty$ t empty$ and
865 'skip$
866 {
867 t empty$
868 { address "address" bibinfo.check *
869 }
870 { t *
871 address empty$
872 'skip$
873 { ", " * address "address" bibinfo.check * }
874 if$
875 }
876 if$
877 }
878 if$
879 }
880 FUNCTION {format.publisher.address}
881 { publisher "publisher" bibinfo.warn format.org.or.pub
882 }
883
884 FUNCTION {format.organization.address}
885 { organization "organization" bibinfo.check format.org.or.pub
886 }
887
888 FUNCTION {article}
889 { output.bibitem
890 format.authors "author" output.check
891 new.block
892 format.title "title" output.check
893 new.block
894 crossref missing$
895 {
896 journal
897 "journal" bibinfo.check
898 "journal" output.check
899 format.vol.num.pages output
900 format.date "year" output.check
901 }
902 { format.article.crossref output.nonnull
903 format.pages output
904 }
905 if$
906 format.issn output
907 format.doi output
908 new.block
909 format.url output
910 new.block
911 format.note output
912 fin.entry
913 }
914 FUNCTION {book}
915 { output.bibitem
916 author empty$
917 { format.editors "author and editor" output.check
918 }
919 { format.authors output.nonnull
920 crossref missing$
921 { "author and editor" editor either.or.check }
922 'skip$
923 if$
924 }
925 if$
926 new.block
927 format.btitle "title" output.check
928 crossref missing$
929 { format.bvolume output
930 new.block
931 format.number.series output
932 new.sentence
933 format.publisher.address output
934 }
935 {
936 new.block
937 format.book.crossref output.nonnull
938 }
939 if$
940 format.edition output
941 format.date "year" output.check
942 format.isbn output
943 format.doi output
944 new.block
945 format.url output
946 new.block
947 format.note output
948 fin.entry
949 }
950 FUNCTION {booklet}
951 { output.bibitem
952 format.authors output
953 new.block
954 format.title "title" output.check
955 new.block
956 howpublished "howpublished" bibinfo.check output
957 address "address" bibinfo.check output
958 format.date output
959 format.isbn output
960 format.doi output
961 new.block
962 format.url output
963 new.block
964 format.note output
965 fin.entry
966 }
967
968 FUNCTION {inbook}
969 { output.bibitem
970 author empty$
971 { format.editors "author and editor" output.check
972 }
973 { format.authors output.nonnull
974 crossref missing$
975 { "author and editor" editor either.or.check }
976 'skip$
977 if$
978 }
979 if$
980 new.block
981 format.btitle "title" output.check
982 crossref missing$
983 {
984 format.bvolume output
985 format.chapter.pages "chapter and pages" output.check
986 new.block
987 format.number.series output
988 new.sentence
989 format.publisher.address output
990 }
991 {
992 format.chapter.pages "chapter and pages" output.check
993 new.block
994 format.book.crossref output.nonnull
995 }
996 if$
997 format.edition output
998 format.date "year" output.check
999 crossref missing$
1000 { format.isbn output }
1001 'skip$
1002 if$
1003 format.doi output
1004 new.block
1005 format.url output
1006 new.block
1007 format.note output
1008 fin.entry
1009 }
1010
1011 FUNCTION {incollection}
1012 { output.bibitem
1013 format.authors "author" output.check
1014 new.block
1015 format.title "title" output.check
1016 new.block
1017 crossref missing$
1018 { format.in.ed.booktitle "booktitle" output.check
1019 format.bvolume output
1020 format.number.series output
1021 format.chapter.pages output
1022 new.sentence
1023 format.publisher.address output
1024 format.edition output
1025 format.date "year" output.check
1026 format.isbn output
1027 }
1028 { format.incoll.inproc.crossref output.nonnull
1029 format.chapter.pages output
1030 }
1031 if$
1032 format.doi output
1033 new.block
1034 format.url output
1035 new.block
1036 format.note output
1037 fin.entry
1038 }
1039 FUNCTION {inproceedings}
1040 { output.bibitem
1041 format.authors "author" output.check
1042 new.block
1043 format.title "title" output.check
1044 new.block
1045 crossref missing$
1046 { format.in.ed.booktitle "booktitle" output.check
1047 format.bvolume output
1048 format.number.series output
1049 format.pages output
1050 new.sentence
1051 publisher empty$
1052 { format.organization.address output }
1053 { organization "organization" bibinfo.check output
1054 format.publisher.address output
1055 }
1056 if$
1057 format.date "year" output.check
1058 format.isbn output
1059 format.issn output
1060 }
1061 { format.incoll.inproc.crossref output.nonnull
1062 format.pages output
1063 }
1064 if$
1065 format.doi output
1066 new.block
1067 format.url output
1068 new.block
1069 format.note output
1070 fin.entry
1071 }
1072 FUNCTION {conference} { inproceedings }
1073 FUNCTION {manual}
1074 { output.bibitem
1075 author empty$
1076 { organization "organization" bibinfo.check
1077 duplicate$ empty$ 'pop$
1078 { output
1079 address "address" bibinfo.check output
1080 }
1081 if$
1082 }
1083 { format.authors output.nonnull }
1084 if$
1085 new.block
1086 format.btitle "title" output.check
1087 author empty$
1088 { organization empty$
1089 {
1090 address new.block.checka
1091 address "address" bibinfo.check output
1092 }
1093 'skip$
1094 if$
1095 }
1096 {
1097 organization address new.block.checkb
1098 organization "organization" bibinfo.check output
1099 address "address" bibinfo.check output
1100 }
1101 if$
1102 format.edition output
1103 format.date output
1104 format.doi output
1105 new.block
1106 format.url output
1107 new.block
1108 format.note output
1109 fin.entry
1110 }
1111
1112 FUNCTION {mastersthesis}
1113 { output.bibitem
1114 format.authors "author" output.check
1115 new.block
1116 format.btitle
1117 "title" output.check
1118 new.block
1119 bbl.mthesis format.thesis.type output.nonnull
1120 school "school" bibinfo.warn output
1121 address "address" bibinfo.check output
1122 format.date "year" output.check
1123 format.doi output
1124 new.block
1125 format.url output
1126 new.block
1127 format.note output
1128 fin.entry
1129 }
1130
1131 FUNCTION {misc}
1132 { output.bibitem
1133 format.authors output
1134 title howpublished new.block.checkb
1135 format.title output
1136 howpublished new.block.checka
1137 howpublished "howpublished" bibinfo.check output
1138 format.date output
1139 format.doi output
1140 new.block
1141 format.url output
1142 new.block
1143 format.note output
1144 fin.entry
1145 empty.misc.check
1146 }
1147 FUNCTION {phdthesis}
1148 { output.bibitem
1149 format.authors "author" output.check
1150 new.block
1151 format.btitle
1152 "title" output.check
1153 new.block
1154 bbl.phdthesis format.thesis.type output.nonnull
1155 school "school" bibinfo.warn output
1156 address "address" bibinfo.check output
1157 format.date "year" output.check
1158 format.doi output
1159 new.block
1160 format.url output
1161 new.block
1162 format.note output
1163 fin.entry
1164 }
1165
1166 FUNCTION {proceedings}
1167 { output.bibitem
1168 editor empty$
1169 { organization "organization" bibinfo.check output
1170 }
1171 { format.editors output.nonnull }
1172 if$
1173 new.block
1174 format.btitle "title" output.check
1175 format.bvolume output
1176 format.number.series output
1177 editor empty$
1178 { publisher empty$
1179 'skip$
1180 {
1181 new.sentence
1182 format.publisher.address output
1183 }
1184 if$
1185 }
1186 { publisher empty$
1187 {
1188 new.sentence
1189 format.organization.address output }
1190 {
1191 new.sentence
1192 organization "organization" bibinfo.check output
1193 format.publisher.address output
1194 }
1195 if$
1196 }
1197 if$
1198 format.date "year" output.check
1199 format.isbn output
1200 format.issn output
1201 format.doi output
1202 new.block
1203 format.url output
1204 new.block
1205 format.note output
1206 fin.entry
1207 }
1208
1209 FUNCTION {techreport}
1210 { output.bibitem
1211 format.authors "author" output.check
1212 new.block
1213 format.title
1214 "title" output.check
1215 new.block
1216 format.tr.number output.nonnull
1217 institution "institution" bibinfo.warn output
1218 address "address" bibinfo.check output
1219 format.date "year" output.check
1220 format.doi output
1221 new.block
1222 format.url output
1223 new.block
1224 format.note output
1225 fin.entry
1226 }
1227
1228 FUNCTION {unpublished}
1229 { output.bibitem
1230 format.authors "author" output.check
1231 new.block
1232 format.title "title" output.check
1233 format.date output
1234 format.doi output
1235 new.block
1236 format.url output
1237 new.block
1238 format.note "note" output.check
1239 fin.entry
1240 }
1241
1242 FUNCTION {default.type} { misc }
1243 READ
1244 FUNCTION {sortify}
1245 { purify$
1246 "l" change.case$
1247 }
1248 INTEGERS { len }
1249 FUNCTION {chop.word}
1250 { 's :=
1251 'len :=
1252 s #1 len substring$ =
1253 { s len #1 + global.max$ substring$ }
1254 's
1255 if$
1256 }
1257 FUNCTION {sort.format.names}
1258 { 's :=
1259 #1 'nameptr :=
1260 ""
1261 s num.names$ 'numnames :=
1262 numnames 'namesleft :=
1263 { namesleft #0 > }
1264 { s nameptr
1265 "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
1266 format.name$ 't :=
1267 nameptr #1 >
1268 {
1269 " " *
1270 namesleft #1 = t "others" = and
1271 { "zzzzz" 't := }
1272 'skip$
1273 if$
1274 t sortify *
1275 }
1276 { t sortify * }
1277 if$
1278 nameptr #1 + 'nameptr :=
1279 namesleft #1 - 'namesleft :=
1280 }
1281 while$
1282 }
1283
1284 FUNCTION {sort.format.title}
1285 { 't :=
1286 "A " #2
1287 "An " #3
1288 "The " #4 t chop.word
1289 chop.word
1290 chop.word
1291 sortify
1292 #1 global.max$ substring$
1293 }
1294 FUNCTION {author.sort}
1295 { author empty$
1296 { key empty$
1297 { "to sort, need author or key in " cite$ * warning$
1298 ""
1299 }
1300 { key sortify }
1301 if$
1302 }
1303 { author sort.format.names }
1304 if$
1305 }
1306 FUNCTION {author.editor.sort}
1307 { author empty$
1308 { editor empty$
1309 { key empty$
1310 { "to sort, need author, editor, or key in " cite$ * warning$
1311 ""
1312 }
1313 { key sortify }
1314 if$
1315 }
1316 { editor sort.format.names }
1317 if$
1318 }
1319 { author sort.format.names }
1320 if$
1321 }
1322 FUNCTION {author.organization.sort}
1323 { author empty$
1324 { organization empty$
1325 { key empty$
1326 { "to sort, need author, organization, or key in " cite$ * warning$
1327 ""
1328 }
1329 { key sortify }
1330 if$
1331 }
1332 { "The " #4 organization chop.word sortify }
1333 if$
1334 }
1335 { author sort.format.names }
1336 if$
1337 }
1338 FUNCTION {editor.organization.sort}
1339 { editor empty$
1340 { organization empty$
1341 { key empty$
1342 { "to sort, need editor, organization, or key in " cite$ * warning$
1343 ""
1344 }
1345 { key sortify }
1346 if$
1347 }
1348 { "The " #4 organization chop.word sortify }
1349 if$
1350 }
1351 { editor sort.format.names }
1352 if$
1353 }
1354 FUNCTION {presort}
1355 { type$ "book" =
1356 type$ "inbook" =
1357 or
1358 'author.editor.sort
1359 { type$ "proceedings" =
1360 'editor.organization.sort
1361 { type$ "manual" =
1362 'author.organization.sort
1363 'author.sort
1364 if$
1365 }
1366 if$
1367 }
1368 if$
1369 " "
1370 *
1371 year field.or.null sortify
1372 *
1373 " "
1374 *
1375 title field.or.null
1376 sort.format.title
1377 *
1378 #1 entry.max$ substring$
1379 'sort.key$ :=
1380 }
1381 ITERATE {presort}
1382 SORT
1383 STRINGS { longest.label }
1384 INTEGERS { number.label longest.label.width }
1385 FUNCTION {initialize.longest.label}
1386 { "" 'longest.label :=
1387 #1 'number.label :=
1388 #0 'longest.label.width :=
1389 }
1390 FUNCTION {longest.label.pass}
1391 { number.label int.to.str$ 'label :=
1392 number.label #1 + 'number.label :=
1393 label width$ longest.label.width >
1394 { label 'longest.label :=
1395 label width$ 'longest.label.width :=
1396 }
1397 'skip$
1398 if$
1399 }
1400 EXECUTE {initialize.longest.label}
1401 ITERATE {longest.label.pass}
1402
1403 % The usual default hbadness is 1000, but bibliography entries tend to
1404 % have badnesses up around 2000, and I have one example with badness
1405 % 2302. Here, we try the value 2500 instead to avoid spurious warnings
1406 % (there's nothing the document author can do about them). Before we
1407 % end the bibliography, we restore the original value.
1408 FUNCTION {begin.bib}
1409 { preamble$ empty$
1410 'skip$
1411 { preamble$ write$ newline$ }
1412 if$
1413 "\begin{thebibliography}{" longest.label * "}" *
1414 write$ newline$
1415 "\let\originalhbadness\hbadness"
1416 write$ newline$
1417 "\hbadness=2500"
1418 write$ newline$
1419 "\providecommand{\url}[1]{\texttt{#1}}"
1420 write$ newline$
1421 "\providecommand{\urlprefix}{URL }"
1422 write$ newline$
1423 "\expandafter\ifx\csname urlstyle\endcsname\relax"
1424 write$ newline$
1425 " \providecommand{\doi}[1]{doi:\discretionary{}{}{}#1}\else"
1426 write$ newline$
1427 " \providecommand{\doi}{doi:\discretionary{}{}{}\begingroup \urlstyle{rm}\Url}\fi"
1428 write$ newline$
1429 "\expandafter\ifx\csname href\endcsname\relax"
1430 write$ newline$
1431 " \def\href#1#2{#2} \def\path#1{#1}\fi"
1432 write$ newline$
1433 }
1434 EXECUTE {begin.bib}
1435 EXECUTE {init.doi.variables}
1436 EXECUTE {init.state.consts}
1437 ITERATE {call.type$}
1438 FUNCTION {end.bib}
1439 { newline$
1440 "\hbadness=\originalhbadness"
1441 write$ newline$
1442 "\end{thebibliography}"
1443 write$ newline$
1444 }
1445 EXECUTE {end.bib}