/utphys

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