source: unsrt-AUCuserGuides.bst

Last change on this file was 1, checked in by root, 11 years ago

Initial Commit

File size: 16.5 KB
Line 
1% BibTeX standard bibliography style `unsrt'
2  % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
3  % Copyright (C) 1985, all rights reserved.
4  % Copying of this file is authorized only if either
5  % (1) you make absolutely no changes to your copy, including name, or
6  % (2) if you do make changes, you name it something other than
7  % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
8  % This restriction helps ensure that all standard styles are identical.
9  % The file btxbst.doc has the documentation for this style.
10
11ENTRY
12  { address
13    author
14    booktitle
15    chapter
16    city
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
39INTEGERS { output.state before.all mid.sentence after.sentence after.block }
40
41FUNCTION {init.state.consts}
42{ #0 'before.all :=
43  #1 'mid.sentence :=
44  #2 'after.sentence :=
45  #3 'after.block :=
46}
47
48STRINGS { s t }
49
50FUNCTION {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
71FUNCTION {output}
72{ duplicate$ empty$
73    'pop$
74    'output.nonnull
75  if$
76}
77
78FUNCTION {output.check}
79{ 't :=
80  duplicate$ empty$
81    { pop$ "empty " t * " in " * cite$ * warning$ }
82    'output.nonnull
83  if$
84}
85
86FUNCTION {output.bibitem}
87{ newline$
88  "\bibitem{" write$
89  cite$ write$
90  "}" write$
91  newline$
92  ""
93  before.all 'output.state :=
94}
95
96FUNCTION {fin.entry}
97{ add.period$
98  write$
99  newline$
100}
101
102FUNCTION {new.block}
103{ output.state before.all =
104    'skip$
105    { after.block 'output.state := }
106  if$
107}
108
109FUNCTION {new.sentence}
110{ output.state after.block =
111    'skip$
112    { output.state before.all =
113  'skip$
114  { after.sentence 'output.state := }
115      if$
116    }
117  if$
118}
119
120FUNCTION {not}
121{   { #0 }
122    { #1 }
123  if$
124}
125
126FUNCTION {and}
127{   'skip$
128    { pop$ #0 }
129  if$
130}
131
132FUNCTION {or}
133{   { pop$ #1 }
134    'skip$
135  if$
136}
137
138FUNCTION {new.block.checka}
139{ empty$
140    'skip$
141    'new.block
142  if$
143}
144
145FUNCTION {new.block.checkb}
146{ empty$
147  swap$ empty$
148  and
149    'skip$
150    'new.block
151  if$
152}
153
154FUNCTION {new.sentence.checka}
155{ empty$
156    'skip$
157    'new.sentence
158  if$
159}
160
161FUNCTION {new.sentence.checkb}
162{ empty$
163  swap$ empty$
164  and
165    'skip$
166    'new.sentence
167  if$
168}
169
170FUNCTION {field.or.null}
171{ duplicate$ empty$
172    { pop$ "" }
173    'skip$
174  if$
175}
176
177FUNCTION {emphasize}
178{ duplicate$ empty$
179    { pop$ "" }
180    { "{\em " swap$ * "}" * }
181  if$
182}
183
184INTEGERS { nameptr namesleft numnames }
185
186FUNCTION {format.names}
187{ 's :=
188  #1 'nameptr :=
189  s num.names$ 'numnames :=
190  numnames 'namesleft :=
191    { namesleft #0 > }
192    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
193      nameptr #1 >
194  { namesleft #1 >
195      { ", " * t * }
196      { numnames #2 >
197    { "," * }
198    'skip$
199        if$
200        t "others" =
201    { " et~al." * }
202    { " and " * t * }
203        if$
204      }
205    if$
206  }
207  't
208      if$
209      nameptr #1 + 'nameptr :=
210      namesleft #1 - 'namesleft :=
211    }
212  while$
213}
214
215FUNCTION {format.authors}
216{ author empty$
217    { "" }
218    { author format.names }
219  if$
220}
221
222FUNCTION {format.editors}
223{ editor empty$
224    { "" }
225    { editor format.names
226      editor num.names$ #1 >
227  { " (editors)" * }
228  { " (editor)" * }
229      if$
230    }  if$
231}
232
233FUNCTION {format.title}
234{ title empty$
235    { "" }
236    { title  }
237  if$
238}
239
240FUNCTION {n.dashify}
241{ 't :=
242  ""
243    { t empty$ not }
244    { t #1 #1 substring$ "-" =
245  { t #1 #2 substring$ "--" = not
246      { "--" *
247        t #2 global.max$ substring$ 't :=
248      }
249      {   { t #1 #1 substring$ "-" = }
250    { "-" *
251      t #2 global.max$ substring$ 't :=
252    }
253        while$
254      }
255    if$
256  }
257  { t #1 #1 substring$ *
258    t #2 global.max$ substring$ 't :=
259  }
260      if$
261    }
262  while$
263}
264
265FUNCTION {format.date}
266{ year empty$
267    { month empty$
268  { "" }
269  { "there's a month but no year in " cite$ * warning$
270    month
271  }
272      if$
273    }
274    { month empty$
275  'year
276  { month " " * year * }
277      if$
278    }
279  if$
280}
281
282FUNCTION {format.btitle}
283{ title emphasize
284}
285
286FUNCTION {tie.or.space.connect}
287{ duplicate$ text.length$ #3 <
288    { "~" }
289    { " " }
290  if$
291  swap$ * *
292}
293
294FUNCTION {either.or.check}
295{ empty$
296    'pop$
297    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
298  if$
299}
300
301FUNCTION {format.bvolume}
302{ volume empty$
303    { "" }
304    { "volume" volume tie.or.space.connect
305      series empty$
306  'skip$
307  { " of " * series emphasize * }
308      if$
309      "volume and number" number either.or.check
310    }
311  if$
312}
313
314FUNCTION {format.number.series}
315{ volume empty$
316    { number empty$
317  { series field.or.null }
318  { output.state mid.sentence =
319      { "number" }
320      { "Number" }
321    if$
322    number tie.or.space.connect
323    series empty$
324      { "there's a number but no series in " cite$ * warning$ }
325      { " in " * series * }
326    if$
327  }
328      if$
329    }
330    { "" }
331  if$
332}
333
334FUNCTION {format.edition}
335{ edition empty$
336    { "" }
337    { output.state mid.sentence =
338  { edition "l" change.case$ " edition" * }
339  { edition "t" change.case$ " edition" * }
340      if$
341    }
342  if$
343}
344
345INTEGERS { multiresult }
346
347FUNCTION {multi.page.check}
348{ 't :=
349  #0 'multiresult :=
350    { multiresult not
351      t empty$ not
352      and
353    }
354    { t #1 #1 substring$
355      duplicate$ "-" =
356      swap$ duplicate$ "," =
357      swap$ "+" =
358      or or
359  { #1 'multiresult := }
360  { t #2 global.max$ substring$ 't := }
361      if$
362    }
363  while$
364  multiresult
365}
366
367FUNCTION {format.pages}
368{ pages empty$
369    { "" }
370    { pages multi.page.check
371  { "pages" pages n.dashify tie.or.space.connect }
372  { "page" pages tie.or.space.connect }
373      if$
374    }
375  if$
376}
377
378FUNCTION {format.vol.num.pages}
379{ volume field.or.null
380  number empty$
381    'skip$
382    { "(" number * ")" * *
383      volume empty$
384  { "there's a number but no volume in " cite$ * warning$ }
385  'skip$
386      if$
387    }
388  if$
389  pages empty$
390    'skip$
391    { duplicate$ empty$
392  { pop$ format.pages }
393  { ":" * pages n.dashify * }
394      if$
395    }
396  if$
397}
398
399FUNCTION {format.chapter.pages}
400{ chapter empty$
401    'format.pages
402    { type empty$
403  { "chapter" }
404  { type "l" change.case$ }
405      if$
406      chapter tie.or.space.connect
407      pages empty$
408  'skip$
409  { ", " * format.pages * }
410      if$
411    }
412  if$
413}
414
415FUNCTION {format.in.ed.booktitle}
416{ booktitle empty$
417    { "" }
418    { editor empty$
419  { "In " booktitle emphasize * }
420  { "In " format.editors * ", " * booktitle emphasize * }
421      if$
422    }
423  if$
424}
425
426FUNCTION {empty.misc.check}
427{ author empty$ title empty$ howpublished empty$
428  month empty$ year empty$ note empty$
429  and and and and and
430    { "all relevant fields are empty in " cite$ * warning$ }
431    'skip$
432  if$
433}
434
435FUNCTION {format.thesis.type}
436{ type empty$
437    'skip$
438    { pop$
439      type "t" change.case$
440    }
441  if$
442}
443
444FUNCTION {format.tr.number}
445{ type empty$
446    { "Technical Report" }
447    'type
448  if$
449}
450
451FUNCTION {format.article.crossref}
452{ key empty$
453    { journal empty$
454  { "need key or journal for " cite$ * " to crossref " * crossref *
455    warning$
456    ""
457  }
458  { "In {\em " journal * "\/}" * }
459      if$
460    }
461    { "In " key * }
462  if$
463  " \cite{" * crossref * "}" *
464}
465
466FUNCTION {format.crossref.editor}
467{ editor #1 "{vv~}{ll}" format.name$
468  editor num.names$ duplicate$
469  #2 >
470    { pop$ " et~al." * }
471    { #2 <
472  'skip$
473  { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
474      { " et~al." * }
475      { " and " * editor #2 "{vv~}{ll}" format.name$ * }
476    if$
477  }
478      if$
479    }
480  if$
481}
482
483FUNCTION {format.book.crossref}
484{ volume empty$
485    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
486      "In "
487    }
488    { "Volume" volume tie.or.space.connect
489      " of " *
490    }
491  if$
492  editor empty$
493  editor field.or.null author field.or.null =
494  or
495    { key empty$
496  { series empty$
497      { "need editor, key, or series for " cite$ * " to crossref " *
498        crossref * warning$
499        "" *
500      }
501      { "{\em " * series * "\/}" * }
502    if$
503  }
504  { key * }
505      if$
506    }
507    { format.crossref.editor * }
508  if$
509  " \cite{" * crossref * "}" *
510}
511
512FUNCTION {format.incoll.inproc.crossref}
513{ editor empty$
514  editor field.or.null author field.or.null =
515  or
516    { key empty$
517  { booktitle empty$
518      { "need editor, key, or booktitle for " cite$ * " to crossref " *
519        crossref * warning$
520        ""
521      }
522      { "In {\em " booktitle * "\/}" * }
523    if$
524  }
525  { "In " key * }
526      if$
527    }
528    { "In " format.crossref.editor * }
529  if$
530  " \cite{" * crossref * "}" *
531}
532
533FUNCTION {article}
534{ output.bibitem
535  format.authors "author" output.check
536  new.block
537  format.title "title" output.check
538  new.block
539  crossref missing$
540    { journal emphasize "journal" output.check
541      format.vol.num.pages output
542      format.date "year" output.check
543    }
544    { format.article.crossref output.nonnull
545      format.pages output
546    }
547  if$
548  new.block
549  note output
550  fin.entry
551}
552
553FUNCTION {book}
554{ output.bibitem
555  author empty$
556    { format.editors "author and editor" output.check }
557    { format.authors output.nonnull
558      crossref missing$
559  { "author and editor" editor either.or.check }
560  'skip$
561      if$
562    }
563  if$
564  new.block
565  format.btitle "title" output.check
566  crossref missing$
567    { format.bvolume output
568      new.block
569      format.number.series output
570      new.sentence
571      publisher "publisher" output.check
572      address output
573      city output
574    }
575    { new.block
576      format.book.crossref output.nonnull
577    }
578  if$
579  format.edition output
580  format.date "year" output.check
581  new.block
582  note output
583  fin.entry
584}
585
586FUNCTION {booklet}
587{ output.bibitem
588  format.authors output
589  new.block
590  format.title "title" output.check
591  howpublished address new.block.checkb
592  howpublished output
593  address output
594  format.date output
595  new.block
596  note output
597  fin.entry
598}
599
600FUNCTION {inbook}
601{ output.bibitem
602  author empty$
603    { format.editors "author and editor" output.check }
604    { format.authors output.nonnull
605      crossref missing$
606  { "author and editor" editor either.or.check }
607  'skip$
608      if$
609    }
610  if$
611  new.block
612  format.btitle "title" output.check
613  crossref missing$
614    { format.bvolume output
615      format.chapter.pages "chapter and pages" output.check
616      new.block
617      format.number.series output
618      new.sentence
619      publisher "publisher" output.check
620      address output
621    }
622    { format.chapter.pages "chapter and pages" output.check
623      new.block
624      format.book.crossref output.nonnull
625    }
626  if$
627  format.edition output
628  format.date "year" output.check
629  new.block
630  note output
631  fin.entry
632}
633
634FUNCTION {incollection}
635{ output.bibitem
636  format.authors "author" output.check
637  new.block
638  format.title "title" output.check
639  new.block
640  crossref missing$
641    { format.in.ed.booktitle "booktitle" output.check
642      format.bvolume output
643      format.number.series output
644      format.chapter.pages output
645      new.sentence
646      publisher "publisher" output.check
647      address output
648      city output
649      format.edition output
650      format.date "year" output.check
651    }
652    { format.incoll.inproc.crossref output.nonnull
653      format.chapter.pages output
654    }
655  if$
656  new.block
657  note output
658  fin.entry
659}
660
661FUNCTION {inproceedings}
662{ output.bibitem
663  format.authors "author" output.check
664  new.block
665  format.title "title" output.check
666  new.block
667  crossref missing$
668    { format.in.ed.booktitle "booktitle" output.check
669      format.bvolume output
670      format.number.series output
671      format.pages output
672      address empty$
673  { organization publisher new.sentence.checkb
674    organization output
675    publisher output
676    format.date "year" output.check
677  }
678  { address output.nonnull
679    format.date "year" output.check
680    new.sentence
681    organization output
682    publisher output
683  }
684      if$
685    }
686    { format.incoll.inproc.crossref output.nonnull
687      format.pages output
688    }
689  if$
690  new.block
691  note output
692  fin.entry
693}
694
695FUNCTION {conference} { inproceedings }
696
697FUNCTION {manual}
698{ output.bibitem
699  author empty$
700    { organization empty$
701  'skip$
702  { organization output.nonnull
703    address output
704  }
705      if$
706    }
707    { format.authors output.nonnull }
708  if$
709  new.block
710  format.btitle "title" output.check
711  author empty$
712    { organization empty$
713  { address new.block.checka
714    address output
715  }
716  'skip$
717      if$
718    }
719    { organization address new.block.checkb
720      organization output
721      address output
722    }
723  if$
724  format.edition output
725  format.date output
726  new.block
727  note output
728  fin.entry
729}
730
731FUNCTION {mastersthesis}
732{ output.bibitem
733  format.authors "author" output.check
734  new.block
735  format.title "title" output.check
736  new.block
737  "Master's thesis" format.thesis.type output.nonnull
738  school "school" output.check
739  address output
740  format.date "year" output.check
741  new.block
742  note output
743  fin.entry
744}
745
746FUNCTION {misc}
747{ output.bibitem
748  format.authors output
749  title howpublished new.block.checkb
750  format.title output
751  howpublished new.block.checka
752  howpublished output
753  format.date output
754  new.block
755  note output
756  fin.entry
757  empty.misc.check
758}
759
760FUNCTION {phdthesis}
761{ output.bibitem
762  format.authors "author" output.check
763  new.block
764  format.btitle "title" output.check
765  new.block
766  "PhD thesis" format.thesis.type output.nonnull
767  school "school" output.check
768  address output
769  format.date "year" output.check
770  new.block
771  note output
772  fin.entry
773}
774
775FUNCTION {proceedings}
776{ output.bibitem
777  editor empty$
778    { organization output }
779    { format.editors output.nonnull }
780  if$
781  new.block
782  format.btitle "title" output.check
783  format.bvolume output
784  format.number.series output
785  address empty$
786    { editor empty$
787  { publisher new.sentence.checka }
788  { organization publisher new.sentence.checkb
789    organization output
790  }
791      if$
792      publisher output
793      format.date "year" output.check
794    }
795    { address output.nonnull
796      format.date "year" output.check
797      new.sentence
798      editor empty$
799  'skip$
800  { organization output }
801      if$
802      publisher output
803    }
804  if$
805  new.block
806  note output
807  fin.entry
808}
809
810FUNCTION {techreport}
811{ output.bibitem
812  format.authors "author" output.check
813  new.block
814  format.title "title" output.check
815  number output
816  new.block
817  format.tr.number output.nonnull
818  institution "institution" output.check
819  address output
820  city output
821  format.date "year" output.check
822  new.block
823  note output
824  fin.entry
825}
826
827FUNCTION {unpublished}
828{ output.bibitem
829  format.authors "author" output.check
830  new.block
831  format.title "title" output.check
832  new.block
833  note "note" output.check
834  format.date output
835  fin.entry
836}
837
838FUNCTION {default.type} { misc }
839
840MACRO {jan} {"January"}
841
842MACRO {feb} {"February"}
843
844MACRO {mar} {"March"}
845
846MACRO {apr} {"April"}
847
848MACRO {may} {"May"}
849
850MACRO {jun} {"June"}
851
852MACRO {jul} {"July"}
853
854MACRO {aug} {"August"}
855
856MACRO {sep} {"September"}
857
858MACRO {oct} {"October"}
859
860MACRO {nov} {"November"}
861
862MACRO {dec} {"December"}
863
864MACRO {acmcs} {"ACM Computing Surveys"}
865
866MACRO {acta} {"Acta Informatica"}
867
868MACRO {cacm} {"Communications of the ACM"}
869
870MACRO {ibmjrd} {"IBM Journal of Research and Development"}
871
872MACRO {ibmsj} {"IBM Systems Journal"}
873
874MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
875
876MACRO {ieeetc} {"IEEE Transactions on Computers"}
877
878MACRO {ieeetcad}
879 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
880
881MACRO {ipl} {"Information Processing Letters"}
882
883MACRO {jacm} {"Journal of the ACM"}
884
885MACRO {jcss} {"Journal of Computer and System Sciences"}
886
887MACRO {scp} {"Science of Computer Programming"}
888
889MACRO {sicomp} {"SIAM Journal on Computing"}
890
891MACRO {tocs} {"ACM Transactions on Computer Systems"}
892
893MACRO {tods} {"ACM Transactions on Database Systems"}
894
895MACRO {tog} {"ACM Transactions on Graphics"}
896
897MACRO {toms} {"ACM Transactions on Mathematical Software"}
898
899MACRO {toois} {"ACM Transactions on Office Information Systems"}
900
901MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
902
903MACRO {tcs} {"Theoretical Computer Science"}
904
905READ
906
907STRINGS { longest.label }
908
909INTEGERS { number.label longest.label.width }
910
911FUNCTION {initialize.longest.label}
912{ "" 'longest.label :=
913  #1 'number.label :=
914  #0 'longest.label.width :=
915}
916
917FUNCTION {longest.label.pass}
918{ number.label int.to.str$ 'label :=
919  number.label #1 + 'number.label :=
920  label width$ longest.label.width >
921    { label 'longest.label :=
922      label width$ 'longest.label.width :=
923    }
924    'skip$
925  if$
926}
927
928EXECUTE {initialize.longest.label}
929
930ITERATE {longest.label.pass}
931
932FUNCTION {begin.bib}
933{ preamble$ empty$
934    'skip$
935    { preamble$ write$ newline$ }
936  if$
937  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
938}
939
940EXECUTE {begin.bib}
941
942EXECUTE {init.state.consts}
943
944ITERATE {call.type$}
945
946FUNCTION {end.bib}
947{ newline$
948  "\end{thebibliography}" write$ newline$
949}
950
951EXECUTE {end.bib}
Note: See TracBrowser for help on using the repository browser.