Commit before breaking everything
[matches/honours.git] / thesis / styles / line.bst
1 %jaumsa.bst with line rather than repeated author
2 % BibTeX standard bibliography style `plain'
3         % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
4         % Copyright (C) 1985, all rights reserved.
5         % Copying of this file is authorized only if either
6         % (1) you make absolutely no changes to your copy, including name, or
7         % (2) if you do make changes, you name it something other than
8         % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
9         % This restriction helps ensure that all standard styles are identical.
10         % The file btxbst.doc has the documentation for this style.
11
12 ENTRY
13   { address
14     author
15     booktitle
16     chapter
17     edition
18     editor
19     howpublished
20     institution
21     journal
22     key
23     month
24     note
25     number
26     organization
27     pages
28     publisher
29     school
30     series
31     title
32     type
33     volume
34     year
35   }
36   {}
37   { label }
38
39 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
40
41 FUNCTION {init.state.consts}
42 { #0 'before.all :=
43   #1 'mid.sentence :=
44   #2 'after.sentence :=
45   #3 'after.block :=
46 }
47
48 STRINGS { s t }
49
50 FUNCTION {output.nonnull}
51 { 's :=
52   output.state mid.sentence =
53     { ", " * write$ }
54     { output.state after.block =
55         { add.period$ write$
56           newline$
57           "\newblock " write$
58         }
59         { output.state before.all =
60             'write$
61             { add.period$ " " * write$ }
62           if$
63         }
64       if$
65       mid.sentence 'output.state :=
66     }
67   if$
68   s
69 }
70
71 FUNCTION {no.comma}
72 {   before.all 'output.state :=
73 }
74
75 FUNCTION {comma}
76 {   mid.sentence 'output.state :=
77 }
78
79 FUNCTION {output}
80 { duplicate$ empty$
81     'pop$
82     'output.nonnull
83   if$
84 }
85
86 FUNCTION {output.check}
87 { 't :=
88   duplicate$ empty$
89     { pop$ "empty " t * " in " * cite$ * warning$ }
90     'output.nonnull
91   if$
92 }
93
94 FUNCTION {output.bibitem}
95 { newline$
96   "\bibitem{" write$
97   cite$ write$
98   "}" write$
99   newline$
100   ""
101   before.all 'output.state :=
102 }
103
104 FUNCTION {fin.entry}
105 { add.period$
106   write$
107   newline$
108 }
109
110 FUNCTION {new.block}
111 { output.state before.all =
112     'skip$
113     { after.block 'output.state := }
114   if$
115 }
116
117 FUNCTION {new.sentence}
118 { output.state after.block =
119     'skip$
120     { output.state before.all =
121         'skip$
122         { after.sentence 'output.state := }
123       if$
124     }
125   if$
126 }
127
128 FUNCTION {not}
129 {   { #0 }
130     { #1 }
131   if$
132 }
133
134 FUNCTION {and}
135 {   'skip$
136     { pop$ #0 }
137   if$
138 }
139
140 FUNCTION {or}
141 {   { pop$ #1 }
142     'skip$
143   if$
144 }
145
146 FUNCTION {new.block.checka}
147 { empty$
148     'skip$
149     'new.block
150   if$
151 }
152
153 FUNCTION {new.block.checkb}
154 { empty$
155   swap$ empty$
156   and
157     'skip$
158     'new.block
159   if$
160 }
161
162 FUNCTION {new.sentence.checka}
163 { empty$
164     'skip$
165     'new.sentence
166   if$
167 }
168
169 FUNCTION {new.sentence.checkb}
170 { empty$
171   swap$ empty$
172   and
173     'skip$
174     'new.sentence
175   if$
176 }
177
178 FUNCTION {field.or.null}
179 { duplicate$ empty$
180     { pop$ "" }
181     'skip$
182   if$
183 }
184
185 FUNCTION {emphasize}
186 { duplicate$ empty$
187     { pop$ "" }
188     { "{\em " swap$ * "}" * }
189   if$
190 }
191
192 FUNCTION {bold}
193 { duplicate$ empty$
194     { pop$ "" }
195     { "{\bf " swap$ * "}" * }
196   if$
197 }
198
199 INTEGERS { nameptr namesleft numnames }
200
201 FUNCTION {format.names}
202 { 's :=
203   #1 'nameptr :=
204   s num.names$ 'numnames :=
205   numnames 'namesleft :=
206     { namesleft #0 > }
207     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
208       nameptr #1 >
209         { namesleft #1 >
210             { ", " * t * }
211             { %numnames #2 >
212 %               { "," * }
213 %               'skip$
214 %             if$
215               t "others" =
216                 { "\ et~al." emphasize * }
217                 { " and " * t * }
218               if$
219             }
220           if$
221         }
222         't
223       if$
224       nameptr #1 + 'nameptr :=
225       namesleft #1 - 'namesleft :=
226     }
227   while$
228 }
229
230 STRINGS { last.authors }
231
232 FUNCTION {init.last.authors}
233 { "" 'last.authors :=
234 }
235
236 FUNCTION {format.authors}
237 { author empty$
238     { "" 'last.authors :=
239       ""
240     }
241     { author last.authors =
242         { "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
243         { author format.names }
244       if$
245       author 'last.authors :=
246     }
247   if$
248 }
249
250
251 %FUNCTION {format.authors}
252 %{ author empty$
253 %    { "" }
254 %    { author format.names }
255 %  if$
256 %}
257
258 %change
259 FUNCTION {format.editors}
260 { editor empty$
261     { "" }
262     { editor num.names$ #1 >
263         { " (eds. " editor format.names  *  ")" * }
264         { " (ed. " editor format.names  * ")" * }
265       if$
266     }
267   if$
268 }
269
270 %mine
271 FUNCTION {format.lead.editors}
272 { editor empty$
273     { "" }
274     { editor num.names$ #1 >
275         { editor format.names " (eds.)"  * }
276         { editor format.names " (ed.)"  * }
277       if$
278     }
279   if$
280 }
281
282 FUNCTION {format.title}
283 { title empty$
284     { "" }
285     { "`" title "t" change.case$ * "'" * }
286   if$
287 }
288
289 FUNCTION {n.dashify}
290 { 't :=
291   ""
292     { t empty$ not }
293     { t #1 #1 substring$ "-" =
294         { t #1 #2 substring$ "--" = not
295             { "--" *
296               t #2 global.max$ substring$ 't :=
297             }
298             {   { t #1 #1 substring$ "-" = }
299                 { "-" *
300                   t #2 global.max$ substring$ 't :=
301                 }
302               while$
303             }
304           if$
305         }
306         { t #1 #1 substring$ *
307           t #2 global.max$ substring$ 't :=
308         }
309       if$
310     }
311   while$
312 }
313
314 FUNCTION {format.date}
315 { year empty$
316     { month empty$
317         { "" }
318         { "there's a month but no year in " cite$ * warning$
319           month
320         }
321       if$
322     }
323     { month empty$
324         'year
325         { month " " * year * }
326       if$
327     }
328   if$
329 }
330
331 FUNCTION {format.btitle}
332 { title emphasize
333 }
334
335 FUNCTION {tie.or.space.connect}
336 { duplicate$ text.length$ #3 <
337     { "~" }
338     { " " }
339   if$
340   swap$ * *
341 }
342
343 FUNCTION {either.or.check}
344 { empty$
345     'pop$
346     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
347   if$
348 }
349
350 FUNCTION {format.bvolume}
351 { volume empty$
352     { "" }
353     { "volume" volume tie.or.space.connect
354       series empty$
355         'skip$
356         { " of " * series emphasize * }
357       if$
358       "volume and number" number either.or.check
359     }
360   if$
361 }
362
363 FUNCTION {format.series.volume}
364 { series empty$
365   "volume and number" number either.or.check
366   { volume empty$
367       { "" }
368       { "there's a volume but no series in " cite$ * warning$ }
369       if$
370      }
371      { series  
372       volume empty$
373         { " " * } 
374         { " " * volume bold *}
375       if$
376      }
377   if$
378 }
379
380 FUNCTION {format.series.volumeornumber}
381 { series empty$
382   "volume and number" number either.or.check
383   { volume empty$
384       { number empty$
385           { "" }
386           { "there's a number but no series in " cite$ * warning$ }
387         if$
388        }
389       { "there's a volume but no series in " cite$ * warning$ }
390       if$
391      }
392      { series emphasize 
393       volume empty$
394         { number empty$
395           { " " * }
396           { " " * "No. " * number * }
397         if$
398         }
399 %       { " " * volume *}
400         { " " * volume bold *}
401       if$
402      }
403   if$
404 }
405
406
407 %% note that this is a very ugly hack
408 FUNCTION {format.romanseries.volumeornumber}
409 { series empty$
410   "volume and number" number either.or.check
411   { volume empty$
412       { number empty$
413           { "" }
414           { "there's a number but no series in " cite$ * warning$ }
415         if$
416        }
417       { "there's a volume but no series in " cite$ * warning$ }
418       if$
419      }
420      { series  
421       volume empty$
422         { number empty$
423           { " " * }
424           { " " * "No. " * number * }
425         if$
426         }
427 %       { " " * volume *}
428         { " " * volume bold *}
429       if$
430      }
431   if$
432 }
433
434 FUNCTION {format.number.series}
435 { volume empty$
436     { number empty$
437         { series field.or.null }
438         { output.state mid.sentence =
439             { "number" }
440             { "Number" }
441           if$
442           number tie.or.space.connect
443           series empty$
444             { "there's a number but no series in " cite$ * warning$ }
445             { " in: " * series * }
446           if$
447         }
448       if$
449     }
450     { "" }
451   if$
452 }
453
454 FUNCTION {format.edition}
455 { edition empty$
456     { "" }
457     { output.state mid.sentence =
458         { edition "l" change.case$ " edition" * }
459         { edition "t" change.case$ " edition" * }
460       if$
461     }
462   if$
463 }
464
465 INTEGERS { multiresult }
466
467 FUNCTION {multi.page.check}
468 { 't :=
469   #0 'multiresult :=
470     { multiresult not
471       t empty$ not
472       and
473     }
474     { t #1 #1 substring$
475       duplicate$ "-" =
476       swap$ duplicate$ "," =
477       swap$ "+" =
478       or or
479         { #1 'multiresult := }
480         { t #2 global.max$ substring$ 't := }
481       if$
482     }
483   while$
484   multiresult
485 }
486
487
488 FUNCTION {format.pages}
489 { pages empty$
490     { "" }
491     { pages multi.page.check
492         { pages n.dashify }
493         { pages }
494       if$
495     }
496   if$
497 }
498
499
500 FUNCTION {format.in.pages}
501 { pages empty$
502     { "" }
503     { pages multi.page.check
504         { " pp.\ " pages n.dashify *}
505         { " pp.\ " pages *}
506       if$
507     }
508   if$
509 }
510
511
512 FUNCTION {format.journal.num.vol.date}
513 { journal empty$
514     { "there's no journal in " cite$ * warning$ }
515     { journal emphasize " " * }
516     if$  
517   volume empty$
518     { "there's no volume in " cite$ * warning$ } 
519     { number empty$
520        { volume bold * " " * }
521        { "(" * number * ") " * volume bold * %*
522        }
523        if$
524     } 
525   if$
526   year empty$
527     { "empty year in " cite$ * warning$ }
528     { " (" * format.date * ")" * }
529   if$
530 }
531
532 FUNCTION {format.chapter.pages}
533 { chapter empty$
534     'format.in.pages 
535     { type empty$
536         { " chapter" }
537         { type "l" change.case$ }
538       if$
539       chapter tie.or.space.connect
540       pages empty$
541         'skip$
542         { ", " * format.in.pages * }
543       if$
544     }
545   if$
546 }
547
548 FUNCTION {format.in.booktitle.ed}
549 { booktitle empty$
550     { "" }
551     { editor empty$
552         { " in: " booktitle emphasize * }
553         { " in: "  booktitle emphasize * " " * format.editors * }
554       if$
555     }
556   if$
557 }
558
559 FUNCTION {format.publisher.address.date}
560 { publisher empty$
561     { address empty$
562         { " (" }
563         { "there's an address but no publisher in " cite$ * warning$}
564         if$
565      }
566      {address empty$
567         { " ("  publisher * ", " * }
568         { " ("  publisher * ", " * address * ", " * }
569         if$
570      }
571      if$
572   year empty$
573     { "empty year in " cite$ * warning$ }
574     { format.date * ")" *}
575   if$    
576 }
577    
578 FUNCTION {empty.misc.check}
579 { author empty$ title empty$ howpublished empty$
580   month empty$ year empty$ note empty$
581   and and and and and
582   key empty$ not and
583     { "all relevant fields are empty in " cite$ * warning$ }
584     'skip$
585   if$
586 }
587
588 FUNCTION {format.thesis.type}
589 { type empty$
590     'skip$
591     { pop$
592       type "t" change.case$ *
593     }
594   if$
595 }
596
597 FUNCTION {format.school.address.date}
598 { school empty$
599     { "empty school in " cite$ * warning$ }
600     { school  ", " * }
601   if$
602   address empty$
603     'skip$
604     { address * ", " * }
605   if$    
606   year empty$
607     { "empty year in " cite$ * warning$ }
608     { format.date * ")" *}
609   if$    
610 }
611
612 FUNCTION {format.instit.address.date}
613 { institution empty$
614     { "empty institution in " cite$ * warning$ }
615     { "(" institution * ", " * }
616   if$
617   address empty$
618     'skip$
619     { address * ", " * }
620   if$    
621   year empty$
622     { "empty year in " cite$ * warning$ }
623     { format.date * ")" *}
624   if$    
625 }
626
627 FUNCTION {format.organ.address.date}
628 { organization empty$
629     { "empty organization in " cite$ * warning$ }
630     { "(" organization * ", " * }
631   if$
632   address empty$
633     'skip$
634     { address * ", " * }
635   if$    
636   year empty$
637     { "empty year in " cite$ * warning$ }
638     { format.date * ")" *}
639   if$    
640 }
641
642
643 FUNCTION {format.tr.number}
644 { type empty$
645     { "Technical Report" }
646     'type
647   if$
648   number empty$
649     { "t" change.case$ }
650     { number tie.or.space.connect }
651   if$
652 }
653
654 FUNCTION {format.article.crossref}
655 { key empty$
656     { journal empty$
657         { "need key or journal for " cite$ * " to crossref " * crossref *
658           warning$
659           ""
660         }
661         { "In {\em " journal * "\/}" * }
662       if$
663     }
664     { "In " key * }
665   if$
666   " \cite{" * crossref * "}" *
667 }
668
669 FUNCTION {format.crossref.editor}
670 { editor #1 "{vv~}{ll}" format.name$
671   editor num.names$ duplicate$
672   #2 >
673     { pop$ " et~al." * }
674     { #2 <
675         'skip$
676         { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
677             { " et~al." * }
678             { " and " * editor #2 "{vv~}{ll}" format.name$ * }
679           if$
680         }
681       if$
682     }
683   if$
684 }
685
686 FUNCTION {format.book.crossref}
687 { volume empty$
688     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
689       "In "
690     }
691     { "Volume" volume tie.or.space.connect
692       " of " *
693     }
694   if$
695   editor empty$
696   editor field.or.null author field.or.null =
697   or
698     { key empty$
699         { series empty$
700             { "need editor, key, or series for " cite$ * " to crossref " *
701               crossref * warning$
702               "" *
703             }
704             { "{\em " * series * "\/}" * }
705           if$
706         }
707         { key * }
708       if$
709     }
710     { format.crossref.editor * }
711   if$
712   " \cite{" * crossref * "}" *
713 }
714
715 FUNCTION {format.incoll.inproc.crossref}
716 { editor empty$
717   editor field.or.null author field.or.null =
718   or
719     { key empty$
720         { booktitle empty$
721             { "need editor, key, or booktitle for " cite$ * " to crossref " *
722               crossref * warning$
723               ""
724             }
725             { "In {\em " booktitle * "\/}" * }
726           if$
727         }
728         { "In " key * }
729       if$
730     }
731     { "In " format.crossref.editor * }
732   if$
733   " \cite{" * crossref * "}" *
734 }
735
736 FUNCTION {article}
737 { output.bibitem
738   format.authors "author" output.check
739   format.title "title" output.check
740   crossref missing$
741     { format.journal.num.vol.date output
742       format.pages output       
743     }
744     { format.article.crossref output.nonnull
745       format.pages output
746     }
747   if$
748   note empty$
749     'skip$
750 %    { "" * }
751     { no.comma
752       " " * note output
753     }
754    if$
755   fin.entry
756 }
757
758 FUNCTION {book}
759 { output.bibitem
760   author empty$
761     { format.lead.editors "author and editor" output.check }
762     { format.authors output.nonnull
763       crossref missing$
764         { "author and editor" editor either.or.check }
765         'skip$
766       if$
767     }
768   if$
769   format.btitle "title" output.check
770   crossref missing$
771     { format.bvolume output
772       format.number.series output
773       format.edition output
774       note output
775       no.comma
776       format.publisher.address.date "publisher" output.check    
777     }
778     { new.block
779       format.book.crossref output.nonnull
780     }
781   if$
782   new.block
783   fin.entry
784 }
785
786 FUNCTION {booklet}
787 { output.bibitem
788   format.authors output
789   format.title "title" output.check
790   howpublished address new.block.checkb
791   howpublished output
792   address output
793   format.date output
794   new.block
795   note output
796   fin.entry
797 }
798
799 FUNCTION {inbook}
800 { output.bibitem
801   author empty$
802     { format.lead.editors "author and editor" output.check }
803     { format.authors output.nonnull
804       crossref missing$
805         { "author and editor" editor either.or.check }
806         'skip$
807       if$
808     }
809   if$
810   format.btitle "title" output.check
811   crossref missing$
812     { chapter output
813       no.comma 
814   note  output
815       format.romanseries.volumeornumber output
816       format.edition output
817       no.comma
818       format.publisher.address.date "publisher" output.check
819       no.comma
820       format.in.pages output 
821     }
822     { format.chapter.pages "chapter and pages" output.check
823       new.block
824       format.book.crossref output.nonnull
825     }
826   if$
827   fin.entry
828 }
829
830 FUNCTION {incollection}
831 { output.bibitem
832   format.authors "author" output.check
833   format.title "title" output.check
834   crossref missing$
835     { format.in.booktitle.ed "booktitle" output.check
836       format.series.volumeornumber output
837       format.edition output
838       no.comma
839       format.publisher.address.date "publisher" output.check
840       no.comma
841       format.chapter.pages output
842     }
843     { format.incoll.inproc.crossref output.nonnull
844       format.chapter.pages output
845     }
846   if$
847   new.block
848   note output
849   fin.entry
850 }
851
852 FUNCTION {inproceedings}
853 { output.bibitem
854   format.authors "author" output.check
855   format.title "title" output.check
856   crossref missing$
857     { format.in.booktitle.ed "booktitle" output.check
858       format.bvolume output
859       format.number.series output
860       organization output
861       no.comma
862       format.publisher.address.date output
863       note output
864       no.comma
865       format.in.pages output
866     }
867     { format.incoll.inproc.crossref output.nonnull
868       format.pages output
869     }
870   if$
871   fin.entry
872 }
873
874 FUNCTION {conference} { inproceedings }
875
876 FUNCTION {manual}
877 { output.bibitem
878   author empty$
879     { organization empty$
880         'skip$
881         { organization output.nonnull
882           address output
883         }
884       if$
885     }
886     { format.authors output.nonnull }
887   if$
888   format.btitle "title" output.check
889   format.edition output
890   author empty$
891     { organization empty$
892         { address new.block.checka
893           address output
894         }
895         'skip$
896       if$
897     }
898     { format.organ.address.date output
899     }
900   if$
901   note output
902   fin.entry
903 }
904
905 FUNCTION {mastersthesis}
906 { output.bibitem
907   format.authors "author" output.check
908   format.btitle "title" output.check
909   no.comma
910   " (Master's Thesis" format.thesis.type output.nonnull 
911   format.school.address.date output
912   note output
913   fin.entry
914 }
915
916 FUNCTION {misc}
917 { output.bibitem
918   format.authors output
919   title howpublished new.block.checkb
920   comma
921   format.title output
922   note emphasize output
923   howpublished output
924   format.date output
925   fin.entry
926   empty.misc.check
927 }
928
929 FUNCTION {phdthesis}
930 { output.bibitem
931   format.authors "author" output.check
932   format.btitle "title" output.check
933   no.comma
934   " (Ph.D. Thesis" format.thesis.type output.nonnull
935   format.school.address.date output
936   note output
937   fin.entry
938 }
939
940 FUNCTION {dissertation}
941 { output.bibitem
942   format.authors "author" output.check
943   format.btitle "title" output.check
944   no.comma
945   " (Dissertation" format.thesis.type output.nonnull
946   format.school.address.date output
947   note output
948   fin.entry
949 }
950
951 FUNCTION {honoursthesis}
952 { output.bibitem
953   format.authors "author" output.check
954   format.btitle "title" output.check
955   no.comma
956   " (Honours Thesis" format.thesis.type output.nonnull
957   format.school.address.date output
958   note output
959   fin.entry
960 }
961
962 FUNCTION {lecture}
963 { output.bibitem
964   format.authors "author" output.check
965   format.btitle "title" output.check
966   no.comma
967   " (Lecture notes" format.thesis.type output.nonnull
968   format.school.address.date output
969   note output
970   fin.entry
971 }
972
973 FUNCTION {proceedings}
974 { output.bibitem
975   editor empty$
976     { organization output }
977     { format.editors output.nonnull }
978   if$
979   format.btitle "title" output.check
980   format.bvolume output
981   format.number.series output
982   organization output
983   note output
984   format.publisher.address.date output 
985   fin.entry
986 }
987
988 FUNCTION {techreport}
989 { output.bibitem
990   format.authors "author" output.check
991   format.title "title" output.check
992   format.tr.number output.nonnull
993   format.instit.address.date "year" output.check
994   note output
995   fin.entry
996 }
997
998 FUNCTION {unpublished}
999 { output.bibitem
1000   format.authors "author" output.check
1001   format.title "title" output.check
1002   note "note" output.check
1003   format.date output
1004   fin.entry
1005 }
1006
1007 FUNCTION {default.type} { misc }
1008
1009 MACRO {jan} {"January"}
1010
1011 MACRO {feb} {"February"}
1012
1013 MACRO {mar} {"March"}
1014
1015 MACRO {apr} {"April"}
1016
1017 MACRO {may} {"May"}
1018
1019 MACRO {jun} {"June"}
1020
1021 MACRO {jul} {"July"}
1022
1023 MACRO {aug} {"August"}
1024
1025 MACRO {sep} {"September"}
1026
1027 MACRO {oct} {"October"}
1028
1029 MACRO {nov} {"November"}
1030
1031 MACRO {dec} {"December"}
1032
1033 MACRO {acmcs} {"ACM Computing Surveys"}
1034
1035 MACRO {acta} {"Acta Informatica"}
1036
1037 MACRO {cacm} {"Communications of the ACM"}
1038
1039 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1040
1041 MACRO {ibmsj} {"IBM Systems Journal"}
1042
1043 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1044
1045 MACRO {ieeetc} {"IEEE Transactions on Computers"}
1046
1047 MACRO {ieeetcad}
1048  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1049
1050 MACRO {ipl} {"Information Processing Letters"}
1051
1052 MACRO {jacm} {"Journal of the ACM"}
1053
1054 MACRO {jcss} {"Journal of Computer and System Sciences"}
1055
1056 MACRO {scp} {"Science of Computer Programming"}
1057
1058 MACRO {sicomp} {"SIAM Journal on Computing"}
1059
1060 MACRO {tocs} {"ACM Transactions on Computer Systems"}
1061
1062 MACRO {tods} {"ACM Transactions on Database Systems"}
1063
1064 MACRO {tog} {"ACM Transactions on Graphics"}
1065
1066 MACRO {toms} {"ACM Transactions on Mathematical Software"}
1067
1068 MACRO {toois} {"ACM Transactions on Office Information Systems"}
1069
1070 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1071
1072 MACRO {tcs} {"Theoretical Computer Science"}
1073
1074 READ
1075
1076 FUNCTION {sortify}
1077 { purify$
1078   "l" change.case$
1079 }
1080
1081 INTEGERS { len }
1082
1083 FUNCTION {chop.word}
1084 { 's :=
1085   'len :=
1086   s #1 len substring$ =
1087     { s len #1 + global.max$ substring$ }
1088     's
1089   if$
1090 }
1091
1092 FUNCTION {sort.format.names}
1093 { 's :=
1094   #1 'nameptr :=
1095   ""
1096   s num.names$ 'numnames :=
1097   numnames 'namesleft :=
1098     { namesleft #0 > }
1099     { nameptr #1 >
1100         { "   " * }
1101         'skip$
1102       if$
1103       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
1104       nameptr numnames = t "others" = and
1105         { "et al" * }
1106         { t sortify * }
1107       if$
1108       nameptr #1 + 'nameptr :=
1109       namesleft #1 - 'namesleft :=
1110     }
1111   while$
1112 }
1113
1114 FUNCTION {sort.format.title}
1115 { 't :=
1116   "A " #2
1117     "An " #3
1118       "The " #4 t chop.word
1119     chop.word
1120   chop.word
1121   sortify
1122   #1 global.max$ substring$
1123 }
1124
1125 FUNCTION {author.sort}
1126 { author empty$
1127     { key empty$
1128         { "to sort, need author or key in " cite$ * warning$
1129           ""
1130         }
1131         { key sortify }
1132       if$
1133     }
1134     { author sort.format.names }
1135   if$
1136 }
1137
1138 FUNCTION {author.editor.sort}
1139 { author empty$
1140     { editor empty$
1141         { key empty$
1142             { "to sort, need author, editor, or key in " cite$ * warning$
1143               ""
1144             }
1145             { key sortify }
1146           if$
1147         }
1148         { editor sort.format.names }
1149       if$
1150     }
1151     { author sort.format.names }
1152   if$
1153 }
1154
1155 FUNCTION {author.organization.sort}
1156 { author empty$
1157     { organization empty$
1158         { key empty$
1159             { "to sort, need author, organization, or key in " cite$ * warning$
1160               ""
1161             }
1162             { key sortify }
1163           if$
1164         }
1165         { "The " #4 organization chop.word sortify }
1166       if$
1167     }
1168     { author sort.format.names }
1169   if$
1170 }
1171
1172 FUNCTION {editor.organization.sort}
1173 { editor empty$
1174     { organization empty$
1175         { key empty$
1176             { "to sort, need editor, organization, or key in " cite$ * warning$
1177               ""
1178             }
1179             { key sortify }
1180           if$
1181         }
1182         { "The " #4 organization chop.word sortify }
1183       if$
1184     }
1185     { editor sort.format.names }
1186   if$
1187 }
1188
1189 FUNCTION {presort}
1190 { type$ "book" =
1191   type$ "inbook" =
1192   or
1193     'author.editor.sort
1194     { type$ "proceedings" =
1195         'editor.organization.sort
1196         { type$ "manual" =
1197             'author.organization.sort
1198             'author.sort
1199           if$
1200         }
1201       if$
1202     }
1203   if$
1204   "    "
1205   *
1206   year field.or.null sortify
1207   *
1208   "    "
1209   *
1210   title field.or.null
1211   sort.format.title
1212   *
1213   #1 entry.max$ substring$
1214   'sort.key$ :=
1215 }
1216
1217 ITERATE {presort}
1218
1219 SORT
1220
1221 STRINGS { longest.label }
1222
1223 INTEGERS { number.label longest.label.width }
1224
1225 FUNCTION {initialize.longest.label}
1226 { "" 'longest.label :=
1227   #1 'number.label :=
1228   #0 'longest.label.width :=
1229 }
1230
1231 FUNCTION {longest.label.pass}
1232 { number.label int.to.str$ 'label :=
1233   number.label #1 + 'number.label :=
1234   label width$ longest.label.width >
1235     { label 'longest.label :=
1236       label width$ 'longest.label.width :=
1237     }
1238     'skip$
1239   if$
1240 }
1241
1242 EXECUTE {initialize.longest.label}
1243
1244 ITERATE {longest.label.pass}
1245
1246 FUNCTION {begin.bib}
1247 { preamble$ empty$
1248     'skip$
1249     { preamble$ write$ newline$ }
1250   if$
1251   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
1252 }
1253
1254 EXECUTE {begin.bib}
1255
1256 EXECUTE {init.state.consts}
1257
1258 ITERATE {call.type$}
1259
1260 FUNCTION {end.bib}
1261 { newline$
1262   "\end{thebibliography}" write$ newline$
1263 }
1264
1265 EXECUTE {end.bib}

UCC git Repository :: git.ucc.asn.au