/utphys

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