/utphys

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