/utphys

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/utphys/
2 by Jacques Distler
Preliminary DOI support
1
% UT Physics bibliographic style, ver. 2.2. Based on:
1 by Jacques Distler
Initial Commits
2
%
3
%X     IEEE Transactions bibliography style (29-Jan-88 version)
4
%X       numeric labels, order-of-reference, IEEE abbreviations,
5
%X       quotes around article titles, commas separate all fields
6
%X       except after book titles and before "notes".  Otherwise,
7
%X       much like the "plain" family, from which this is adapted.
8
%X
9
%X       History
10
%X       9/30/85	(HWT)	Original version, by Howard Trickey.
11
%X       1/29/88	(OP&HWT) Updated for BibTeX version 0.99a, Oren Patashnik;
12
%X       THIS `ieeetr' VERSION DOES NOT WORK WITH BIBTEX 0.98i.
13
%
14
%  Modifications: 1) added hypertex support and "archive", "eprint"
15
%                    and "url" fields.
16
%                 2) parentheses around dates, and no "pp." for article entries
17
%                 3) "publisher, address" instead of "address: publisher"
18
%                 4) added "report" field for article entries.
19
%                 5) particle physics-oriented abbreviations, rather than ieee.
20
%                 6) added "collaboration" field, as per 
21
%                    Jonathan Flynn' suggestion. SPIRES now supports this field.
22
%                 7) Improved output of Proceedings entries
23
%
24
%    Modified by Jacques Distler, 4/08
25
%           History: ver 1.0  9/96
26
%                    ver 1.1 10/96 - added "collaboration" field
27
%                    ver 1.2  7/97 - added a "\providecommand{\href}[2]{#2}"
28
%                                    to handle case where \href is not defined
29
%                    ver 1.3 12/97 - fixed lousy-looking proceedings output.
30
%                    ver 1.4  1/98 - fixed format.number, address in 
31
%                                    proceedings entries
32
%                    ver 1.5  3/99 - added (nonprinting) CITATION field for
33
%                                    SLAC internal use
34
%                    ver 1.6  4/99 - Fix to ensure %%CITATION output not broken
35
%                                    across lines. Added new.sentence to ensure
36
%                                    previous output properly terminated.
37
%                                    (Moral: test before you release.)
38
%                    ver 1.7 10/99 - "et.~al." should be "et al." Morons!
39
%                    ver 1.8 11/99 - Changed the Web URL to the more portable
40
%                                    arxiv.org. The "archive" field functions as
41
%                                    a true base-URL. This is NOT A
42
%                                    BACKWARDS-COMPATIBLE change!
43
%                   ver 1.8a 12/99 - MACROs for arXiv and cogprints
44
%                                    BaseURL's defined.
45
%                   ver 1.9   6/05 - eprint support for other entry types
46
%                   ver 2.0   4/08 - support "new-style" eprint identifiers
47
%                   ver 2.1   4/08 - support for "url" field
2 by Jacques Distler
Preliminary DOI support
48
%                   ver 2.2   4/08 - support for "doi" field
1 by Jacques Distler
Initial Commits
49
%
50
% HyperTeX Wizardry:
51
%
52
% The following are equivalent:
53
%   archive  =  arXiv
54
%   eprint   = "hep-th/9605023"
55
% and
56
%   eprint   = "hep-th/9605023"
57
% both produce 
58
%
59
%    \href{http://arxiv.org/abs/hep-th/9605023}{{\tt hep-th/9605023}}
60
%
61
% in the bibliographic output at the appropriate point. More generally,
62
% if the archive field is present, we produce a URL of the form
63
% "archive/eprint" as the first argument of the \href. If absent, the base
64
% URL defaults to "http://arxiv.org/abs"
65
% If you are using a hypertex macropackage, like hyperref.sty, this command
66
% will create a link to the eprint at Los Alamos (or wherever).
67
%
68
% "New-style" arXiv identifiers are also supported.
69
%
70
%     archivePrefix = "arXiv",
%     eprint    = "0707.3168",
71
%     primaryClass = "hep-th",
72
%
73
% produces
74
%
75
%     \href{http://arxiv.org/abs/0707.3168}{{\tt arXiv:0707.3168 [hep-th]}}
76
%
77
% Another (non-arXiv) example:
78
%
79
%     archive = "http://cogprints.org",
80
%     eprint = "5542",
81
%     archivePrefix = "Cogprints",
82
%
83
%  produces
84
%
2 by Jacques Distler
Preliminary DOI support
85
%     \href{http://cogprints.org/5542}{{\tt Cogprints:5542}}
86
%
87
%  If a "doi" field is present, then the journal reference becomes a
88
%  clickable hyperlink to the online journal version of the paper.
1 by Jacques Distler
Initial Commits
89
%
90
% The bibtex output produced by SPIRES, while far from perfect, is pretty
91
% suitable for use with this style. Indeed, this style was designed with
92
% SPIRES in mind.
93
94
ENTRY
95
  { address
96
    author
97
    booktitle
98
    chapter
99
    edition
100
    editor
101
    howpublished
102
    institution
103
    journal
104
    key
105
    month
106
    note
107
    number
108
    organization
109
    pages
110
    publisher
111
    school
112
    series
113
    title
114
    type
115
    volume
116
    year
117
    archive
118
    eprint
119
    report
120
    collaboration
121
    SLACcitation
122
    archivePrefix
123
    primaryClass
124
    url
2 by Jacques Distler
Preliminary DOI support
125
    doi
1 by Jacques Distler
Initial Commits
126
  }
127
  {}
128
  { label }
129
130
INTEGERS { output.state before.all mid.sentence after.quote after.sentence
131
		after.quoted.block after.block }
132
133
FUNCTION {init.state.consts}
134
{ #0 'before.all :=
135
  #1 'mid.sentence :=
136
  #2 'after.quote :=
137
  #3 'after.sentence :=
138
  #4 'after.quoted.block :=
139
  #5 'after.block :=
140
}
141
142
STRINGS { s t }
143
144
FUNCTION {output.nonnull}
145
{ 's :=
146
  output.state mid.sentence =
147
    { ", " * write$ }
148
    { output.state after.quote =
149
	{ " " * write$ }
150
	{ output.state after.block =
151
	    { add.period$ write$
152
	      newline$
153
	      "\newblock " write$
154
	    }
155
	    { output.state before.all =
156
		'write$
157
		{ output.state after.quoted.block =
158
		    { write$
159
		      newline$
160
		      "\newblock " write$
161
		    }
162
		    { add.period$ " " * write$ }
163
		  if$
164
		}
165
	      if$
166
	    }
167
	  if$
168
	}
169
      if$
170
      mid.sentence 'output.state :=
171
    }
172
  if$
173
  s
174
}
175
176
FUNCTION {output}
177
{ duplicate$ empty$
178
    'pop$
179
    'output.nonnull
180
  if$
181
}
182
183
FUNCTION {output.check}
184
{ 't :=
185
  duplicate$ empty$
186
    { pop$ "empty " t * " in " * cite$ * warning$ }
187
    'output.nonnull
188
  if$
189
}
190
191
FUNCTION {output.bibitem}
192
{ newline$
193
  "\bibitem{" write$
194
  cite$ write$
195
  "}" write$
196
  newline$
197
  ""
198
  before.all 'output.state :=
199
}
200
201
FUNCTION {blank.sep}
202
{ after.quote 'output.state :=
203
}
204
205
FUNCTION {fin.entry}
206
{ output.state after.quoted.block =
207
    'skip$
208
    'add.period$
209
  if$
210
  write$
211
  newline$
212
}
213
214
FUNCTION {new.block}
215
{ output.state before.all =
216
    'skip$
217
    { output.state after.quote =
218
	{ after.quoted.block 'output.state := }
219
	{ after.block 'output.state := }
220
      if$
221
    }
222
  if$
223
}
224
225
FUNCTION {new.sentence}
226
{ output.state after.block =
227
    'skip$
228
    { output.state before.all =
229
	'skip$
230
	{ after.sentence 'output.state := }
231
      if$
232
    }
233
  if$
234
}
235
236
FUNCTION {not}
237
{   { #0 }
238
    { #1 }
239
  if$
240
}
241
242
FUNCTION {and}
243
{   'skip$
244
    { pop$ #0 }
245
  if$
246
}
247
248
FUNCTION {or}
249
{   { pop$ #1 }
250
    'skip$
251
  if$
252
}
253
254
FUNCTION {new.block.checka}
255
{ empty$
256
    'skip$
257
    'new.block
258
  if$
259
}
260
261
FUNCTION {new.block.checkb}
262
{ empty$
263
  swap$ empty$
264
  and
265
    'skip$
266
    'new.block
267
  if$
268
}
269
270
FUNCTION {new.sentence.checka}
271
{ empty$
272
    'skip$
273
    'new.sentence
274
  if$
275
}
276
277
FUNCTION {field.or.null}
278
{ duplicate$ empty$
279
    { pop$ "" }
280
    'skip$
281
  if$
282
}
283
284
FUNCTION {emphasize}
285
{ duplicate$ empty$
286
    { pop$ "" }
287
    { "{\em " swap$ * "}" * }
288
  if$
289
}
290
291
FUNCTION {capitalize}
292
{ "u" change.case$ "t" change.case$ }
293
294
INTEGERS { nameptr namesleft numnames }
295
296
FUNCTION {format.names}
297
{ 's :=
298
  #1 'nameptr :=
299
  s num.names$ 'numnames :=
300
  numnames 'namesleft :=
301
    { namesleft #0 > }
302
    { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
303
      nameptr #1 >
304
	{ namesleft #1 >
305
	    { ", " * t * }
306
	    { numnames #2 >
307
		{ "," * }
308
		'skip$
309
	      if$
310
	      t "others" =
311
		{ " {\em et al.}" * }
312
		{ " and " * t * }
313
	      if$
314
	    }
315
	  if$
316
	}
317
	't
318
      if$
319
      nameptr #1 + 'nameptr :=
320
      namesleft #1 - 'namesleft :=
321
    }
322
  while$
323
}
324
325
FUNCTION {format.authors}
326
{ author empty$
327
    { "" }
328
    { author format.names }
329
  if$
330
}
331
332
FUNCTION {format.archive}
333
{
334
  archivePrefix empty$
335
      { "" }
336
      { archivePrefix ":" *}
337
  if$            
338
}
339
340
FUNCTION {format.primaryClass}
341
{
342
  primaryClass empty$
343
      { "" }
344
      { " [" primaryClass * "]" *}
345
  if$            
346
}
347
348
FUNCTION {format.eprint}
349
{ eprint empty$
350
     { ""}
351
     { archive empty$
352
          {"\href{http://arxiv.org/abs/" eprint * "}" * 
353
             "{{\tt " * format.archive * eprint *
354
              format.primaryClass * "}}" *}
355
          {"\href{" archive *  "/" * eprint * "}" * 
356
             "{{\tt " * format.archive * eprint *
357
              format.primaryClass * "}}" *}
358
       if$
359
     }
360
     if$
361
}
362
363
FUNCTION {format.url}
364
{ url empty$
365
    { "" }
366
    {"\url{" url * "}" *}
367
  if$
368
}
369
370
FUNCTION {format.report}
371
{ report empty$
372
     { ""}
373
     { report}
374
     if$
375
}
376
377
378
379
FUNCTION {format.editors}
380
{ editor empty$
381
    { "" }
382
    { editor format.names
383
      editor num.names$ #1 >
384
	{ ", eds." * }
385
	{ ", ed." * }
386
      if$
387
    }
388
  if$
389
}
390
391
FUNCTION {format.title}
392
{ title empty$
393
    { "" }
394
    { "``" title "t" change.case$ * ",''" * }
395
  if$
396
}
397
398
FUNCTION {format.title.p}
399
{ title empty$
400
    { "" }
401
    { "``" title "t" change.case$ * ".''" * }
402
  if$
403
}
404
405
FUNCTION {n.dashify}
406
{ 't :=
407
  ""
408
    { t empty$ not }
409
    { t #1 #1 substring$ "-" =
410
	{ t #1 #2 substring$ "--" = not
411
	    { "--" *
412
	      t #2 global.max$ substring$ 't :=
413
	    }
414
	    {   { t #1 #1 substring$ "-" = }
415
		{ "-" *
416
		  t #2 global.max$ substring$ 't :=
417
		}
418
	      while$
419
	    }
420
	  if$
421
	}
422
	{ t #1 #1 substring$ *
423
	  t #2 global.max$ substring$ 't :=
424
	}
425
      if$
426
    }
427
  while$
428
}
429
430
FUNCTION {format.date}
431
{ year empty$
432
    { month empty$
433
	{ "" }
434
	{ "there's a month but no year in " cite$ * warning$
435
	  month
436
	}
437
      if$
438
    }
439
    { month empty$
440
	'year
441
	{ month ", " * year * }
442
      if$
443
    }
444
  if$
445
}
446
447
FUNCTION {format.date.paren}
448
{ year empty$
449
    { month empty$
450
	{ "" }
451
	{ "there's a month but no year in " cite$ * warning$
452
	  month
453
	}
454
      if$
455
    }
456
    { month empty$
2 by Jacques Distler
Preliminary DOI support
457
	{"(" year * ") " *}
458
	{"(" month * ", " * year * ") " *}
1 by Jacques Distler
Initial Commits
459
      if$
460
    }
461
  if$
462
}
463
464
FUNCTION {format.collaboration}
465
{ collaboration empty$
466
    { "" }
467
    { "{\bf " collaboration * "} " * "Collaboration" * }
468
  if$
469
}
470
471
FUNCTION {format.SLACcitation}
472
{ SLACcitation empty$
473
  {""}
474
   { newline$ SLACcitation output "" newline$ }
475
  if$
476
}
477
478
FUNCTION {format.btitle}
479
{ title emphasize
480
}
481
482
FUNCTION {tie.or.space.connect}
483
{ duplicate$ text.length$ #3 <
484
    { "~" }
485
    { " " }
486
  if$
487
  swap$ * *
488
}
489
490
FUNCTION {either.or.check}
491
{ empty$
492
    'pop$
493
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
494
  if$
495
}
496
497
FUNCTION {format.bvolume}
498
{ volume empty$
499
    { "" }
500
    { "vol.~" volume *
501
      series empty$
502
	'skip$
503
	{ " of " * series emphasize * }
504
      if$
505
      "volume and number" number either.or.check
506
    }
507
  if$
508
}
509
510
FUNCTION {format.number.series}
511
{ volume empty$
512
    { number empty$
513
	{ series field.or.null }
514
	{ output.state mid.sentence =
515
	    { "no.~" }
516
	    { "No.~" }
517
	  if$
518
	  number *
519
	  series empty$
520
	    { "there's a number but no series in " cite$ * warning$ }
521
	    { " in " * series * }
522
	  if$
523
	}
524
      if$
525
    }
526
    { "" }
527
  if$
528
}
529
530
FUNCTION {format.edition}
531
{ edition empty$
532
    { "" }
533
    { edition "l" change.case$ "~ed." * }
534
  if$
535
}
536
537
INTEGERS { multiresult }
538
539
FUNCTION {multi.page.check}
540
{ 't :=
541
  #0 'multiresult :=
542
    { multiresult not
543
      t empty$ not
544
      and
545
    }
546
    { t #1 #1 substring$
547
      duplicate$ "-" =
548
      swap$ duplicate$ "," =
549
      swap$ "+" =
550
      or or
551
	{ #1 'multiresult := }
552
	{ t #2 global.max$ substring$ 't := }
553
      if$
554
    }
555
  while$
556
  multiresult
557
}
558
559
FUNCTION {format.pages}
560
{ pages empty$
561
    { "" }
562
    { pages multi.page.check
563
	{ "pp.~" pages n.dashify * }
564
	{ "p.~" pages * }
565
      if$
566
    }
567
  if$
568
}
569
570
FUNCTION {format.pages.nopp}
571
{ pages empty$
572
    { "" }
573
    { pages multi.page.check
574
	{ pages n.dashify  }
575
	{ pages }
576
      if$
577
    }
578
  if$
579
}
580
581
582
FUNCTION {format.volume}
583
{ volume empty$
584
    { "" }
2 by Jacques Distler
Preliminary DOI support
585
    { "{\bf " volume * "} " * }
1 by Jacques Distler
Initial Commits
586
  if$
587
}
588
589
FUNCTION {format.number}
590
{ number empty$
591
    { "" }
592
    { "no.~" number * "," *}
593
  if$
594
}
595
596
FUNCTION {format.chapter.pages}
597
{ chapter empty$
598
    'format.pages
599
    { type empty$
600
	{ "ch.~" chapter * }
601
	{ type "l" change.case$ chapter tie.or.space.connect }
602
      if$
603
      pages empty$
604
	'skip$
605
	{ ", " * format.pages * }
606
      if$
607
    }
608
  if$
609
}
610
611
FUNCTION {format.in.ed.booktitle}
612
{ booktitle empty$
613
    { "" }
614
    { "in " booktitle emphasize *
615
      editor empty$
616
	'skip$
617
	{ ", " * format.editors *  }
618
      if$
619
    }
620
  if$
621
}
622
623
FUNCTION {format.thesis.type}
624
{ type empty$
625
    'skip$
626
    { pop$
627
      output.state after.block =
628
	{ type "t" change.case$ }
629
	{ type "l" change.case$ }
630
      if$
631
    }
632
  if$
633
}
634
635
FUNCTION {empty.misc.check}
636
{ author empty$ title empty$ howpublished empty$
637
  month empty$ year empty$ note empty$
638
  and and and and and
639
    { "all relevant fields are empty in " cite$ * warning$ }
640
    'skip$
641
  if$
642
}
643
644
FUNCTION {format.tr.number}
645
{ type empty$
646
    { "Tech. Rep." }
647
    'type
648
  if$
649
  number empty$
650
    { "l" change.case$ }
651
    { number tie.or.space.connect }
652
  if$
653
}
654
655
FUNCTION {format.paddress}
656
{ address empty$
657
    { "" }
658
    { "(" address * ")" * }
659
  if$
660
}
661
662
FUNCTION {format.article.crossref}
663
{ key empty$
664
    { journal empty$
665
	{ "need key or journal for " cite$ * " to crossref " * crossref *
666
	  warning$
667
	  ""
668
	}
669
	{ "in {\em " journal * "\/}" * }
670
      if$
671
    }
672
    { "in " key * }
673
  if$
674
  " \cite{" * crossref * "}" *
675
}
676
677
FUNCTION {format.crossref.editor}
678
{ editor #1 "{vv~}{ll}" format.name$
679
  editor num.names$ duplicate$
680
  #2 >
681
    { pop$ " {\em et.~al.}" * }
682
    { #2 <
683
	'skip$
684
	{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
685
	    { " {\em et.~al.}" * }
686
	    { " and " * editor #2 "{vv~}{ll}" format.name$ * }
687
	  if$
688
	}
689
      if$
690
    }
691
  if$
692
}
693
694
FUNCTION {format.book.crossref}
695
{ volume empty$
696
    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
697
      "In "
698
    }
699
    { "Vol.~" volume *
700
      " of " *
701
    }
702
  if$
703
  editor empty$
704
  editor field.or.null author field.or.null =
705
  or
706
    { key empty$
707
	{ series empty$
708
	    { "need editor, key, or series for " cite$ * " to crossref " *
709
	      crossref * warning$
710
	      "" *
711
	    }
712
	    { "{\em " * series * "\/}" * }
713
	  if$
714
	}
715
	{ key * }
716
      if$
717
    }
718
    { format.crossref.editor * }
719
  if$
720
  " \cite{" * crossref * "}" *
721
}
722
723
FUNCTION {format.incoll.inproc.crossref}
724
{ editor empty$
725
  editor field.or.null author field.or.null =
726
  or
727
    { key empty$
728
	{ booktitle empty$
729
	    { "need editor, key, or booktitle for " cite$ * " to crossref " *
730
	      crossref * warning$
731
	      ""
732
	    }
733
	    { "in {\em " booktitle * "\/}" * }
734
	  if$
735
	}
736
	{ "in " key * }
737
      if$
738
    }
739
    { "in " format.crossref.editor * }
740
  if$
741
  " \cite{" * crossref * "}" *
742
}
743
2 by Jacques Distler
Preliminary DOI support
744
FUNCTION {format.journal}
745
{ journal missing$   
746
    { "" }
747
    {journal emphasize " " *
748
     format.volume *
749
     format.date.paren *
750
     month empty$
751
	     { format.number }
752
	     'skip$
753
        if$ * " " *
754
      format.pages.nopp *
755
      }
756
    if$
757
}
758
1 by Jacques Distler
Initial Commits
759
FUNCTION {article}
760
{ output.bibitem
761
  format.collaboration output
762
  format.authors "author" output.check
763
  format.title "title" output.check
764
  blank.sep
765
  crossref missing$
766
  { journal missing$   
767
    {}
2 by Jacques Distler
Preliminary DOI support
768
    { doi missing$
769
        {format.journal}
770
        { "\href{http://dx.doi.org/" doi * "}{" *
771
            format.journal * "}" *}
772
       if$ output
1 by Jacques Distler
Initial Commits
773
      }
774
      if$
775
      report missing$
2 by Jacques Distler
Preliminary DOI support
776
        {format.eprint output}
777
        {blank.sep format.report output format.eprint output}
778
        if$
1 by Jacques Distler
Initial Commits
779
    }
780
    { format.article.crossref output.nonnull
781
      format.pages output
782
      format.eprint output
783
    }
784
  if$
785
  new.sentence
786
  format.url output
787
  new.sentence
788
  note output
789
  new.sentence
790
  format.SLACcitation output
791
  fin.entry
792
}
793
794
FUNCTION {book}
795
{ output.bibitem
796
  format.collaboration output
797
  author empty$
798
    { format.editors "author and editor" output.check }
799
    { format.authors output.nonnull
800
      crossref missing$
801
	{ "author and editor" editor either.or.check }
802
	'skip$
803
      if$
804
    }
805
  if$
806
  format.btitle "title" output.check
807
  crossref missing$
808
    { format.bvolume output
809
      new.block
810
      format.number.series output
811
      new.sentence
812
      publisher "publisher" output.check
813
      address output
814
    }
815
    { new.block
816
      format.book.crossref output.nonnull
817
    }
818
  if$
819
  format.edition output
820
  format.date "year" output.check
821
  new.block
822
  format.eprint output
823
  new.block
824
  format.url output
825
  new.block
826
  note output
827
  new.sentence
828
  format.SLACcitation output
829
  fin.entry
830
}
831
832
FUNCTION {booklet}
833
{ output.bibitem
834
  format.collaboration output
835
  format.authors output
836
  title empty$
837
    { "empty title in " cite$ * warning$
838
      howpublished new.sentence.checka
839
    }
840
    { howpublished empty$ not
841
      address empty$ month empty$ year empty$ and and
842
      or
843
	{ format.title.p output.nonnull }
844
	{ format.title output.nonnull }
845
      if$
846
      blank.sep
847
    }
848
  if$
849
  howpublished capitalize output
850
  address output
851
  format.date output
852
  new.block
853
  format.eprint output
854
  new.block
855
  format.url output
856
  new.block
857
  note output
858
  new.sentence
859
  format.SLACcitation output
860
  fin.entry
861
}
862
863
FUNCTION {inbook}
864
{ output.bibitem
865
  format.collaboration output
866
  author empty$
867
    { format.editors "author and editor" output.check }
868
    { format.authors output.nonnull
869
      crossref missing$
870
	{ "author and editor" editor either.or.check }
871
	'skip$
872
      if$
873
    }
874
  if$
875
  format.btitle "title" output.check
876
  crossref missing$
877
    { format.bvolume output
878
      format.chapter.pages "chapter and pages" output.check
879
      new.block
880
      format.number.series output
881
      new.block
882
      publisher "publisher" output.check
883
      address output
884
    }
885
    { format.chapter.pages "chapter and pages" output.check
886
      new.block
887
      format.book.crossref output.nonnull
888
    }
889
  if$
890
  format.edition output
891
  format.date "year" output.check
892
  new.block
893
  format.eprint output
894
  new.block
895
  format.url output
896
  new.block
897
  note output
898
  new.sentence
899
  format.SLACcitation output
900
  fin.entry
901
}
902
903
FUNCTION {incollection}
904
{ output.bibitem
905
  format.collaboration output
906
  format.authors "author" output.check
907
  format.title "title" output.check
908
  blank.sep
909
  crossref missing$
910
    { format.in.ed.booktitle "booktitle" output.check
911
      format.bvolume output
912
      format.number.series output
913
      format.chapter.pages output
914
      new.block
915
      publisher "publisher" output.check
916
      address output
917
      format.edition output
918
      format.date "year" output.check
919
    }
920
    { format.incoll.inproc.crossref output.nonnull
921
      format.chapter.pages output
922
    }
923
  if$
924
  new.block
925
  format.eprint output
926
  new.block
927
  format.url output
928
  new.block
929
  note output
930
  new.sentence
931
  format.SLACcitation output
932
  fin.entry
933
}
934
935
FUNCTION {inproceedings}
936
{ output.bibitem
937
  format.collaboration output
938
  format.authors "author" output.check
939
  format.title "title" output.check
940
  blank.sep
941
  crossref missing$
942
    { format.in.ed.booktitle "booktitle" output.check
943
      format.bvolume output
944
      format.number.series output
945
      format.pages output
946
      organization output
947
      new.block
948
      publisher output
949
      address output
950
      format.date "year" output.check
951
    }
952
    { format.incoll.inproc.crossref output.nonnull
953
      format.pages output
954
    }
955
  if$
956
  new.block
957
  format.eprint output
958
  new.block
959
  format.url output
960
  new.block
961
  note output
962
  new.sentence
963
  format.SLACcitation output
964
  fin.entry
965
}
966
967
FUNCTION {conference} { inproceedings }
968
969
FUNCTION {manual}
970
{ output.bibitem
971
  format.collaboration output
972
  author empty$
973
    { organization empty$
974
	'skip$
975
	{ organization output.nonnull
976
	  address output
977
	}
978
      if$
979
    }
980
    { format.authors output.nonnull }
981
  if$
982
  format.btitle "title" output.check
983
  author empty$
984
    { organization empty$
985
	{ address new.block.checka
986
	  address output
987
	}
988
	'skip$
989
      if$
990
    }
991
    { organization address new.block.checkb
992
      organization output
993
      address output
994
    }
995
  if$
996
  format.edition output
997
  format.date output
998
  new.block
999
  format.eprint output
1000
  new.block
1001
  format.url output
1002
  new.block
1003
  note output
1004
  fin.entry
1005
}
1006
1007
FUNCTION {mastersthesis}
1008
{ output.bibitem
1009
  format.authors "author" output.check
1010
  format.title "title" output.check
1011
  blank.sep
1012
  "Master's thesis" format.thesis.type output.nonnull
1013
  school "school" output.check
1014
  address output
1015
  format.date "year" output.check
1016
  new.block
1017
  format.url output
1018
  new.block
1019
  note output
1020
  fin.entry
1021
}
1022
1023
FUNCTION {misc}
1024
{ output.bibitem
1025
  format.collaboration output
1026
  format.authors output
1027
  title empty$
1028
    { howpublished new.sentence.checka }
1029
    { howpublished empty$ not
1030
      month empty$ year empty$ and
1031
      or
1032
	{ format.title.p output.nonnull }
1033
	{ format.title output.nonnull }
1034
      if$
1035
      blank.sep
1036
    }
1037
  if$
1038
  howpublished capitalize output
1039
  format.date output
1040
  new.block
1041
  format.url output
1042
  new.sentence
1043
  note output
1044
  new.sentence
1045
  fin.entry
1046
  empty.misc.check
1047
}
1048
1049
FUNCTION {phdthesis}
1050
{ output.bibitem
1051
  format.authors "author" output.check
1052
  format.btitle "title" output.check
1053
  new.block
1054
  "PhD thesis" format.thesis.type output.nonnull
1055
  school "school" output.check
1056
  address output
1057
  format.date "year" output.check
1058
  new.block
1059
  format.eprint output
1060
  new.block
1061
  format.url output
1062
  new.block
1063
  note output
1064
  new.sentence
1065
  format.SLACcitation output
1066
  fin.entry
1067
}
1068
1069
FUNCTION {proceedings}
1070
{ output.bibitem
1071
  editor empty$
1072
    { organization output }
1073
    { format.editors output.nonnull }
1074
  if$
1075
  format.btitle "title" output.check
1076
  format.bvolume output
1077
  format.number.series output
1078
  editor empty$
1079
    'skip$
1080
    { organization output }
1081
  if$
1082
  new.block
1083
  publisher output
1084
  address output
1085
  format.date "year" output.check
1086
  new.block
1087
  format.eprint output
1088
  new.block
1089
  format.url output
1090
  new.block
1091
  note output
1092
  new.sentence
1093
  format.SLACcitation output
1094
  fin.entry
1095
}
1096
1097
FUNCTION {techreport}
1098
{ output.bibitem
1099
  format.collaboration output
1100
  format.authors "author" output.check
1101
  format.title "title" output.check
1102
  blank.sep
1103
  format.tr.number output.nonnull
1104
  institution "institution" output.check
1105
  address output
1106
  format.date "year" output.check
1107
  new.block
1108
  format.eprint output
1109
  new.block
1110
  format.url output
1111
  new.block
1112
  note output
1113
  fin.entry
1114
}
1115
1116
FUNCTION {unpublished}
1117
{ output.bibitem
1118
  format.collaboration output
1119
  format.authors "author" output.check
1120
  format.title.p "title" output.check
1121
  blank.sep
1122
  note "note" output.check
1123
  format.date output
1124
  new.sentence
1125
  format.SLACcitation output
1126
  fin.entry
1127
}
1128
1129
FUNCTION {default.type} { misc }
1130
1131
MACRO {jan} {"Jan."}
1132
1133
MACRO {feb} {"Feb."}
1134
1135
MACRO {mar} {"Mar."}
1136
1137
MACRO {apr} {"Apr."}
1138
1139
MACRO {may} {"May"}
1140
1141
MACRO {jun} {"June"}
1142
1143
MACRO {jul} {"July"}
1144
1145
MACRO {aug} {"Aug."}
1146
1147
MACRO {sep} {"Sept."}
1148
1149
MACRO {oct} {"Oct."}
1150
1151
MACRO {nov} {"Nov."}
1152
1153
MACRO {dec} {"Dec."}
1154
1155
MACRO {nup} {"Nucl. Phys."}
1156
1157
MACRO {cmp} {"Comm. Math. Phys."}
1158
1159
MACRO {prl} {"Phys. Rev. Lett."}
1160
1161
MACRO {pl} {"Phys. Lett."}
1162
1163
MACRO {rmp} {"Rev. Mod. Phys."}
1164
1165
MACRO {ijmp} {"Int. Jour. Mod. Phys."}
1166
1167
MACRO {mpl} {"Mod. Phys. Lett."}
1168
1169
MACRO {pr} {"Phys. Rev."}
1170
1171
MACRO {arXiv}     {"http://arxiv.org/abs"}
1172
MACRO {cogprints} {"http://cogprints.org"}
1173
MACRO {pubmed}    {"http://www.ncbi.nlm.nih.gov/pubmed"}
1174
1175
READ
1176
1177
STRINGS { longest.label }
1178
1179
INTEGERS { number.label longest.label.width }
1180
1181
FUNCTION {initialize.longest.label}
1182
{ "" 'longest.label :=
1183
  #1 'number.label :=
1184
  #0 'longest.label.width :=
1185
}
1186
1187
FUNCTION {longest.label.pass}
1188
{ number.label int.to.str$ 'label :=
1189
  number.label #1 + 'number.label :=
1190
  label width$ longest.label.width >
1191
    { label 'longest.label :=
1192
      label width$ 'longest.label.width :=
1193
    }
1194
    'skip$
1195
  if$
1196
}
1197
1198
EXECUTE {initialize.longest.label}
1199
1200
ITERATE {longest.label.pass}
1201
1202
FUNCTION {begin.bib}
1203
{ preamble$ empty$
1204
    'skip$
1205
    { preamble$ write$ newline$ }
1206
  if$
1207
  "\providecommand{\href}[2]{#2}"
1208
  "\begingroup\raggedright\begin{thebibliography}{" * longest.label  * 
1209
  "}" * write$ newline$ }
1210
1211
EXECUTE {begin.bib}
1212
1213
EXECUTE {init.state.consts}
1214
1215
ITERATE {call.type$}
1216
1217
FUNCTION {end.bib}
1218
{ newline$
1219
  "\end{thebibliography}\endgroup" write$ newline$
1220
}
1221
1222
EXECUTE {end.bib}