source: papers/SMPaT-2012_DCWoRMS/elsevier_guide/aricle/elsarticle-num.bst @ 593

Revision 593, 28.7 KB checked in by wojtekp, 12 years ago (diff)
RevLine 
[593]1%%
2%% This is file `elsarticle-num.bst',
3%%
4%% Copyright 2007, 2008, 2009 Elsevier Ltd
5%%
6%% This file is part of the 'Elsarticle Bundle'.
7%% ---------------------------------------------
8%%
9%% It may be distributed under the conditions of the LaTeX Project Public
10%% License, either version 1.2 of this license or (at your option) any
11%% later version.  The latest version of this license is in
12%%    http://www.latex-project.org/lppl.txt
13%% and version 1.2 or later is part of all distributions of LaTeX
14%% version 1999/12/01 or later.
15%%
16%% The list of all files belonging to the 'Elsarticle Bundle' is
17%% given in the file `manifest.txt'.
18%%
19%%
20%% $Id: elsarticle-num.bst 19 2009-12-17 07:07:52Z rishi $
21%%
22%%
23%% ----------------------------------------
24%%
25ENTRY
26  { address
27    author
28    booktitle
29    chapter
30    edition
31    editor
32    howpublished
33    institution
34    journal
35    key
36    month
37    note
38    number
39    organization
40    pages
41    publisher
42    school
43    series
44    title
45    type
46    volume
47    year
48    eprint % urlbst
49    doi % urlbst
50    url % urlbst
51    lastchecked % urlbst
52  }
53  {}
54  { label }
55
56INTEGERS { output.state before.all mid.sentence after.sentence after.block }
57
58STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl openinlinelink closeinlinelink } % urlbst...
59INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver }
60FUNCTION {init.urlbst.variables}
61{
62  "Available from: " 'urlintro := % prefix before URL
63  "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
64  "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
65  "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
66  "doi:" 'doiprefix :=      % text prefix printed before DOI ref
67  #1 'addeprints :=         % 0=no eprints; 1=include eprints
68  #1 'adddoiresolver :=     % 0=no DOI resolver; 1=include it
69  #2 'hrefform :=           % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs
70  #1 'inlinelinks :=        % 0=URLs explicit; 1=URLs attached to titles
71  % the following are internal state variables, not config constants
72  #0 'makeinlinelink :=     % state variable managed by setup.inlinelink
73  "" 'openinlinelink :=     % ditto
74  "" 'closeinlinelink :=    % ditto
75}
76INTEGERS {
77  bracket.state
78  outside.brackets
79  open.brackets
80  within.brackets
81  close.brackets
82}
83FUNCTION {init.state.consts}
84{ #0 'outside.brackets := % urlbst
85  #1 'open.brackets :=
86  #2 'within.brackets :=
87  #3 'close.brackets :=
88
89  #0 'before.all :=
90  #1 'mid.sentence :=
91  #2 'after.sentence :=
92  #3 'after.block :=
93}
94
95STRINGS { s t }
96
97FUNCTION {output.nonnull.original}
98{ 's :=
99  output.state mid.sentence =
100    { ", " * write$ }
101    { output.state after.block =
102        { add.period$ write$
103          newline$
104          "\newblock " write$
105        }
106        { output.state before.all =
107            'write$
108            { add.period$ " " * write$ }
109          if$
110        }
111      if$
112      mid.sentence 'output.state :=
113    }
114  if$
115  s
116}
117
118FUNCTION {setup.inlinelink}
119{ makeinlinelink
120    { hrefform #1 = % hypertex
121        { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink :=
122          "\special {html:</a>}" 'closeinlinelink :=
123          }
124        { hrefform #2 = % hyperref
125            { "\href{" url * "}{" * 'openinlinelink :=
126              "}" 'closeinlinelink :=
127              }
128            'skip$
129          if$ % hrefform #2 =
130        }
131      if$ % hrefform #1 =
132      #0 'makeinlinelink :=
133    }
134    'skip$
135 if$ % makeinlinelink
136}
137FUNCTION {add.inlinelink}
138{ openinlinelink empty$
139    'skip$
140    { openinlinelink swap$ * closeinlinelink *
141      "" 'openinlinelink :=
142      }
143  if$
144}
145FUNCTION {output.nonnull}
146{ % Save the thing we've been asked to output
147  's :=
148  % If the bracket-state is close.brackets, then add a close-bracket to
149  % what is currently at the top of the stack, and set bracket.state
150  % to outside.brackets
151  bracket.state close.brackets =
152    { "]" *
153      outside.brackets 'bracket.state :=
154    }
155    'skip$
156  if$
157  bracket.state outside.brackets =
158    { % We're outside all brackets -- this is the normal situation.
159      % Write out what's currently at the top of the stack, using the
160      % original output.nonnull function.
161      s
162      add.inlinelink
163      output.nonnull.original % invoke the original output.nonnull
164    }
165    { % Still in brackets.  Add open-bracket or (continuation) comma, add the
166      % new text (in s) to the top of the stack, and move to the close-brackets
167      % state, ready for next time (unless inbrackets resets it).  If we come
168      % into this branch, then output.state is carefully undisturbed.
169      bracket.state open.brackets =
170        { " [" * }
171        { ", " * } % bracket.state will be within.brackets
172      if$
173      s *
174      close.brackets 'bracket.state :=
175    }
176  if$
177}
178
179FUNCTION {inbrackets}
180{ bracket.state close.brackets =
181    { within.brackets 'bracket.state := } % reset the state: not open nor closed
182    { open.brackets 'bracket.state := }
183  if$
184}
185
186FUNCTION {format.lastchecked}
187{ lastchecked empty$
188    { "" }
189    { inbrackets "cited " lastchecked * }
190  if$
191}
192
193FUNCTION {output}
194{ duplicate$ empty$
195    'pop$
196    'output.nonnull
197  if$
198}
199
200FUNCTION {output.check}
201{ 't :=
202  duplicate$ empty$
203    { pop$ "empty " t * " in " * cite$ * warning$ }
204    'output.nonnull
205  if$
206}
207
208FUNCTION {fin.entry.original}
209{ add.period$
210  write$
211  newline$
212}
213
214FUNCTION {new.block}
215{ output.state before.all =
216    'skip$
217    { after.block 'output.state := }
218  if$
219}
220
221FUNCTION {new.sentence}
222{ output.state after.block =
223    'skip$
224    { output.state before.all =
225        'skip$
226        { after.sentence 'output.state := }
227      if$
228    }
229  if$
230}
231
232FUNCTION {add.blank}
233{  " " * before.all 'output.state :=
234}
235
236FUNCTION {date.block}
237{
238  add.blank
239}
240
241FUNCTION {not}
242{   { #0 }
243    { #1 }
244  if$
245}
246
247FUNCTION {and}
248{   'skip$
249    { pop$ #0 }
250  if$
251}
252
253FUNCTION {or}
254{   { pop$ #1 }
255    'skip$
256  if$
257}
258
259FUNCTION {new.block.checka}
260{ empty$
261    'skip$
262    'new.block
263  if$
264}
265
266FUNCTION {new.block.checkb}
267{ empty$
268  swap$ empty$
269  and
270    'skip$
271    'new.block
272  if$
273}
274
275FUNCTION {new.sentence.checka}
276{ empty$
277    'skip$
278    'new.sentence
279  if$
280}
281
282FUNCTION {new.sentence.checkb}
283{ empty$
284  swap$ empty$
285  and
286    'skip$
287    'new.sentence
288  if$
289}
290
291FUNCTION {field.or.null}
292{ duplicate$ empty$
293    { pop$ "" }
294    'skip$
295  if$
296}
297
298FUNCTION {emphasize}
299{ skip$ }
300
301FUNCTION {capitalize}
302{ "u" change.case$ "t" change.case$ }
303
304FUNCTION {space.word}
305{ " " swap$ * " " * }
306
307 % Here are the language-specific definitions for explicit words.
308 % Each function has a name bbl.xxx where xxx is the English word.
309 % The language selected here is ENGLISH
310FUNCTION {bbl.and}
311{ "and"}
312
313FUNCTION {bbl.etal}
314{ "et~al." }
315
316FUNCTION {bbl.editors}
317{ "Eds." }
318
319FUNCTION {bbl.editor}
320{ "Ed." }
321
322FUNCTION {bbl.edby}
323{ "edited by" }
324
325FUNCTION {bbl.edition}
326{ "Edition" }
327
328FUNCTION {bbl.volume}
329{ "Vol." }
330
331FUNCTION {bbl.of}
332{ "of" }
333
334FUNCTION {bbl.number}
335{ "no." }
336
337FUNCTION {bbl.nr}
338{ "no." }
339
340FUNCTION {bbl.in}
341{ "in" }
342
343FUNCTION {bbl.pages}
344{ "pp." }
345
346FUNCTION {bbl.page}
347{ "p." }
348
349FUNCTION {bbl.chapter}
350{ "Ch." }
351
352FUNCTION {bbl.techrep}
353{ "Tech. Rep." }
354
355FUNCTION {bbl.mthesis}
356{ "Master's thesis" }
357
358FUNCTION {bbl.phdthesis}
359{ "Ph.D. thesis" }
360
361FUNCTION {bbl.first}
362{ "1st" }
363
364FUNCTION {bbl.second}
365{ "2nd" }
366
367FUNCTION {bbl.third}
368{ "3rd" }
369
370FUNCTION {bbl.fourth}
371{ "4th" }
372
373FUNCTION {bbl.fifth}
374{ "5th" }
375
376FUNCTION {bbl.st}
377{ "st" }
378
379FUNCTION {bbl.nd}
380{ "nd" }
381
382FUNCTION {bbl.rd}
383{ "rd" }
384
385FUNCTION {bbl.th}
386{ "th" }
387
388MACRO {jan} {"Jan."}
389
390MACRO {feb} {"Feb."}
391
392MACRO {mar} {"Mar."}
393
394MACRO {apr} {"Apr."}
395
396MACRO {may} {"May"}
397
398MACRO {jun} {"Jun."}
399
400MACRO {jul} {"Jul."}
401
402MACRO {aug} {"Aug."}
403
404MACRO {sep} {"Sep."}
405
406MACRO {oct} {"Oct."}
407
408MACRO {nov} {"Nov."}
409
410MACRO {dec} {"Dec."}
411
412FUNCTION {eng.ord}
413{ duplicate$ "1" swap$ *
414  #-2 #1 substring$ "1" =
415     { bbl.th * }
416     { duplicate$ #-1 #1 substring$
417       duplicate$ "1" =
418         { pop$ bbl.st * }
419         { duplicate$ "2" =
420             { pop$ bbl.nd * }
421             { "3" =
422                 { bbl.rd * }
423                 { bbl.th * }
424               if$
425             }
426           if$
427          }
428       if$
429     }
430   if$
431}
432
433MACRO {acmcs} {"ACM Comput. Surv."}
434
435MACRO {acta} {"Acta Inf."}
436
437MACRO {cacm} {"Commun. ACM"}
438
439MACRO {ibmjrd} {"IBM J. Res. Dev."}
440
441MACRO {ibmsj} {"IBM Syst.~J."}
442
443MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
444
445MACRO {ieeetc} {"IEEE Trans. Comput."}
446
447MACRO {ieeetcad}
448 {"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
449
450MACRO {ipl} {"Inf. Process. Lett."}
451
452MACRO {jacm} {"J.~ACM"}
453
454MACRO {jcss} {"J.~Comput. Syst. Sci."}
455
456MACRO {scp} {"Sci. Comput. Programming"}
457
458MACRO {sicomp} {"SIAM J. Comput."}
459
460MACRO {tocs} {"ACM Trans. Comput. Syst."}
461
462MACRO {tods} {"ACM Trans. Database Syst."}
463
464MACRO {tog} {"ACM Trans. Gr."}
465
466MACRO {toms} {"ACM Trans. Math. Softw."}
467
468MACRO {toois} {"ACM Trans. Office Inf. Syst."}
469
470MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
471
472MACRO {tcs} {"Theoretical Comput. Sci."}
473
474FUNCTION {write.url}
475{ url empty$
476    { skip$ }
477    { "\newline\urlprefix\url{" url * "}" * write$ newline$ }
478  if$
479}
480
481INTEGERS { nameptr namesleft numnames }
482
483FUNCTION {format.names}
484{ 's :=
485  #1 'nameptr :=
486  s num.names$ 'numnames :=
487  numnames 'namesleft :=
488    { namesleft #0 > }
489    { s nameptr
490      "{f.~}{vv~}{ll}{, jj}" format.name$
491    't :=
492      nameptr #1 >
493        {
494          namesleft #1 >
495            { ", " * t * }
496            {
497              "," *
498              s nameptr "{ll}" format.name$ duplicate$ "others" =
499                { 't := }
500                { pop$ }
501              if$
502              t "others" =
503                {
504                  " " * bbl.etal *
505                }
506                { " " * t * }
507              if$
508            }
509          if$
510        }
511        't
512      if$
513      nameptr #1 + 'nameptr :=
514      namesleft #1 - 'namesleft :=
515    }
516  while$
517}
518FUNCTION {format.names.ed}
519{ format.names }
520FUNCTION {format.authors}
521{ author empty$
522    { "" }
523    { author format.names }
524  if$
525}
526
527FUNCTION {format.editors}
528{ editor empty$
529    { "" }
530    { editor format.names
531      editor num.names$ #1 >
532        { " (" * bbl.editors * ")" * }
533        { " (" * bbl.editor * ")" * }
534      if$
535    }
536  if$
537}
538
539FUNCTION {format.in.editors}
540{ editor empty$
541    { "" }
542    { editor format.names.ed
543      editor num.names$ #1 >
544        { " (" * bbl.editors * ")" * }
545        { " (" * bbl.editor * ")" * }
546      if$
547    }
548  if$
549}
550
551FUNCTION {format.note}
552{
553 note empty$
554    { "" }
555    { note #1 #1 substring$
556      duplicate$ "{" =
557        'skip$
558        { output.state mid.sentence =
559          { "l" }
560          { "u" }
561        if$
562        change.case$
563        }
564      if$
565      note #2 global.max$ substring$ *
566    }
567  if$
568}
569
570FUNCTION {format.title}
571{ title empty$
572    { "" }
573    { title "t" change.case$
574    }
575  if$
576}
577
578FUNCTION {output.bibitem.original}
579{ newline$
580  "\bibitem{" write$
581  cite$ write$
582  "}" write$
583  newline$
584  ""
585  before.all 'output.state :=
586}
587
588FUNCTION {n.dashify}
589{
590  't :=
591  ""
592    { t empty$ not }
593    { t #1 #1 substring$ "-" =
594        { t #1 #2 substring$ "--" = not
595            { "--" *
596              t #2 global.max$ substring$ 't :=
597            }
598            {   { t #1 #1 substring$ "-" = }
599                { "-" *
600                  t #2 global.max$ substring$ 't :=
601                }
602              while$
603            }
604          if$
605        }
606        { t #1 #1 substring$ *
607          t #2 global.max$ substring$ 't :=
608        }
609      if$
610    }
611  while$
612}
613
614FUNCTION {word.in}
615{ bbl.in
616  ":" *
617  " " * }
618
619FUNCTION {format.date}
620{ year empty$
621    { month empty$
622        { "" }
623        { "there's a month but no year in " cite$ * warning$
624          month
625        }
626      if$
627    }
628    { month empty$
629        'year
630        { month " " * year * }
631      if$
632    }
633  if$
634  duplicate$ empty$
635    'skip$
636    {
637      before.all 'output.state :=
638    " (" swap$ * ")" *
639    }
640  if$
641}
642
643FUNCTION{format.year}
644{ year duplicate$ empty$
645    { "empty year in " cite$ * warning$ pop$ "" }
646    { "(" swap$ * ")" * }
647  if$
648}
649
650FUNCTION {format.btitle}
651{ title
652}
653
654FUNCTION {tie.or.space.connect}
655{ duplicate$ text.length$ #3 <
656    { "~" }
657    { " " }
658  if$
659  swap$ * *
660}
661
662FUNCTION {either.or.check}
663{ empty$
664    'pop$
665    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
666  if$
667}
668
669FUNCTION {format.bvolume}
670{ volume empty$
671    { "" }
672    { bbl.volume volume tie.or.space.connect
673      series empty$
674        'skip$
675        { bbl.of space.word * series emphasize * }
676      if$
677      "volume and number" number either.or.check
678    }
679  if$
680}
681
682FUNCTION {format.number.series}
683{ volume empty$
684    { number empty$
685        { series field.or.null }
686        { output.state mid.sentence =
687            { bbl.number }
688            { bbl.number capitalize }
689          if$
690          number tie.or.space.connect
691          series empty$
692            { "there's a number but no series in " cite$ * warning$ }
693            { bbl.in space.word * series * }
694          if$
695        }
696      if$
697    }
698    { "" }
699  if$
700}
701
702FUNCTION {is.num}
703{ chr.to.int$
704  duplicate$ "0" chr.to.int$ < not
705  swap$ "9" chr.to.int$ > not and
706}
707
708FUNCTION {extract.num}
709{ duplicate$ 't :=
710  "" 's :=
711  { t empty$ not }
712  { t #1 #1 substring$
713    t #2 global.max$ substring$ 't :=
714    duplicate$ is.num
715      { s swap$ * 's := }
716      { pop$ "" 't := }
717    if$
718  }
719  while$
720  s empty$
721    'skip$
722    { pop$ s }
723  if$
724}
725
726FUNCTION {convert.edition}
727{ edition extract.num "l" change.case$ 's :=
728  s "first" = s "1" = or
729    { bbl.first 't := }
730    { s "second" = s "2" = or
731        { bbl.second 't := }
732        { s "third" = s "3" = or
733            { bbl.third 't := }
734            { s "fourth" = s "4" = or
735                { bbl.fourth 't := }
736                { s "fifth" = s "5" = or
737                    { bbl.fifth 't := }
738                    { s #1 #1 substring$ is.num
739                        { s eng.ord 't := }
740                        { edition 't := }
741                      if$
742                    }
743                  if$
744                }
745              if$
746            }
747          if$
748        }
749      if$
750    }
751  if$
752  t
753}
754
755FUNCTION {format.edition}
756{ edition empty$
757    { "" }
758    { output.state mid.sentence =
759        { convert.edition "l" change.case$ " " * bbl.edition * }
760        { convert.edition "t" change.case$ " " * bbl.edition * }
761      if$
762    }
763  if$
764}
765
766INTEGERS { multiresult }
767
768FUNCTION {multi.page.check}
769{ 't :=
770  #0 'multiresult :=
771    { multiresult not
772      t empty$ not
773      and
774    }
775    { t #1 #1 substring$
776      duplicate$ "-" =
777      swap$ duplicate$ "," =
778      swap$ "+" =
779      or or
780        { #1 'multiresult := }
781        { t #2 global.max$ substring$ 't := }
782      if$
783    }
784  while$
785  multiresult
786}
787
788FUNCTION {format.pages}
789{ pages empty$
790    { "" }
791    { pages multi.page.check
792        { bbl.pages pages n.dashify tie.or.space.connect }
793        { bbl.page pages tie.or.space.connect }
794      if$
795    }
796  if$
797}
798
799FUNCTION {format.journal.pages}
800{ pages empty$
801    'skip$
802    { duplicate$ empty$
803        { pop$ format.pages }
804        {
805          " " *
806          format.year * " " *
807          pages n.dashify *
808        }
809      if$
810    }
811  if$
812}
813
814FUNCTION {format.vol.num.pages}
815{
816  % volume field.or.null
817  " "
818  volume empty$
819    { pop$ "" }
820    { volume * }
821  if$
822  number empty$
823    'skip$
824    {
825      "~(" number * ")" * *
826      volume empty$
827        { "there's a number but no volume in " cite$ * warning$ }
828        'skip$
829      if$
830    }
831  if$
832}
833
834FUNCTION {format.chapter.pages}
835{ chapter empty$
836    { "" }
837    { type empty$
838        { bbl.chapter }
839        { type "l" change.case$ }
840      if$
841      chapter tie.or.space.connect
842    }
843  if$
844}
845
846FUNCTION {format.in.ed.booktitle}
847{ booktitle empty$
848    { "" }
849    { editor empty$
850        { word.in booktitle * }
851        { word.in format.in.editors * ", " *
852          booktitle * }
853      if$
854    }
855  if$
856}
857
858FUNCTION {empty.misc.check}
859{ author empty$ title empty$ howpublished empty$
860  month empty$ year empty$ note empty$
861  and and and and and
862    { "all relevant fields are empty in " cite$ * warning$ }
863    'skip$
864  if$
865}
866
867FUNCTION {format.thesis.type}
868{ type empty$
869    'skip$
870    { pop$
871      type "t" change.case$
872    }
873  if$
874}
875
876FUNCTION {format.tr.number}
877{ type empty$
878    { bbl.techrep }
879    'type
880  if$
881  number empty$
882    { "t" change.case$ }
883    { number tie.or.space.connect }
884  if$
885}
886
887FUNCTION {format.article.crossref}
888{
889  key empty$
890    { journal empty$
891        { "need key or journal for " cite$ * " to crossref " * crossref *
892          warning$
893          ""
894        }
895        { word.in journal emphasize * }
896      if$
897    }
898    { word.in key * " " *}
899  if$
900  " \cite{" * crossref * "}" *
901}
902
903FUNCTION {format.crossref.editor}
904{ editor #1 "{vv~}{ll}" format.name$
905  editor num.names$ duplicate$
906  #2 >
907    { pop$
908      " " * bbl.etal *
909    }
910    { #2 <
911        'skip$
912        { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
913            {
914              " " * bbl.etal *
915            }
916            { bbl.and space.word * editor #2 "{vv~}{ll}" format.name$
917              * }
918          if$
919        }
920      if$
921    }
922  if$
923}
924
925FUNCTION {format.book.crossref}
926{ volume empty$
927    { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
928      word.in
929    }
930    { bbl.volume volume tie.or.space.connect
931      bbl.of space.word *
932    }
933  if$
934  editor empty$
935  editor field.or.null author field.or.null =
936  or
937    { key empty$
938        { series empty$
939            { "need editor, key, or series for " cite$ * " to crossref " *
940              crossref * warning$
941              "" *
942            }
943            { series emphasize * }
944          if$
945        }
946        { key * }
947      if$
948    }
949    { format.crossref.editor * }
950  if$
951  " \cite{" * crossref * "}" *
952}
953
954FUNCTION {format.incoll.inproc.crossref}
955{
956  editor empty$
957  editor field.or.null author field.or.null =
958  or
959    { key empty$
960        { booktitle empty$
961            { "need editor, key, or booktitle for " cite$ * " to crossref " *
962              crossref * warning$
963              ""
964            }
965            { word.in booktitle * }
966          if$
967        }
968        { word.in key * " " *}
969      if$
970    }
971    { word.in format.crossref.editor * " " *}
972  if$
973  " \cite{" * crossref * "}" *
974}
975
976FUNCTION {format.org.or.pub}
977{ 't :=
978  ""
979  year empty$
980    { "empty year in " cite$ * warning$ }
981    'skip$
982  if$
983  address empty$ t empty$ and
984  year empty$ and
985    'skip$
986    {
987      t empty$
988        { address empty$
989          'skip$
990          { address * }
991          if$
992        }
993        { t *
994          address empty$
995            'skip$
996            { ", " * address * }
997          if$
998        }
999      if$
1000      year empty$
1001        'skip$
1002        { t empty$ address empty$ and
1003            'skip$
1004            { ", " * }
1005          if$
1006          year *
1007        }
1008      if$
1009    }
1010  if$
1011}
1012
1013FUNCTION {format.publisher.address}
1014{ publisher empty$
1015    { "empty publisher in " cite$ * warning$
1016      ""
1017    }
1018    { publisher }
1019  if$
1020  format.org.or.pub
1021}
1022
1023FUNCTION {format.organization.address}
1024{ organization empty$
1025    { "" }
1026    { organization }
1027  if$
1028  format.org.or.pub
1029}
1030
1031FUNCTION {make.href.null}
1032{
1033  pop$
1034}
1035FUNCTION {make.href.hypertex}
1036{
1037  "\special {html:<a href=" quote$ *
1038  swap$ * quote$ * "> }" * swap$ *
1039  "\special {html:</a>}" *
1040}
1041FUNCTION {make.href.hyperref}
1042{
1043  "\href {" swap$ * "} {\path{" * swap$ * "}}" *
1044}
1045FUNCTION {make.href}
1046{ hrefform #2 =
1047    'make.href.hyperref      % hrefform = 2
1048    { hrefform #1 =
1049        'make.href.hypertex  % hrefform = 1
1050        'make.href.null      % hrefform = 0 (or anything else)
1051      if$
1052    }
1053  if$
1054}
1055
1056FUNCTION {format.url}
1057{ inlinelinks #1 = url empty$ or
1058   { "" }
1059   { hrefform #1 =
1060       { % special case -- add HyperTeX specials
1061         urlintro "\url{" url * "}" * url make.href.hypertex * }
1062       { urlintro "\url{" * url * "}" * }
1063     if$
1064   }
1065  if$
1066}
1067
1068FUNCTION {format.eprint}
1069{ eprint empty$
1070    { "" }
1071    { eprintprefix eprint * eprinturl eprint * make.href }
1072  if$
1073}
1074
1075FUNCTION {format.doi}
1076{ doi empty$
1077    { "" }
1078    { doiprefix doi * doiurl doi * make.href }
1079  if$
1080}
1081
1082FUNCTION {output.url}
1083{ url empty$
1084    'skip$
1085    { new.block
1086      format.url output
1087      format.lastchecked output
1088    }
1089  if$
1090}
1091
1092FUNCTION {output.web.refs}
1093{
1094  new.block
1095  output.url
1096  addeprints eprint empty$ not and
1097    { format.eprint output.nonnull }
1098    'skip$
1099  if$
1100  adddoiresolver doi empty$ not and
1101    { format.doi output.nonnull }
1102    'skip$
1103  if$
1104}
1105
1106FUNCTION {output.bibitem}
1107{ outside.brackets 'bracket.state :=
1108  output.bibitem.original
1109  inlinelinks url empty$ not and
1110    { #1 'makeinlinelink := }
1111    { #0 'makeinlinelink := }
1112  if$
1113}
1114
1115FUNCTION {fin.entry}
1116{ output.web.refs  % urlbst
1117  makeinlinelink       % ooops, it appears we didn't have a title for inlinelink
1118    { setup.inlinelink % add some artificial link text here, as a fallback
1119      "[link]" output.nonnull }
1120    'skip$
1121  if$
1122  bracket.state close.brackets = % urlbst
1123    { "]" * }
1124    'skip$
1125  if$
1126  fin.entry.original
1127}
1128
1129FUNCTION {webpage}
1130{ output.bibitem
1131  author empty$
1132    { editor empty$
1133        'skip$  % author and editor both optional
1134        { format.editors output.nonnull }
1135      if$
1136    }
1137    { editor empty$
1138        { format.authors output.nonnull }
1139        { "can't use both author and editor fields in " cite$ * warning$ }
1140      if$
1141    }
1142  if$
1143  new.block
1144  title empty$ 'skip$ 'setup.inlinelink if$
1145  format.title "title" output.check
1146  inbrackets "online" output
1147  new.block
1148  year empty$
1149    'skip$
1150    { format.date "year" output.check }
1151  if$
1152  % We don't need to output the URL details ('lastchecked' and 'url'),
1153  % because fin.entry does that for us, using output.web.refs.  The only
1154  % reason we would want to put them here is if we were to decide that
1155  % they should go in front of the rather miscellaneous information in 'note'.
1156  new.block
1157  note output
1158  fin.entry
1159}
1160
1161FUNCTION {article}
1162{ output.bibitem
1163  format.authors "author" output.check
1164  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1165  format.title "title" output.check
1166  crossref missing$
1167    { journal
1168      "journal" output.check
1169      % add.blank
1170  before.all 'output.state :=
1171      format.vol.num.pages output
1172    }
1173    { format.article.crossref output.nonnull
1174      format.pages output
1175    }
1176  if$
1177  format.journal.pages
1178  format.note output
1179  fin.entry
1180  write.url
1181}
1182
1183FUNCTION {book}
1184{ output.bibitem
1185  author empty$
1186    { format.editors "author and editor" output.check
1187    }
1188    { format.authors output.nonnull
1189      crossref missing$
1190        { "author and editor" editor either.or.check }
1191        'skip$
1192      if$
1193    }
1194  if$
1195  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1196  format.btitle "title" output.check
1197  crossref missing$
1198    { format.edition output
1199      format.bvolume output
1200      format.number.series output
1201      format.publisher.address output
1202    }
1203    {
1204      format.book.crossref output.nonnull
1205    }
1206  if$
1207  format.note output
1208  fin.entry
1209  write.url
1210}
1211
1212FUNCTION {booklet}
1213{ output.bibitem
1214  format.authors output
1215  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1216  format.title "title" output.check
1217  howpublished output
1218  address output
1219  format.note output
1220  format.date output
1221  fin.entry
1222  write.url
1223}
1224
1225FUNCTION {inbook}
1226{ output.bibitem
1227  author empty$
1228    { format.editors "author and editor" output.check
1229    }
1230    { format.authors output.nonnull
1231      crossref missing$
1232        { "author and editor" editor either.or.check }
1233        'skip$
1234      if$
1235    }
1236  if$
1237  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1238  format.btitle "title" output.check
1239  crossref missing$
1240    {
1241      format.edition output
1242      format.bvolume output
1243      format.number.series output
1244      format.publisher.address output
1245      format.chapter.pages "chapter and pages" output.check
1246    }
1247    {
1248      format.chapter.pages "chapter and pages" output.check
1249      format.book.crossref output.nonnull
1250    }
1251  if$
1252  format.pages "pages" output.check
1253  format.note output
1254  fin.entry
1255  write.url
1256}
1257
1258FUNCTION {incollection}
1259{ output.bibitem
1260  format.authors "author" output.check
1261  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1262  format.title "title" output.check
1263  crossref missing$
1264    { format.in.ed.booktitle "booktitle" output.check
1265      format.edition output
1266      format.bvolume output
1267      format.number.series output
1268      format.publisher.address output
1269      format.chapter.pages output
1270    }
1271    { format.incoll.inproc.crossref output.nonnull
1272      format.chapter.pages output
1273    }
1274  if$
1275  format.pages "pages" output.check
1276  format.note output
1277  fin.entry
1278  write.url
1279}
1280
1281FUNCTION {inproceedings}
1282{ output.bibitem
1283  format.authors "author" output.check
1284  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1285  format.title "title" output.check
1286  crossref missing$
1287    { format.in.ed.booktitle "booktitle" output.check
1288      format.edition output
1289      format.bvolume output
1290      format.number.series output
1291      publisher empty$
1292        { format.organization.address output }
1293        { organization output
1294          format.publisher.address output
1295        }
1296      if$
1297    }
1298    { format.incoll.inproc.crossref output.nonnull
1299    }
1300  if$
1301  format.pages "pages" output.check
1302  format.note output
1303  fin.entry
1304  write.url
1305}
1306
1307FUNCTION {conference} { inproceedings }
1308
1309FUNCTION {manual}
1310{ output.bibitem
1311  author empty$
1312    { organization empty$
1313        'skip$
1314        { organization output.nonnull
1315          address output
1316        }
1317      if$
1318    }
1319    { format.authors output.nonnull }
1320  if$
1321  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1322  format.btitle "title" output.check
1323  author empty$
1324    { organization empty$
1325    {
1326          address output
1327        }
1328        'skip$
1329      if$
1330    }
1331    {
1332      organization output
1333      address output
1334    }
1335  if$
1336  format.edition output
1337  format.note output
1338  format.date output
1339  fin.entry
1340  write.url
1341}
1342
1343FUNCTION {mastersthesis}
1344{ output.bibitem
1345  format.authors "author" output.check
1346  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1347  format.title "title" output.check
1348  bbl.mthesis format.thesis.type output.nonnull
1349  school "school" output.check
1350  address output
1351  format.note output
1352  format.date "year" output.check
1353  fin.entry
1354  write.url
1355}
1356
1357FUNCTION {misc}
1358{ output.bibitem
1359  format.authors output
1360  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1361  format.title output
1362  howpublished output
1363  format.note output
1364  format.date output
1365  fin.entry
1366  write.url
1367  empty.misc.check
1368}
1369
1370FUNCTION {phdthesis}
1371{ output.bibitem
1372  format.authors "author" output.check
1373  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1374  format.title "title" output.check
1375  bbl.phdthesis format.thesis.type output.nonnull
1376  school "school" output.check
1377  address output
1378  format.note output
1379  format.date "year" output.check
1380  fin.entry
1381  write.url
1382}
1383
1384FUNCTION {proceedings}
1385{ output.bibitem
1386  editor empty$
1387    { organization output }
1388    { format.editors output.nonnull }
1389  if$
1390  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1391  format.btitle "title" output.check
1392  format.bvolume output
1393  format.number.series output
1394  editor empty$
1395    { publisher empty$
1396        'skip$
1397        {
1398          format.publisher.address output
1399        }
1400      if$
1401    }
1402    { publisher empty$
1403        {
1404          format.organization.address output }
1405        {
1406          organization output
1407          format.publisher.address output
1408        }
1409      if$
1410     }
1411  if$
1412  format.note output
1413  fin.entry
1414  write.url
1415}
1416
1417FUNCTION {techreport}
1418{ output.bibitem
1419  format.authors "author" output.check
1420  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1421  format.title "title" output.check
1422  format.tr.number output.nonnull
1423  institution "institution" output.check
1424  address output
1425  format.note output
1426  format.date "year" output.check
1427  fin.entry
1428  write.url
1429}
1430
1431FUNCTION {unpublished}
1432{ output.bibitem
1433  format.authors "author" output.check
1434  title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
1435  format.title "title" output.check
1436  format.note "note" output.check
1437  format.date output
1438  fin.entry
1439  write.url
1440}
1441
1442FUNCTION {default.type} { misc }
1443
1444READ
1445
1446STRINGS { longest.label }
1447
1448INTEGERS { number.label longest.label.width }
1449
1450FUNCTION {initialize.longest.label}
1451{ "" 'longest.label :=
1452  #1 'number.label :=
1453  #0 'longest.label.width :=
1454}
1455
1456FUNCTION {longest.label.pass}
1457{ number.label int.to.str$ 'label :=
1458  number.label #1 + 'number.label :=
1459  label width$ longest.label.width >
1460    { label 'longest.label :=
1461      label width$ 'longest.label.width :=
1462    }
1463    'skip$
1464  if$
1465}
1466
1467EXECUTE {initialize.longest.label}
1468
1469ITERATE {longest.label.pass}
1470
1471FUNCTION {begin.bib}
1472{ preamble$ empty$
1473    'skip$
1474    { preamble$ write$ newline$ }
1475  if$
1476  "\begin{thebibliography}{"  longest.label  * "}" *
1477  write$ newline$
1478  "\expandafter\ifx\csname url\endcsname\relax"
1479  write$ newline$
1480  "  \def\url#1{\texttt{#1}}\fi"
1481  write$ newline$
1482  "\expandafter\ifx\csname urlprefix\endcsname\relax\def\urlprefix{URL }\fi"
1483  write$ newline$
1484  "\expandafter\ifx\csname href\endcsname\relax"
1485  write$ newline$
1486  "  \def\href#1#2{#2} \def\path#1{#1}\fi"
1487  write$ newline$
1488}
1489
1490EXECUTE {begin.bib}
1491
1492EXECUTE {init.urlbst.variables}
1493EXECUTE {init.state.consts}
1494
1495ITERATE {call.type$}
1496
1497FUNCTION {end.bib}
1498{ newline$
1499  "\end{thebibliography}" write$ newline$
1500}
1501
1502EXECUTE {end.bib}
1503%% End of customized bst file
1504%%
1505%% End of file `elsarticle-num.bst'.
1506
1507
Note: See TracBrowser for help on using the repository browser.