/utphys

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