source: obsolete/trunk/VUT/doc/SciReport/is-alpha.bst @ 243

Revision 243, 40.3 KB checked in by bittner, 19 years ago (diff)

SciReport? template

Line 
1%% =====================================================================
2%% WARNING: Do NOT edit this file.  It was produced automatically by
3%% Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
4%% from file://plot79.math.utah.edu/u/sy/beebe/tex/bib/merge/xbtxbst.doc
5%% on Wed May 15 10:36:04 MDT 1996.
6%% =====================================================================
7%%%=====================================================================
8%%% @BibTeX-style-file{
9%%%     author          = "Nelson H. F. Beebe",
10%%%     version         = "2.03",
11%%%     date            = "15 May 1996",
12%%%     time            = "10:35:51 MDT",
13%%%     filename        = "is-alpha.bst",
14%%%     address         = "Center for Scientific Computing
15%%%                        Department of Mathematics
16%%%                        University of Utah
17%%%                        Salt Lake City, UT 84112
18%%%                        USA",
19%%%     telephone       = "+1 801 581 5254",
20%%%     FAX             = "+1 801 581 4148",
21%%%     URL             = "http://www.math.utah.edu/~beebe",
22%%%     checksum        = "49675 2020 5086 41225",
23%%%     email           = "beebe@math.utah.edu (Internet)",
24%%%     codetable       = "ISO/ASCII",
25%%%     keywords        = "BibTeX, style, bibliography",
26%%%     supported       = "yes",
27%%%     docstring       = "This file is a modification of the standard
28%%%                        BibTeX btxbst.doc file, or is a .bst file
29%%%                        derived from that modification.  It contains
30%%%                        optional added support for CODEN, ISBN, ISSN,
31%%%                        LCCN, and PRICE fields, extended PAGES
32%%%                        fields, the PERIODICAL entry, and extended
33%%%                        citation label suffixing.
34%%%
35%%%                        In addition, date formatting supports a day
36%%%                        keyword, so that bibliography entries can be
37%%%                        written with
38%%%
39%%%                            day   = {23},
40%%%                            month = aug,
41%%%
42%%%                        instead of the language-dependent awkward
43%%%                        forms required by the standard styles
44%%%
45%%%                            month = {23~} # aug,
46%%%                            month = aug # {~23},
47%%%
48%%%                        These older forms are, of course, still
49%%%                        handled correctly.
50%%%
51%%%                        The UNIX C preprocessor can be used to
52%%%                        extract the standard styles, as follows:
53%%%
54%%%                            cpp -P -DPLAIN xbtxbst.doc >plain.bst
55%%%                            cpp -P -DUNSRT xbtxbst.doc >unsrt.bst
56%%%                            cpp -P -DALPHA xbtxbst.doc >alpha.bst
57%%%                            cpp -P -DABBRV xbtxbst.doc >abbrv.bst
58%%%
59%%%                        To obtain correct file header checksums, pipe
60%%%                        the output through the checksum program, e.g.
61%%%
62%%%                            cpp -P -DPLAIN xbtxbst.doc | checksum >plain.bst
63%%%
64%%%                        The accompanying UNIX Makefile automates this
65%%%                        job, and provides some extra leading comments
66%%%                        in the generated style files warning the user
67%%%                        not to modify them.
68%%%
69%%%                        Additional optional definitions are recognized
70%%%                        to provide extensions to the standard styles:
71%%%
72%%%                            -D_CODEN for CODEN output
73%%%
74%%%                            -D_ISBN for ISBN output
75%%%
76%%%                            -D_ISSN for ISSN output
77%%%
78%%%                            -D_LCCN for LCCN output
79%%%
80%%%                            -D_PRICE for price output,
81%%%
82%%%                            -D_BOOKPAGES for book, techreport, manual,
83%%%                            and thesis pages output.
84%%%
85%%%                            -D_URL to get World-Wide Web Uniform
86%%%                            Resource Locator (URL) output.
87%%%
88%%%                            -D_NUMERIC_SUFFIXES to get numeric
89%%%                            label suffixes -1, -2, ..., -26, instead of
90%%%                            letters a, b, ..., z, so as to correctly
91%%%                            handle alpha-style bibliographies with more
92%%%                            than 26 entries for a single author in one
93%%%                            year.  Change letter suffix code to switch
94%%%                            to numeric suffixes if more than 26 letters
95%%%                            are used, so that no matter which scheme is
96%%%                            selected, correct output will always be
97%%%                            obtained.
98%%%
99%%%                        The CODEN, ISBN, ISSN, LCCN, PRICE, and URL
100%%%                        values are wrapped inside macros \showCODEN{}
101%%%                        etc. that the user can provide alternate
102%%%                        definitions of to change the formatting, or
103%%%                        to suppress their output altogether.  That
104%%%                        way, output identical to that of the four
105%%%                        standard BibTeX style files can be obtained
106%%%                        with these extended files, if these macros
107%%%                        are defined to expand to empty strings.
108%%%
109%%%                        URL handling is slightly more complex,
110%%%                        because URLs can contain characters which TeX
111%%%                        must handle in verbatim mode in a typewriter
112%%%                        font, and such text cannot readily appear
113%%%                        inside nested macro arguments.  Consequently,
114%%%                        URLs are formatted in the .bbl file like
115%%%                        this:
116%%%                            \ifshowURL {\showURL \path|...|} \fi
117%%%                        where \showURL takes no argument, and
118%%%                        normally expands to the 4-character string
119%%%                        URL<space>.  The grouping braces ensure that
120%%%                        any font changes made by \showURL remain
121%%%                        localized.  Vertical bar is chosen as the
122%%%                        verbatim path delimiter, because it cannot
123%%%                        appear in URLs.  The other prohibited ISO
124%%%                        Latin 1 characters are the non-printing
125%%%                        control characters 0..31, plus those in the
126%%%                        range 128..255, plus the ten special
127%%%                        characters
128%%%
129%%%                            { } [ ] \ ^ ~ < > `
130%%%
131%%%                        See Internet RFC 1630 (June 1994) for more
132%%%                        details.  (Backquote is not even mentioned
133%%%                        there.)
134%%%
135%%%                        As an example of font changes, in LaTeX 2e
136%%%                        you might define
137%%%                            \newcommand{\showURL}{URL
138%%%                                \let \oldtt = \tt
139%%%                                \renewcommand{\tt}{\oldtt \itshape}}
140%%%                        to get URLs set in a typewriter italic font.
141%%%
142%%%                        If desired, a sed script can be used to
143%%%                        eliminate non-essential comments (this
144%%%                        reduces the file size by 2/3); a command
145%%%                        filter step like
146%%%                                sed -e '/^%$/d' -e '/^%[^%].*$/d'
147%%%                        will accomplish that job.
148%%%
149%%%                        The checksum field above contains a CRC-16
150%%%                        checksum as the first value, followed by the
151%%%                        equivalent of the standard UNIX wc (word
152%%%                        count) utility output of lines, words, and
153%%%                        characters.  This is produced by Robert
154%%%                        Solovay's checksum utility."
155%%%     }
156%%% ====================================================================
157%%% Revision history (reverse time order):
158%%%
159%%% 2.03 [15-May-1996]
160%%%      Add CODEN support, ISBN and ISSN output for Article entries,
161%%%      and ISBN output for TechReport entries (yes, these sometimes
162%%%      do have ISBNs).
163%%%
164%%%      Add wrapper macros \showXYZ{} (XYZ = CODEN, ISBN, ISSN, LCCN,
165%%%      PRICE, and URL) defined inside the thebibliography environment
166%%%      to expand to XYZ (except for PRICE) and their arguments,
167%%%      PROVIDED they are not already defined.  That way, the user can
168%%%      provide alternate definitions outside the thebibliography
169%%%      environment, for example, to suppress particular ones, or
170%%%      to alter the font used.
171%%%
172%%%      Substantially revise leading comments to better document the
173%%%      extensions.
174%%%
175%%% 2.02 [01-Apr-1996]
176%%%      Add day keyword support with new code in format.date function.
177%%%      Oren Patashnik will include this new keyword in standard styles
178%%%      in BibTeX 1.0.
179%%%
180%%%      Add new function collapse.pagerange, and use it to collapse
181%%%      page ranges with identical initial and final numbers to a
182%%%      single number, so that bibliography files can distinguish
183%%%      between one-page documents, and documents missing final page
184%%%      numbers.
185%%%
186%%% 2.01 [25-Oct-1994]
187%%%      Add URL output support.
188%%%
189%%% 2.00 [12-Oct-1994]
190%%%      Add support for pages in theses and manuals, treating them
191%%%      like Book and InBook pages.
192%%%
193%%%      Correct ISSN support: a typo caused output of ISBN instead of
194%%%      ISSN.
195%%%
196%%%      Wherever ISBNs are output, also output an ISSN, if one
197%%%      exists, and vice versa.  The reason is that some periodicals
198%%%      (e.g. The X Resource, published by O'Reilly and Associates)
199%%%      have both ISSN and ISBN numbers, and can be purchased either
200%%%      as journal subscriptions, or as single volumes.
201%%%
202%%%      For InProceedings and Proceedings output, issue a warning for
203%%%      a missing publisher: even though that field is optional, a
204%%%      bibliographic reference without it is incomplete.
205%%%
206%%%      Remove harmless, but unneeded, single horizontal space before
207%%%      price output added with version 1.03.
208%%%
209%%%      Change Proceedings and InProceedings to treat address values
210%%%      as publisher addresses, as they are with every other document
211%%%      type, rather than as conference addresses, which belong in
212%%%      the title field (that is how major libraries, including OCLC
213%%%      and Library of Congress, with nearly 60M holdings, represent
214%%%      them).  The need for this change has been discussed with
215%%%      BibTeX's author, Oren Patashnik, and there is a good
216%%%      possibility that BibTeX 1.0 will contain the change
217%%%      implemented here.  This is an INCOMPATIBLE change that will
218%%%      produce different .bbl file formatting.  However, the TUG and
219%%%      BibNet bibliography projects have consistently used address
220%%%      to me publisher/organization/institution address, and so
221%%%      already conform to the new practice.
222%%%
223%%% 1.05 [30-May-1994]
224%%%      Add NUMERIC_SUFFIXES support.
225%%%
226%%%      Change all preprocessor statements to put else and endif
227%%%      labels inside C-style comments to conform to 1989 ISO/ANSI C
228%%%      Standard.
229%%%
230%%% 1.04 [11-Nov-1993]
231%%%      Add underscore prefix to new processor symbols to prevent
232%%%      substitution in comments
233%%%
234%%% 1.03 [11-Oct-1993]
235%%%      Add support for LCCN (Library of Congress Catalog Number)
236%%%      and price fields, and make ISBN, ISSN, LCCN, and price
237%%%      selectable by preprocessor conditionals.
238%%%
239%%% 1.02 [12-Sep-1991]
240%%%      Merge in Barbara N. Beeton's suggestion for hyphen-less
241%%%      line breaks around volume(number):page.
242%%%
243%%% 1.01 [10-Sep-1991]
244%%%      Update file comment header and use Solovay checksum program.
245%%%
246%%% 1.00 [17-Oct-1990]
247%%%      Original version merging hand-edits of is-xxx.bst files into
248%%%      this master file, xbtxbst.doc.
249%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
250
251%% BibTeX `plain' family
252%%       version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
253%%       Copyright (C) 1985, all rights reserved.
254%%       Copying of this file is authorized only if either
255%%       (1) you make absolutely no changes to your copy, including name, or
256%%       (2) if you do make changes, you name it something other than
257%%       btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
258%%       This restriction helps ensure that all standard styles are identical.
259%%       The file btxbst.doc has the documentation for this style.
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275ENTRY
276  { address
277    author
278    booktitle
279    chapter
280
281    coden
282
283    day
284    edition
285    editor
286    howpublished
287    institution
288
289    isbn
290
291
292    issn
293
294    journal
295    key
296
297    lccn
298
299    month
300    note
301    number
302    organization
303    pages
304
305    price
306
307    publisher
308    school
309    series
310    title
311    type
312
313    URL
314
315    volume
316    year
317  }
318  {}
319
320
321  { label extra.label sort.label }
322
323
324
325
326INTEGERS { output.state before.all mid.sentence after.sentence after.block }
327
328FUNCTION {init.state.consts}
329{ #0 'before.all :=
330  #1 'mid.sentence :=
331  #2 'after.sentence :=
332  #3 'after.block :=
333}
334
335
336STRINGS { b e new.pages original.t s t }
337
338FUNCTION {output.nonnull}
339{ 's :=
340  output.state mid.sentence =
341    { ", " * write$ }
342    { output.state after.block =
343        { add.period$ write$
344          newline$
345          "\newblock " write$
346        }
347        { output.state before.all =
348            'write$
349            { add.period$ " " * write$ }
350          if$
351        }
352      if$
353      mid.sentence 'output.state :=
354    }
355  if$
356  s
357}
358
359FUNCTION {output}
360{ duplicate$ empty$
361    'pop$
362    'output.nonnull
363  if$
364}
365
366FUNCTION {output.check}
367{ 't :=
368  duplicate$ empty$
369    { pop$ "empty " t * " in " * cite$ * warning$ }
370    'output.nonnull
371  if$
372}
373
374FUNCTION {output.bibitem}
375{ newline$
376
377  "\bibitem[" write$
378  label write$
379  "]{" write$
380
381  cite$ write$
382  "}" write$
383  newline$
384  ""
385  before.all 'output.state :=
386}
387
388
389FUNCTION {fin.entry}
390{ add.period$
391  write$
392  newline$
393}
394
395FUNCTION {new.block}
396{ output.state before.all =
397    'skip$
398    { after.block 'output.state := }
399  if$
400}
401
402FUNCTION {new.sentence}
403{ output.state after.block =
404    'skip$
405    { output.state before.all =
406        'skip$
407        { after.sentence 'output.state := }
408      if$
409    }
410  if$
411}
412
413
414FUNCTION {not}
415{   { #0 }
416    { #1 }
417  if$
418}
419
420FUNCTION {and}
421{   'skip$
422    { pop$ #0 }
423  if$
424}
425
426FUNCTION {or}
427{   { pop$ #1 }
428    'skip$
429  if$
430}
431
432
433FUNCTION {new.block.checka}
434{ empty$
435    'skip$
436    'new.block
437  if$
438}
439
440FUNCTION {new.block.checkb}
441{ empty$
442  swap$ empty$
443  and
444    'skip$
445    'new.block
446  if$
447}
448
449
450FUNCTION {new.sentence.checka}
451{ empty$
452    'skip$
453    'new.sentence
454  if$
455}
456
457FUNCTION {new.sentence.checkb}
458{ empty$
459  swap$ empty$
460  and
461    'skip$
462    'new.sentence
463  if$
464}
465
466
467FUNCTION {field.or.null}
468{ duplicate$ empty$
469    { pop$ "" }
470    'skip$
471  if$
472}
473
474FUNCTION {emphasize}
475{ duplicate$ empty$
476    { pop$ "" }
477    { "{\em " swap$ * "}" * }
478  if$
479}
480
481INTEGERS { nameptr namesleft numnames }
482
483FUNCTION {format.names}
484{ 's :=
485  #1 'nameptr :=
486  s num.names$ 'numnames :=
487  numnames 'namesleft :=
488    { namesleft #0 > }
489
490    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
491
492      nameptr #1 >
493        { namesleft #1 >
494            { ", " * t * }
495            { numnames #2 >
496                { "," * }
497                'skip$
498              if$
499              t "others" =
500                { " et~al." * }
501                { " and " * t * }
502              if$
503            }
504          if$
505        }
506        't
507      if$
508      nameptr #1 + 'nameptr :=
509      namesleft #1 - 'namesleft :=
510    }
511  while$
512}
513
514FUNCTION {format.authors}
515{ author empty$
516    { "" }
517    { author format.names }
518  if$
519}
520
521
522FUNCTION {format.coden}
523{ coden empty$
524    { "" }
525    { new.block "\showCODEN{" coden * "}" *}
526  if$
527}
528
529
530FUNCTION {format.editors}
531{ editor empty$
532    { "" }
533    { editor format.names
534      editor num.names$ #1 >
535        { ", editors" * }
536        { ", editor" * }
537      if$
538    }
539  if$
540}
541
542
543FUNCTION {format.isbn}
544{ isbn empty$
545    { "" }
546    { new.block "\showISBN{" isbn * "}" *}
547  if$
548}
549
550
551
552FUNCTION {format.issn}
553{ issn empty$
554    { "" }
555    { new.block "\showISSN{" issn * "}" *}
556  if$
557}
558
559
560
561FUNCTION {format.lccn}
562{ lccn empty$
563    { "" }
564    { new.block "\showLCCN{" lccn * "}" *}
565  if$
566}
567
568
569
570FUNCTION {format.price}
571{ price empty$
572    { "" }
573    { new.block "\showPRICE{" price * "}" *}
574  if$
575}
576
577
578
579FUNCTION {format.url}
580{ url empty$
581    { "" }
582    { new.block "\ifshowURL {\showURL \path|" url * "|}\fi" *}
583  if$
584}
585
586
587
588
589FUNCTION {format.title}
590{ title empty$
591    { "" }
592
593    { title "t" change.case$ }
594
595  if$
596}
597
598
599
600FUNCTION {collapse.pagerange}
601{ 't :=                         % save input page range string
602  t 'original.t :=              % save original page range
603  "" 'b :=                      % beginning page number
604  "" 'e :=                      % ending page number
605    { t empty$ not }            % while-loop Boolean condition
606    {                           % while-loop body
607      t #1 #2 substring$ "--" = % have we found the en-dash?
608        {
609           t #3 global.max$ substring$ 'e :=    % yes, save ending page number
610           "" 't :=             % and set t to empty string to terminate loop
611        }
612        {
613           b t #1 #1 substring$ * 'b := % no, just accumulate this character
614           t #2 global.max$ substring$ 't := % and set t to the remaining string
615        }
616      if$
617    }
618  while$                        % on exit, t has ending page number string
619  e b =                         % are beginning and ending numbers the same?
620    { b }                       % yes, return the beginning page number string
621    { original.t }              % no, return the original page number string
622  if$
623}
624
625
626FUNCTION {n.dashify}
627{ 't :=
628  ""
629    { t empty$ not }
630    { t #1 #1 substring$ "-" =
631        { t #1 #2 substring$ "--" = not
632            { "--" *
633              t #2 global.max$ substring$ 't :=
634            }
635            {   { t #1 #1 substring$ "-" = }
636                { "-" *
637                  t #2 global.max$ substring$ 't :=
638                }
639              while$
640            }
641          if$
642        }
643        { t #1 #1 substring$ *
644          t #2 global.max$ substring$ 't :=
645        }
646      if$
647    }
648  while$
649}
650
651
652FUNCTION {format.date}
653{ year empty$
654    { month empty$
655        {
656          day empty$
657            { "" }
658            { "there's a day but no month or year in " cite$ * warning$ }
659          if$
660        }
661        { "there's a month but no year in " cite$ * warning$
662          month
663          day empty$
664            { }
665            { " " * day * }
666          if$
667        }
668      if$
669    }
670    { month empty$
671        {
672          day empty$
673            { year }
674            { "there's a day and year but no month in " cite$ * warning$ }
675          if$
676        }
677        {
678          month " " *
679          day empty$
680            { }
681            { day * ", " * }
682          if$
683          year *
684        }
685      if$
686    }
687  if$
688}
689
690
691FUNCTION {format.btitle}
692{ title emphasize
693}
694
695
696FUNCTION {tie.or.space.connect}
697{ duplicate$ text.length$ #3 <
698    { "~" }
699    { " " }
700  if$
701  swap$ * *
702}
703
704
705FUNCTION {either.or.check}
706{ empty$
707    'pop$
708    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
709  if$
710}
711
712
713FUNCTION {format.bvolume}
714{ volume empty$
715    { "" }
716    { "volume" volume tie.or.space.connect
717      series empty$
718        'skip$
719        { " of " * series emphasize * }
720      if$
721      "volume and number" number either.or.check
722    }
723  if$
724}
725
726
727FUNCTION {format.number.series}
728{ volume empty$
729    { number empty$
730        { series field.or.null }
731        { output.state mid.sentence =
732            { "number" }
733            { "Number" }
734          if$
735          number tie.or.space.connect
736          series empty$
737            { "there's a number but no series in " cite$ * warning$ }
738            { " in " * series * }
739          if$
740        }
741      if$
742    }
743    { "" }
744  if$
745}
746
747
748FUNCTION {format.edition}
749{ edition empty$
750    { "" }
751    { output.state mid.sentence =
752        { edition "l" change.case$ " edition" * }
753        { edition "t" change.case$ " edition" * }
754      if$
755    }
756  if$
757}
758
759
760INTEGERS { multiresult }
761
762FUNCTION {multi.page.check}
763{ 't :=
764  #0 'multiresult :=
765    { multiresult not
766      t empty$ not
767      and
768    }
769    { t #1 #1 substring$
770      duplicate$ "-" =
771      swap$ duplicate$ "," =
772      swap$ "+" =
773      or or
774        { #1 'multiresult := }
775        { t #2 global.max$ substring$ 't := }
776      if$
777    }
778  while$
779  multiresult
780}
781
782
783FUNCTION {format.book.pages}
784{ pages empty$
785    { "" }
786    { new.block pages " pp." * }
787  if$
788}
789
790
791
792FUNCTION {format.pages}
793{ pages empty$
794    { "" }
795    {
796      pages multi.page.check
797        { pages collapse.pagerange 'new.pages := }
798        { pages 'new.pages := }
799      if$
800      new.pages multi.page.check
801        { "pages" new.pages n.dashify tie.or.space.connect }
802        { "page" new.pages tie.or.space.connect }
803      if$
804    }
805  if$
806}
807
808
809FUNCTION {format.vol.num.pages}
810{ volume field.or.null
811  number empty$
812    'skip$
813    { "\penalty0 (" number * ")" * *
814      volume empty$
815        { "there's a number but no volume in " cite$ * warning$ }
816        'skip$
817      if$
818    }
819  if$
820  pages empty$
821    'skip$
822    { duplicate$ empty$
823        { pop$ format.pages }
824        { ":\penalty0 " * pages collapse.pagerange n.dashify * }
825      if$
826    }
827  if$
828}
829
830
831
832FUNCTION {format.chapter.pages}
833{ chapter empty$
834    'format.pages
835    { type empty$
836        { "chapter" }
837        { type "l" change.case$ }
838      if$
839      chapter tie.or.space.connect
840      pages empty$
841        'skip$
842        { ", " * format.pages * }
843      if$
844    }
845  if$
846}
847
848
849FUNCTION {format.in.ed.booktitle}
850{ booktitle empty$
851    { "" }
852    { editor empty$
853        { "In " booktitle emphasize * }
854        { "In " format.editors * ", " * booktitle emphasize * }
855      if$
856    }
857  if$
858}
859
860
861FUNCTION {empty.misc.check}
862{ author empty$ title empty$ howpublished empty$
863  month empty$ year empty$ note empty$
864  and and and and and
865
866  key empty$ not and
867
868    { "all relevant fields are empty in " cite$ * warning$ }
869    'skip$
870  if$
871}
872
873
874FUNCTION {format.thesis.type}
875{ type empty$
876    'skip$
877    { pop$
878      type "t" change.case$
879    }
880  if$
881}
882
883
884FUNCTION {format.tr.number}
885{ type empty$
886    { "Technical Report" }
887    'type
888  if$
889  number empty$
890    { "t" change.case$ }
891    { number tie.or.space.connect }
892  if$
893}
894
895
896FUNCTION {format.article.crossref}
897{ key empty$
898    { journal empty$
899        { "need key or journal for " cite$ * " to crossref " * crossref *
900          warning$
901          ""
902        }
903        { "In {\em " journal * "\/}" * }
904      if$
905    }
906    { "In " key * }
907  if$
908  " \cite{" * crossref * "}" *
909}
910
911
912FUNCTION {format.crossref.editor}
913{ editor #1 "{vv~}{ll}" format.name$
914  editor num.names$ duplicate$
915  #2 >
916    { pop$ " et~al." * }
917    { #2 <
918        'skip$
919        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
920            { " et~al." * }
921            { " and " * editor #2 "{vv~}{ll}" format.name$ * }
922          if$
923        }
924      if$
925    }
926  if$
927}
928
929
930FUNCTION {format.book.crossref}
931{ volume empty$
932    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
933      "In "
934    }
935    { "Volume" volume tie.or.space.connect
936      " of " *
937    }
938  if$
939  editor empty$
940  editor field.or.null author field.or.null =
941  or
942    { key empty$
943        { series empty$
944            { "need editor, key, or series for " cite$ * " to crossref " *
945              crossref * warning$
946              "" *
947            }
948            { "{\em " * series * "\/}" * }
949          if$
950        }
951        { key * }
952      if$
953    }
954    { format.crossref.editor * }
955  if$
956  " \cite{" * crossref * "}" *
957}
958
959
960FUNCTION {format.incoll.inproc.crossref}
961{ editor empty$
962  editor field.or.null author field.or.null =
963  or
964    { key empty$
965        { booktitle empty$
966            { "need editor, key, or booktitle for " cite$ * " to crossref " *
967              crossref * warning$
968              ""
969            }
970            { "In {\em " booktitle * "\/}" * }
971          if$
972        }
973        { "In " key * }
974      if$
975    }
976    { "In " format.crossref.editor * }
977  if$
978  " \cite{" * crossref * "}" *
979}
980
981
982FUNCTION {article}
983{ output.bibitem
984  format.authors "author" output.check
985  new.block
986  format.title "title" output.check
987  new.block
988  crossref missing$
989    { journal emphasize "journal" output.check
990      format.vol.num.pages output
991      format.date "year" output.check
992    }
993    { format.article.crossref output.nonnull
994      format.pages output
995    }
996  if$
997
998  format.coden output
999
1000
1001  format.isbn output
1002
1003
1004  format.issn output
1005
1006
1007  format.url output
1008
1009  new.block
1010  note output
1011  fin.entry
1012}
1013
1014FUNCTION {book}
1015{ output.bibitem
1016  author empty$
1017    { format.editors "author and editor" output.check }
1018    { format.authors output.nonnull
1019      crossref missing$
1020        { "author and editor" editor either.or.check }
1021        'skip$
1022      if$
1023    }
1024  if$
1025  new.block
1026  format.btitle "title" output.check
1027  crossref missing$
1028    { format.bvolume output
1029      new.block
1030      format.number.series output
1031      new.sentence
1032      publisher "publisher" output.check
1033      address output
1034    }
1035    { new.block
1036      format.book.crossref output.nonnull
1037    }
1038  if$
1039  format.edition output
1040  format.date "year" output.check
1041
1042  format.coden output
1043
1044
1045  format.isbn output
1046
1047
1048  format.issn output
1049
1050
1051  format.book.pages output
1052
1053
1054  format.lccn output
1055
1056
1057  format.price output
1058
1059
1060  format.url output
1061
1062  new.block
1063  note output
1064  fin.entry
1065}
1066
1067
1068FUNCTION {booklet}
1069{ output.bibitem
1070  format.authors output
1071  new.block
1072  format.title "title" output.check
1073  howpublished address new.block.checkb
1074  howpublished output
1075  address output
1076  format.date output
1077
1078  format.coden output
1079
1080
1081  format.isbn output
1082
1083
1084  format.issn output
1085
1086
1087  format.book.pages output
1088
1089
1090  format.lccn output
1091
1092
1093  format.price output
1094
1095
1096  format.url output
1097
1098  new.block
1099  note output
1100  fin.entry
1101}
1102
1103
1104
1105FUNCTION {inbook}
1106{ output.bibitem
1107  author empty$
1108    { format.editors "author and editor" output.check }
1109    { format.authors output.nonnull
1110      crossref missing$
1111        { "author and editor" editor either.or.check }
1112        'skip$
1113      if$
1114    }
1115  if$
1116  new.block
1117  format.btitle "title" output.check
1118  crossref missing$
1119    { format.bvolume output
1120      format.chapter.pages "chapter and pages" output.check
1121      new.block
1122      format.number.series output
1123      new.sentence
1124      publisher "publisher" output.check
1125      address output
1126    }
1127    { format.chapter.pages "chapter and pages" output.check
1128      new.block
1129      format.book.crossref output.nonnull
1130    }
1131  if$
1132  format.edition output
1133  format.date "year" output.check
1134
1135  format.coden output
1136
1137
1138  format.isbn output
1139
1140
1141  format.issn output
1142
1143
1144  format.lccn output
1145
1146
1147  format.price output
1148
1149
1150  format.url output
1151
1152  new.block
1153  note output
1154  fin.entry
1155}
1156
1157
1158FUNCTION {incollection}
1159{ output.bibitem
1160  format.authors "author" output.check
1161  new.block
1162  format.title "title" output.check
1163  new.block
1164  crossref missing$
1165    { format.in.ed.booktitle "booktitle" output.check
1166      format.bvolume output
1167      format.number.series output
1168      format.chapter.pages output
1169      new.sentence
1170      publisher "publisher" output.check
1171      address output
1172      format.edition output
1173      format.date "year" output.check
1174    }
1175    { format.incoll.inproc.crossref output.nonnull
1176      format.chapter.pages output
1177    }
1178  if$
1179
1180  format.coden output
1181
1182
1183  format.isbn output
1184
1185
1186  format.issn output
1187
1188
1189  format.lccn output
1190
1191
1192  format.price output
1193
1194
1195  format.url output
1196
1197  new.block
1198  note output
1199  fin.entry
1200}
1201
1202
1203FUNCTION {inproceedings}
1204{ output.bibitem
1205  format.authors "author" output.check
1206  new.block
1207  format.title "title" output.check
1208  new.block
1209  crossref missing$
1210    { format.in.ed.booktitle "booktitle" output.check
1211      format.bvolume output
1212      format.number.series output
1213      format.pages output
1214      address empty$
1215        { organization publisher new.sentence.checkb
1216          organization output
1217          publisher "publisher" output.check
1218          format.date "year" output.check
1219        }
1220        { new.sentence
1221          organization output
1222          publisher "publisher" output.check
1223          address output.nonnull
1224          format.date "year" output.check
1225        }
1226      if$
1227    }
1228    { format.incoll.inproc.crossref output.nonnull
1229      format.pages output
1230    }
1231  if$
1232
1233  format.coden output
1234
1235
1236  format.isbn output
1237
1238
1239  format.issn output
1240
1241
1242  format.lccn output
1243
1244
1245  format.price output
1246
1247
1248  format.url output
1249
1250  new.block
1251  note output
1252  fin.entry
1253}
1254
1255
1256FUNCTION {conference} { inproceedings }
1257
1258
1259FUNCTION {manual}
1260{ output.bibitem
1261  author empty$
1262    { organization empty$
1263        'skip$
1264        { organization output.nonnull
1265          address output
1266        }
1267      if$
1268    }
1269    { format.authors output.nonnull }
1270  if$
1271  new.block
1272  format.btitle "title" output.check
1273  author empty$
1274    { organization empty$
1275        { address new.block.checka
1276          address output
1277        }
1278        'skip$
1279      if$
1280    }
1281    { organization address new.block.checkb
1282      organization output
1283      address output
1284    }
1285  if$
1286  format.edition output
1287  format.date output
1288
1289  format.book.pages output
1290
1291
1292  format.price output
1293
1294
1295  format.url output
1296
1297  new.block
1298  note output
1299  fin.entry
1300}
1301
1302
1303FUNCTION {mastersthesis}
1304{ output.bibitem
1305  format.authors "author" output.check
1306  new.block
1307  format.title "title" output.check
1308  new.block
1309  "Master's thesis" format.thesis.type output.nonnull
1310  school "school" output.check
1311  address output
1312  format.date "year" output.check
1313
1314  format.book.pages output
1315
1316
1317  format.url output
1318
1319  new.block
1320  note output
1321  fin.entry
1322}
1323
1324
1325FUNCTION {misc}
1326{ output.bibitem
1327  format.authors output
1328  title howpublished new.block.checkb
1329  format.title output
1330  howpublished new.block.checka
1331  howpublished output
1332  format.date output
1333
1334  format.coden output
1335
1336
1337  format.isbn output
1338
1339
1340  format.issn output
1341
1342
1343  format.price output
1344
1345
1346  format.url output
1347
1348  new.block
1349  note output
1350  fin.entry
1351  empty.misc.check
1352}
1353
1354
1355FUNCTION {phdthesis}
1356{ output.bibitem
1357  format.authors "author" output.check
1358  new.block
1359  format.btitle "title" output.check
1360  new.block
1361  "PhD thesis" format.thesis.type output.nonnull
1362  school "school" output.check
1363  address output
1364  format.date "year" output.check
1365
1366  format.book.pages output
1367
1368
1369  format.url output
1370
1371  new.block
1372  note output
1373  fin.entry
1374}
1375
1376
1377FUNCTION {periodical}
1378{ output.bibitem
1379  editor empty$
1380    { organization output }
1381    { format.editors output.nonnull }
1382  if$
1383  new.block
1384  title emphasize "title" output.check
1385  format.vol.num.pages output
1386  format.date output
1387
1388  format.coden output
1389
1390
1391  format.isbn output
1392
1393
1394  format.issn output
1395
1396
1397  format.price output
1398
1399
1400  format.url output
1401
1402  new.sentence
1403  publisher output
1404  address output
1405  howpublished new.block.checka
1406  howpublished output
1407  new.block
1408  note output
1409  fin.entry
1410}
1411
1412
1413FUNCTION {proceedings}
1414{ output.bibitem
1415  editor empty$
1416    { organization output }
1417    { format.editors output.nonnull }
1418  if$
1419  new.block
1420  format.btitle "title" output.check
1421  format.bvolume output
1422  format.number.series output
1423  address empty$
1424    { editor empty$
1425        { publisher new.sentence.checka }
1426        { organization publisher new.sentence.checkb
1427          organization output
1428        }
1429      if$
1430      publisher "publisher" output.check %%% <- new check for missing
1431      format.date "year" output.check
1432    }
1433    { new.sentence
1434      editor empty$
1435        'skip$
1436        { organization output }
1437      if$
1438      publisher "publisher" output.check
1439      address output.nonnull
1440      format.date "year" output.check
1441    }
1442  if$
1443
1444  format.coden output
1445
1446
1447  format.isbn output
1448
1449
1450  format.issn output
1451
1452
1453  format.lccn output
1454
1455
1456  format.price output
1457
1458
1459  format.url output
1460
1461  new.block
1462  note output
1463  fin.entry
1464}
1465
1466
1467FUNCTION {techreport}
1468{ output.bibitem
1469  format.authors "author" output.check
1470  new.block
1471  format.title "title" output.check
1472  new.block
1473  format.tr.number output.nonnull
1474  institution "institution" output.check
1475  address output
1476  format.date "year" output.check
1477
1478  format.isbn output            % NB: TechReports occasionally have ISBNs
1479
1480
1481  format.book.pages output
1482
1483
1484  format.price output
1485
1486
1487  format.url output
1488
1489  new.block
1490  note output
1491  fin.entry
1492}
1493
1494
1495FUNCTION {unpublished}
1496{ output.bibitem
1497  format.authors "author" output.check
1498  new.block
1499  format.title "title" output.check
1500  new.block
1501  note "note" output.check
1502  format.date output
1503
1504  format.url output
1505
1506  fin.entry
1507}
1508
1509
1510FUNCTION {default.type} { misc }
1511
1512
1513
1514
1515MACRO {jan} {"January"}
1516
1517MACRO {feb} {"February"}
1518
1519MACRO {mar} {"March"}
1520
1521MACRO {apr} {"April"}
1522
1523MACRO {may} {"May"}
1524
1525MACRO {jun} {"June"}
1526
1527MACRO {jul} {"July"}
1528
1529MACRO {aug} {"August"}
1530
1531MACRO {sep} {"September"}
1532
1533MACRO {oct} {"October"}
1534
1535MACRO {nov} {"November"}
1536
1537MACRO {dec} {"December"}
1538
1539
1540
1541
1542
1543
1544MACRO {acmcs} {"ACM Computing Surveys"}
1545
1546MACRO {acta} {"Acta Informatica"}
1547
1548MACRO {cacm} {"Communications of the ACM"}
1549
1550MACRO {ibmjrd} {"IBM Journal of Research and Development"}
1551
1552MACRO {ibmsj} {"IBM Systems Journal"}
1553
1554MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
1555
1556MACRO {ieeetc} {"IEEE Transactions on Computers"}
1557
1558MACRO {ieeetcad}
1559 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1560
1561MACRO {ipl} {"Information Processing Letters"}
1562
1563MACRO {jacm} {"Journal of the ACM"}
1564
1565MACRO {jcss} {"Journal of Computer and System Sciences"}
1566
1567MACRO {scp} {"Science of Computer Programming"}
1568
1569MACRO {sicomp} {"SIAM Journal on Computing"}
1570
1571MACRO {tocs} {"ACM Transactions on Computer Systems"}
1572
1573MACRO {tods} {"ACM Transactions on Database Systems"}
1574
1575MACRO {tog} {"ACM Transactions on Graphics"}
1576
1577MACRO {toms} {"ACM Transactions on Mathematical Software"}
1578
1579MACRO {toois} {"ACM Transactions on Office Information Systems"}
1580
1581MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1582
1583MACRO {tcs} {"Theoretical Computer Science"}
1584
1585
1586
1587
1588READ
1589
1590
1591
1592
1593FUNCTION {sortify}
1594{ purify$
1595  "l" change.case$
1596}
1597
1598INTEGERS { len }
1599
1600FUNCTION {chop.word}
1601{ 's :=
1602  'len :=
1603  s #1 len substring$ =
1604    { s len #1 + global.max$ substring$ }
1605    's
1606  if$
1607}
1608
1609
1610
1611
1612
1613
1614INTEGERS { et.al.char.used }
1615
1616FUNCTION {initialize.et.al.char.used}
1617{ #0 'et.al.char.used :=
1618}
1619
1620EXECUTE {initialize.et.al.char.used}
1621
1622FUNCTION {format.lab.names}
1623{ 's :=
1624  s num.names$ 'numnames :=
1625  numnames #1 >
1626    { numnames #4 >
1627        { #3 'namesleft := }
1628        { numnames 'namesleft := }
1629      if$
1630      #1 'nameptr :=
1631      ""
1632        { namesleft #0 > }
1633        { nameptr numnames =
1634            { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1635                { "{\etalchar{+}}" *
1636                  #1 'et.al.char.used :=
1637                }
1638                { s nameptr "{v{}}{l{}}" format.name$ * }
1639              if$
1640            }
1641            { s nameptr "{v{}}{l{}}" format.name$ * }
1642          if$
1643          nameptr #1 + 'nameptr :=
1644          namesleft #1 - 'namesleft :=
1645        }
1646      while$
1647      numnames #4 >
1648        { "{\etalchar{+}}" *
1649          #1 'et.al.char.used :=
1650        }
1651        'skip$
1652      if$
1653    }
1654    { s #1 "{v{}}{l{}}" format.name$
1655      duplicate$ text.length$ #2 <
1656        { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
1657        'skip$
1658      if$
1659    }
1660  if$
1661}
1662
1663FUNCTION {author.key.label}
1664{ author empty$
1665    { key empty$
1666
1667        { cite$ #1 #3 substring$ }
1668
1669        { key #3 text.prefix$ }
1670      if$
1671    }
1672    { author format.lab.names }
1673  if$
1674}
1675
1676FUNCTION {author.editor.key.label}
1677{ author empty$
1678    { editor empty$
1679        { key empty$
1680
1681            { cite$ #1 #3 substring$ }
1682
1683            { key #3 text.prefix$ }
1684          if$
1685        }
1686        { editor format.lab.names }
1687      if$
1688    }
1689    { author format.lab.names }
1690  if$
1691}
1692
1693FUNCTION {author.key.organization.label}
1694{ author empty$
1695    { key empty$
1696        { organization empty$
1697
1698            { cite$ #1 #3 substring$ }
1699
1700            { "The " #4 organization chop.word #3 text.prefix$ }
1701          if$
1702        }
1703        { key #3 text.prefix$ }
1704      if$
1705    }
1706    { author format.lab.names }
1707  if$
1708}
1709
1710FUNCTION {editor.key.organization.label}
1711{ editor empty$
1712    { key empty$
1713        { organization empty$
1714
1715            { cite$ #1 #3 substring$ }
1716
1717            { "The " #4 organization chop.word #3 text.prefix$ }
1718          if$
1719        }
1720        { key #3 text.prefix$ }
1721      if$
1722    }
1723    { editor format.lab.names }
1724  if$
1725}
1726
1727FUNCTION {calc.label}
1728{ type$ "book" =
1729  type$ "inbook" =
1730  or
1731    'author.editor.key.label
1732    { type$ "proceedings" =
1733        'editor.key.organization.label
1734        { type$ "manual" =
1735            'author.key.organization.label
1736            'author.key.label
1737          if$
1738        }
1739      if$
1740    }
1741  if$
1742  duplicate$
1743  year field.or.null purify$ #-1 #2 substring$
1744  *
1745  'label :=
1746  year field.or.null purify$ #-1 #4 substring$
1747  *
1748  sortify 'sort.label :=
1749}
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759FUNCTION {sort.format.names}
1760{ 's :=
1761  #1 'nameptr :=
1762  ""
1763  s num.names$ 'numnames :=
1764  numnames 'namesleft :=
1765    { namesleft #0 > }
1766    { nameptr #1 >
1767        { "   " * }
1768        'skip$
1769      if$
1770
1771      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
1772
1773      nameptr numnames = t "others" = and
1774        { "et al" * }
1775        { t sortify * }
1776      if$
1777      nameptr #1 + 'nameptr :=
1778      namesleft #1 - 'namesleft :=
1779    }
1780  while$
1781}
1782
1783
1784FUNCTION {sort.format.title}
1785{ 't :=
1786  "A " #2
1787    "An " #3
1788      "The " #4 t chop.word
1789    chop.word
1790  chop.word
1791  sortify
1792  #1 global.max$ substring$
1793}
1794
1795
1796FUNCTION {author.sort}
1797{ author empty$
1798    { key empty$
1799        { "to sort, need author or key in " cite$ * warning$
1800          ""
1801        }
1802        { key sortify }
1803      if$
1804    }
1805    { author sort.format.names }
1806  if$
1807}
1808
1809FUNCTION {author.editor.sort}
1810{ author empty$
1811    { editor empty$
1812        { key empty$
1813            { "to sort, need author, editor, or key in " cite$ * warning$
1814              ""
1815            }
1816            { key sortify }
1817          if$
1818        }
1819        { editor sort.format.names }
1820      if$
1821    }
1822    { author sort.format.names }
1823  if$
1824}
1825
1826FUNCTION {author.organization.sort}
1827{ author empty$
1828    { organization empty$
1829        { key empty$
1830            { "to sort, need author, organization, or key in " cite$ * warning$
1831              ""
1832            }
1833            { key sortify }
1834          if$
1835        }
1836        { "The " #4 organization chop.word sortify }
1837      if$
1838    }
1839    { author sort.format.names }
1840  if$
1841}
1842
1843FUNCTION {editor.organization.sort}
1844{ editor empty$
1845    { organization empty$
1846        { key empty$
1847            { "to sort, need editor, organization, or key in " cite$ * warning$
1848              ""
1849            }
1850            { key sortify }
1851          if$
1852        }
1853        { "The " #4 organization chop.word sortify }
1854      if$
1855    }
1856    { editor sort.format.names }
1857  if$
1858}
1859
1860
1861FUNCTION {presort}
1862
1863{ calc.label
1864  sort.label
1865  "    "
1866  *
1867  type$ "book" =
1868
1869  type$ "inbook" =
1870  or
1871    'author.editor.sort
1872    { type$ "proceedings" =
1873        'editor.organization.sort
1874        { type$ "manual" =
1875            'author.organization.sort
1876            'author.sort
1877          if$
1878        }
1879      if$
1880    }
1881  if$
1882
1883  *
1884
1885  "    "
1886  *
1887  year field.or.null sortify
1888  *
1889  "    "
1890  *
1891  title field.or.null
1892  sort.format.title
1893  *
1894  #1 entry.max$ substring$
1895  'sort.key$ :=
1896}
1897
1898ITERATE {presort}
1899
1900
1901SORT
1902
1903
1904
1905
1906
1907
1908
1909
1910STRINGS { longest.label last.sort.label next.extra }
1911
1912INTEGERS { longest.label.width last.extra.num }
1913
1914FUNCTION {initialize.longest.label}
1915{ "" 'longest.label :=
1916  #0 int.to.chr$ 'last.sort.label :=
1917  "" 'next.extra :=
1918  #0 'longest.label.width :=
1919  #0 'last.extra.num :=
1920}
1921
1922FUNCTION {forward.pass}
1923{ last.sort.label sort.label =
1924    { last.extra.num #1 + 'last.extra.num :=
1925
1926      last.extra.num "z" chr.to.int$ >
1927
1928        % Generate -1, -2, ... suffixes
1929        { "-" last.extra.num "a" chr.to.int$ - #1 + int.to.str$ * 'extra.label := }
1930        % Generate a, b, ..., z suffixes
1931        { last.extra.num int.to.chr$ 'extra.label := }
1932      if$
1933    }
1934    { "a" chr.to.int$ 'last.extra.num :=
1935      "" 'extra.label :=
1936      sort.label 'last.sort.label :=
1937    }
1938  if$
1939}
1940
1941FUNCTION {reverse.pass}
1942{
1943
1944  next.extra "b" =
1945    { "a" 'extra.label := }
1946    'skip$
1947  if$
1948
1949  label extra.label * 'label :=
1950  label width$ longest.label.width >
1951    { label 'longest.label :=
1952      label width$ 'longest.label.width :=
1953    }
1954    'skip$
1955  if$
1956  extra.label 'next.extra :=
1957}
1958
1959EXECUTE {initialize.longest.label}
1960
1961ITERATE {forward.pass}
1962
1963REVERSE {reverse.pass}
1964
1965
1966
1967
1968
1969
1970FUNCTION {begin.bib}
1971
1972{ et.al.char.used
1973    { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
1974    'skip$
1975  if$
1976  preamble$ empty$
1977
1978    'skip$
1979    { preamble$ write$ newline$ }
1980  if$
1981  "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
1982
1983  "\ifx \showCODEN  \undefined \def \showCODEN #1{CODEN #1}  \fi" write$ newline$
1984
1985
1986  "\ifx \showISBN   \undefined \def \showISBN  #1{ISBN #1}   \fi" write$ newline$
1987
1988
1989  "\ifx \showISSN   \undefined \def \showISSN  #1{ISSN #1}   \fi" write$ newline$
1990
1991
1992  "\ifx \showLCCN   \undefined \def \showLCCN  #1{LCCN #1}   \fi" write$ newline$
1993
1994
1995  "\ifx \showPRICE  \undefined \def \showPRICE #1{#1}        \fi" write$ newline$
1996
1997
1998  "\ifx \showURL    \undefined \def \showURL {URL }          \fi" write$ newline$
1999  "\ifx \path       \undefined \input path.sty               \fi" write$ newline$
2000  "\ifx \ifshowURL \undefined" write$ newline$
2001  "     \newif \ifshowURL"     write$ newline$
2002  "     \showURLtrue"          write$ newline$
2003  "\fi" write$ newline$
2004
2005}
2006
2007EXECUTE {begin.bib}
2008
2009EXECUTE {init.state.consts}
2010
2011
2012ITERATE {call.type$}
2013
2014
2015FUNCTION {end.bib}
2016{ newline$
2017  "\end{thebibliography}" write$ newline$
2018}
2019
2020EXECUTE {end.bib}
Note: See TracBrowser for help on using the repository browser.