git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/bsseq@67929 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,1307 @@ |
1 |
+%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/unsrt.bst |
|
2 |
+%%% ... by urlbst, version 0.7 (marked with "% urlbst") |
|
3 |
+%%% See <http://purl.org/nxg/dist/urlbst> |
|
4 |
+%%% Added webpage entry type, and url and lastchecked fields. |
|
5 |
+%%% Added eprint support. |
|
6 |
+%%% Added DOI support. |
|
7 |
+%%% Added PUBMED support. |
|
8 |
+%%% Added hyperref support. |
|
9 |
+%%% Original headers follow... |
|
10 |
+ |
|
11 |
+% BibTeX standard bibliography style `unsrt' |
|
12 |
+ % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. |
|
13 |
+ % Copyright (C) 1985, all rights reserved. |
|
14 |
+ % Copying of this file is authorized only if either |
|
15 |
+ % (1) you make absolutely no changes to your copy, including name, or |
|
16 |
+ % (2) if you do make changes, you name it something other than |
|
17 |
+ % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst. |
|
18 |
+ % This restriction helps ensure that all standard styles are identical. |
|
19 |
+ % The file btxbst.doc has the documentation for this style. |
|
20 |
+ |
|
21 |
+ENTRY |
|
22 |
+ { address |
|
23 |
+ author |
|
24 |
+ booktitle |
|
25 |
+ chapter |
|
26 |
+ edition |
|
27 |
+ editor |
|
28 |
+ howpublished |
|
29 |
+ institution |
|
30 |
+ journal |
|
31 |
+ key |
|
32 |
+ month |
|
33 |
+ note |
|
34 |
+ number |
|
35 |
+ organization |
|
36 |
+ pages |
|
37 |
+ publisher |
|
38 |
+ school |
|
39 |
+ series |
|
40 |
+ title |
|
41 |
+ type |
|
42 |
+ volume |
|
43 |
+ year |
|
44 |
+ eprint % urlbst |
|
45 |
+ doi % urlbst |
|
46 |
+ pubmed % urlbst |
|
47 |
+ url % urlbst |
|
48 |
+ lastchecked % urlbst |
|
49 |
+ } |
|
50 |
+ {} |
|
51 |
+ { label } |
|
52 |
+ |
|
53 |
+INTEGERS { output.state before.all mid.sentence after.sentence after.block } |
|
54 |
+ |
|
55 |
+% urlbst... |
|
56 |
+% urlbst constants and state variables |
|
57 |
+STRINGS { urlintro |
|
58 |
+ eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl |
|
59 |
+ citedstring onlinestring linktextstring |
|
60 |
+ openinlinelink closeinlinelink } |
|
61 |
+INTEGERS { hrefform inlinelinks makeinlinelink |
|
62 |
+ addeprints adddoiresolver addpubmedresolver } |
|
63 |
+FUNCTION {init.urlbst.variables} |
|
64 |
+{ |
|
65 |
+ % The following constants may be adjusted by hand, if desired |
|
66 |
+ |
|
67 |
+ % The first set allow you to enable or disable certain functionality. |
|
68 |
+ #1 'addeprints := % 0=no eprints; 1=include eprints |
|
69 |
+ #1 'adddoiresolver := % 0=no DOI resolver; 1=include it |
|
70 |
+ #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it |
|
71 |
+ #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs |
|
72 |
+ #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles |
|
73 |
+ |
|
74 |
+ % String constants, which you _might_ want to tweak. |
|
75 |
+ "URL: " 'urlintro := % prefix before URL; typically "Available from:" or "URL": |
|
76 |
+ "online" 'onlinestring := % indication that resource is online; typically "online" |
|
77 |
+ "cited " 'citedstring := % indicator of citation date; typically "cited " |
|
78 |
+ "[link]" 'linktextstring := % dummy link text; typically "[link]" |
|
79 |
+ "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref |
|
80 |
+ "arXiv:" 'eprintprefix := % text prefix printed before eprint ref; typically "arXiv:" |
|
81 |
+ "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI |
|
82 |
+ "doi:" 'doiprefix := % text prefix printed before DOI ref; typically "doi:" |
|
83 |
+ "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED |
|
84 |
+ "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref; typically "PMID:" |
|
85 |
+ |
|
86 |
+ % The following are internal state variables, not configuration constants, |
|
87 |
+ % so they shouldn't be fiddled with. |
|
88 |
+ #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink |
|
89 |
+ "" 'openinlinelink := % ditto |
|
90 |
+ "" 'closeinlinelink := % ditto |
|
91 |
+} |
|
92 |
+INTEGERS { |
|
93 |
+ bracket.state |
|
94 |
+ outside.brackets |
|
95 |
+ open.brackets |
|
96 |
+ within.brackets |
|
97 |
+ close.brackets |
|
98 |
+} |
|
99 |
+% ...urlbst to here |
|
100 |
+FUNCTION {init.state.consts} |
|
101 |
+{ #0 'outside.brackets := % urlbst... |
|
102 |
+ #1 'open.brackets := |
|
103 |
+ #2 'within.brackets := |
|
104 |
+ #3 'close.brackets := % ...urlbst to here |
|
105 |
+ |
|
106 |
+ #0 'before.all := |
|
107 |
+ #1 'mid.sentence := |
|
108 |
+ #2 'after.sentence := |
|
109 |
+ #3 'after.block := |
|
110 |
+} |
|
111 |
+ |
|
112 |
+STRINGS { s t } |
|
113 |
+ |
|
114 |
+% urlbst |
|
115 |
+FUNCTION {output.nonnull.original} |
|
116 |
+{ 's := |
|
117 |
+ output.state mid.sentence = |
|
118 |
+ { ", " * write$ } |
|
119 |
+ { output.state after.block = |
|
120 |
+ { add.period$ write$ |
|
121 |
+ newline$ |
|
122 |
+ "\newblock " write$ |
|
123 |
+ } |
|
124 |
+ { output.state before.all = |
|
125 |
+ 'write$ |
|
126 |
+ { add.period$ " " * write$ } |
|
127 |
+ if$ |
|
128 |
+ } |
|
129 |
+ if$ |
|
130 |
+ mid.sentence 'output.state := |
|
131 |
+ } |
|
132 |
+ if$ |
|
133 |
+ s |
|
134 |
+} |
|
135 |
+ |
|
136 |
+% urlbst... |
|
137 |
+% The following three functions are for handling inlinelink. They wrap |
|
138 |
+% a block of text which is potentially output with write$ by multiple |
|
139 |
+% other functions, so we don't know the content a priori. |
|
140 |
+% They communicate between each other using the variables makeinlinelink |
|
141 |
+% (which is true if a link should be made), and closeinlinelink (which holds |
|
142 |
+% the string which should close any current link. They can be called |
|
143 |
+% at any time, but start.inlinelink will be a no-op unless something has |
|
144 |
+% previously set makeinlinelink true, and the two ...end.inlinelink functions |
|
145 |
+% will only do their stuff if start.inlinelink has previously set |
|
146 |
+% closeinlinelink to be non-empty. |
|
147 |
+% (thanks to 'ijvm' for suggested code here) |
|
148 |
+FUNCTION {uand} |
|
149 |
+{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) |
|
150 |
+FUNCTION {possibly.setup.inlinelink} |
|
151 |
+{ makeinlinelink hrefform #0 > uand |
|
152 |
+ { doi empty$ adddoiresolver uand |
|
153 |
+ { pubmed empty$ addpubmedresolver uand |
|
154 |
+ { eprint empty$ addeprints uand |
|
155 |
+ { url empty$ |
|
156 |
+ { "" } |
|
157 |
+ { url } |
|
158 |
+ if$ } |
|
159 |
+ { eprinturl eprint * } |
|
160 |
+ if$ } |
|
161 |
+ { pubmedurl pubmed * } |
|
162 |
+ if$ } |
|
163 |
+ { doiurl doi * } |
|
164 |
+ if$ |
|
165 |
+ % an appropriately-formatted URL is now on the stack |
|
166 |
+ hrefform #1 = % hypertex |
|
167 |
+ { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink := |
|
168 |
+ "\special {html:</a>}" 'closeinlinelink := } |
|
169 |
+ { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref |
|
170 |
+ % the space between "} {" matters: a URL of just the right length can cause "\% newline em" |
|
171 |
+ "}" 'closeinlinelink := } |
|
172 |
+ if$ |
|
173 |
+ #0 'makeinlinelink := |
|
174 |
+ } |
|
175 |
+ 'skip$ |
|
176 |
+ if$ % makeinlinelink |
|
177 |
+} |
|
178 |
+FUNCTION {add.inlinelink} |
|
179 |
+{ openinlinelink empty$ |
|
180 |
+ 'skip$ |
|
181 |
+ { openinlinelink swap$ * closeinlinelink * |
|
182 |
+ "" 'openinlinelink := |
|
183 |
+ } |
|
184 |
+ if$ |
|
185 |
+} |
|
186 |
+FUNCTION {output.nonnull} |
|
187 |
+{ % Save the thing we've been asked to output |
|
188 |
+ 's := |
|
189 |
+ % If the bracket-state is close.brackets, then add a close-bracket to |
|
190 |
+ % what is currently at the top of the stack, and set bracket.state |
|
191 |
+ % to outside.brackets |
|
192 |
+ bracket.state close.brackets = |
|
193 |
+ { "]" * |
|
194 |
+ outside.brackets 'bracket.state := |
|
195 |
+ } |
|
196 |
+ 'skip$ |
|
197 |
+ if$ |
|
198 |
+ bracket.state outside.brackets = |
|
199 |
+ { % We're outside all brackets -- this is the normal situation. |
|
200 |
+ % Write out what's currently at the top of the stack, using the |
|
201 |
+ % original output.nonnull function. |
|
202 |
+ s |
|
203 |
+ add.inlinelink |
|
204 |
+ output.nonnull.original % invoke the original output.nonnull |
|
205 |
+ } |
|
206 |
+ { % Still in brackets. Add open-bracket or (continuation) comma, add the |
|
207 |
+ % new text (in s) to the top of the stack, and move to the close-brackets |
|
208 |
+ % state, ready for next time (unless inbrackets resets it). If we come |
|
209 |
+ % into this branch, then output.state is carefully undisturbed. |
|
210 |
+ bracket.state open.brackets = |
|
211 |
+ { " [" * } |
|
212 |
+ { ", " * } % bracket.state will be within.brackets |
|
213 |
+ if$ |
|
214 |
+ s * |
|
215 |
+ close.brackets 'bracket.state := |
|
216 |
+ } |
|
217 |
+ if$ |
|
218 |
+} |
|
219 |
+ |
|
220 |
+% Call this function just before adding something which should be presented in |
|
221 |
+% brackets. bracket.state is handled specially within output.nonnull. |
|
222 |
+FUNCTION {inbrackets} |
|
223 |
+{ bracket.state close.brackets = |
|
224 |
+ { within.brackets 'bracket.state := } % reset the state: not open nor closed |
|
225 |
+ { open.brackets 'bracket.state := } |
|
226 |
+ if$ |
|
227 |
+} |
|
228 |
+ |
|
229 |
+FUNCTION {format.lastchecked} |
|
230 |
+{ lastchecked empty$ |
|
231 |
+ { "" } |
|
232 |
+ { inbrackets citedstring lastchecked * } |
|
233 |
+ if$ |
|
234 |
+} |
|
235 |
+% ...urlbst to here |
|
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.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) |
|
253 |
+{ newline$ |
|
254 |
+ "\bibitem{" write$ |
|
255 |
+ cite$ write$ |
|
256 |
+ "}" write$ |
|
257 |
+ newline$ |
|
258 |
+ "" |
|
259 |
+ before.all 'output.state := |
|
260 |
+} |
|
261 |
+ |
|
262 |
+FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) |
|
263 |
+{ add.period$ |
|
264 |
+ write$ |
|
265 |
+ newline$ |
|
266 |
+} |
|
267 |
+ |
|
268 |
+FUNCTION {new.block} |
|
269 |
+{ output.state before.all = |
|
270 |
+ 'skip$ |
|
271 |
+ { after.block 'output.state := } |
|
272 |
+ if$ |
|
273 |
+} |
|
274 |
+ |
|
275 |
+FUNCTION {new.sentence} |
|
276 |
+{ output.state after.block = |
|
277 |
+ 'skip$ |
|
278 |
+ { output.state before.all = |
|
279 |
+ 'skip$ |
|
280 |
+ { after.sentence 'output.state := } |
|
281 |
+ if$ |
|
282 |
+ } |
|
283 |
+ if$ |
|
284 |
+} |
|
285 |
+ |
|
286 |
+FUNCTION {not} |
|
287 |
+{ { #0 } |
|
288 |
+ { #1 } |
|
289 |
+ if$ |
|
290 |
+} |
|
291 |
+ |
|
292 |
+FUNCTION {and} |
|
293 |
+{ 'skip$ |
|
294 |
+ { pop$ #0 } |
|
295 |
+ if$ |
|
296 |
+} |
|
297 |
+ |
|
298 |
+FUNCTION {or} |
|
299 |
+{ { pop$ #1 } |
|
300 |
+ 'skip$ |
|
301 |
+ if$ |
|
302 |
+} |
|
303 |
+ |
|
304 |
+FUNCTION {new.block.checka} |
|
305 |
+{ empty$ |
|
306 |
+ 'skip$ |
|
307 |
+ 'new.block |
|
308 |
+ if$ |
|
309 |
+} |
|
310 |
+ |
|
311 |
+FUNCTION {new.block.checkb} |
|
312 |
+{ empty$ |
|
313 |
+ swap$ empty$ |
|
314 |
+ and |
|
315 |
+ 'skip$ |
|
316 |
+ 'new.block |
|
317 |
+ if$ |
|
318 |
+} |
|
319 |
+ |
|
320 |
+FUNCTION {new.sentence.checka} |
|
321 |
+{ empty$ |
|
322 |
+ 'skip$ |
|
323 |
+ 'new.sentence |
|
324 |
+ if$ |
|
325 |
+} |
|
326 |
+ |
|
327 |
+FUNCTION {new.sentence.checkb} |
|
328 |
+{ empty$ |
|
329 |
+ swap$ empty$ |
|
330 |
+ and |
|
331 |
+ 'skip$ |
|
332 |
+ 'new.sentence |
|
333 |
+ if$ |
|
334 |
+} |
|
335 |
+ |
|
336 |
+FUNCTION {field.or.null} |
|
337 |
+{ duplicate$ empty$ |
|
338 |
+ { pop$ "" } |
|
339 |
+ 'skip$ |
|
340 |
+ if$ |
|
341 |
+} |
|
342 |
+ |
|
343 |
+FUNCTION {emphasize} |
|
344 |
+{ duplicate$ empty$ |
|
345 |
+ { pop$ "" } |
|
346 |
+ { "{\em " swap$ * "}" * } |
|
347 |
+ if$ |
|
348 |
+} |
|
349 |
+ |
|
350 |
+INTEGERS { nameptr namesleft numnames } |
|
351 |
+ |
|
352 |
+FUNCTION {format.names} |
|
353 |
+{ 's := |
|
354 |
+ #1 'nameptr := |
|
355 |
+ s num.names$ 'numnames := |
|
356 |
+ numnames 'namesleft := |
|
357 |
+ { namesleft #0 > } |
|
358 |
+ { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := |
|
359 |
+ nameptr #1 > |
|
360 |
+ { namesleft #1 > |
|
361 |
+ { ", " * t * } |
|
362 |
+ { numnames #2 > |
|
363 |
+ { "," * } |
|
364 |
+ 'skip$ |
|
365 |
+ if$ |
|
366 |
+ t "others" = |
|
367 |
+ { " et~al." * } |
|
368 |
+ { " and " * t * } |
|
369 |
+ if$ |
|
370 |
+ } |
|
371 |
+ if$ |
|
372 |
+ } |
|
373 |
+ 't |
|
374 |
+ if$ |
|
375 |
+ nameptr #1 + 'nameptr := |
|
376 |
+ namesleft #1 - 'namesleft := |
|
377 |
+ } |
|
378 |
+ while$ |
|
379 |
+} |
|
380 |
+ |
|
381 |
+FUNCTION {format.authors} |
|
382 |
+{ author empty$ |
|
383 |
+ { "" } |
|
384 |
+ { author format.names } |
|
385 |
+ if$ |
|
386 |
+} |
|
387 |
+ |
|
388 |
+FUNCTION {format.editors} |
|
389 |
+{ editor empty$ |
|
390 |
+ { "" } |
|
391 |
+ { editor format.names |
|
392 |
+ editor num.names$ #1 > |
|
393 |
+ { ", editors" * } |
|
394 |
+ { ", editor" * } |
|
395 |
+ if$ |
|
396 |
+ } |
|
397 |
+ if$ |
|
398 |
+} |
|
399 |
+ |
|
400 |
+FUNCTION {format.title} |
|
401 |
+{ title empty$ |
|
402 |
+ { "" } |
|
403 |
+ { title "t" change.case$ } |
|
404 |
+ if$ |
|
405 |
+} |
|
406 |
+ |
|
407 |
+FUNCTION {n.dashify} |
|
408 |
+{ 't := |
|
409 |
+ "" |
|
410 |
+ { t empty$ not } |
|
411 |
+ { t #1 #1 substring$ "-" = |
|
412 |
+ { t #1 #2 substring$ "--" = not |
|
413 |
+ { "--" * |
|
414 |
+ t #2 global.max$ substring$ 't := |
|
415 |
+ } |
|
416 |
+ { { t #1 #1 substring$ "-" = } |
|
417 |
+ { "-" * |
|
418 |
+ t #2 global.max$ substring$ 't := |
|
419 |
+ } |
|
420 |
+ while$ |
|
421 |
+ } |
|
422 |
+ if$ |
|
423 |
+ } |
|
424 |
+ { t #1 #1 substring$ * |
|
425 |
+ t #2 global.max$ substring$ 't := |
|
426 |
+ } |
|
427 |
+ if$ |
|
428 |
+ } |
|
429 |
+ while$ |
|
430 |
+} |
|
431 |
+ |
|
432 |
+FUNCTION {format.date} |
|
433 |
+{ year empty$ |
|
434 |
+ { month empty$ |
|
435 |
+ { "" } |
|
436 |
+ { "there's a month but no year in " cite$ * warning$ |
|
437 |
+ month |
|
438 |
+ } |
|
439 |
+ if$ |
|
440 |
+ } |
|
441 |
+ { month empty$ |
|
442 |
+ 'year |
|
443 |
+ { month " " * year * } |
|
444 |
+ if$ |
|
445 |
+ } |
|
446 |
+ if$ |
|
447 |
+} |
|
448 |
+ |
|
449 |
+FUNCTION {format.btitle} |
|
450 |
+{ title emphasize |
|
451 |
+} |
|
452 |
+ |
|
453 |
+FUNCTION {tie.or.space.connect} |
|
454 |
+{ duplicate$ text.length$ #3 < |
|
455 |
+ { "~" } |
|
456 |
+ { " " } |
|
457 |
+ if$ |
|
458 |
+ swap$ * * |
|
459 |
+} |
|
460 |
+ |
|
461 |
+FUNCTION {either.or.check} |
|
462 |
+{ empty$ |
|
463 |
+ 'pop$ |
|
464 |
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ } |
|
465 |
+ if$ |
|
466 |
+} |
|
467 |
+ |
|
468 |
+FUNCTION {format.bvolume} |
|
469 |
+{ volume empty$ |
|
470 |
+ { "" } |
|
471 |
+ { "volume" volume tie.or.space.connect |
|
472 |
+ series empty$ |
|
473 |
+ 'skip$ |
|
474 |
+ { " of " * series emphasize * } |
|
475 |
+ if$ |
|
476 |
+ "volume and number" number either.or.check |
|
477 |
+ } |
|
478 |
+ if$ |
|
479 |
+} |
|
480 |
+ |
|
481 |
+FUNCTION {format.number.series} |
|
482 |
+{ volume empty$ |
|
483 |
+ { number empty$ |
|
484 |
+ { series field.or.null } |
|
485 |
+ { output.state mid.sentence = |
|
486 |
+ { "number" } |
|
487 |
+ { "Number" } |
|
488 |
+ if$ |
|
489 |
+ number tie.or.space.connect |
|
490 |
+ series empty$ |
|
491 |
+ { "there's a number but no series in " cite$ * warning$ } |
|
492 |
+ { " in " * series * } |
|
493 |
+ if$ |
|
494 |
+ } |
|
495 |
+ if$ |
|
496 |
+ } |
|
497 |
+ { "" } |
|
498 |
+ if$ |
|
499 |
+} |
|
500 |
+ |
|
501 |
+FUNCTION {format.edition} |
|
502 |
+{ edition empty$ |
|
503 |
+ { "" } |
|
504 |
+ { output.state mid.sentence = |
|
505 |
+ { edition "l" change.case$ " edition" * } |
|
506 |
+ { edition "t" change.case$ " edition" * } |
|
507 |
+ if$ |
|
508 |
+ } |
|
509 |
+ if$ |
|
510 |
+} |
|
511 |
+ |
|
512 |
+INTEGERS { multiresult } |
|
513 |
+ |
|
514 |
+FUNCTION {multi.page.check} |
|
515 |
+{ 't := |
|
516 |
+ #0 'multiresult := |
|
517 |
+ { multiresult not |
|
518 |
+ t empty$ not |
|
519 |
+ and |
|
520 |
+ } |
|
521 |
+ { t #1 #1 substring$ |
|
522 |
+ duplicate$ "-" = |
|
523 |
+ swap$ duplicate$ "," = |
|
524 |
+ swap$ "+" = |
|
525 |
+ or or |
|
526 |
+ { #1 'multiresult := } |
|
527 |
+ { t #2 global.max$ substring$ 't := } |
|
528 |
+ if$ |
|
529 |
+ } |
|
530 |
+ while$ |
|
531 |
+ multiresult |
|
532 |
+} |
|
533 |
+ |
|
534 |
+FUNCTION {format.pages} |
|
535 |
+{ pages empty$ |
|
536 |
+ { "" } |
|
537 |
+ { pages multi.page.check |
|
538 |
+ { "pages" pages n.dashify tie.or.space.connect } |
|
539 |
+ { "page" pages tie.or.space.connect } |
|
540 |
+ if$ |
|
541 |
+ } |
|
542 |
+ if$ |
|
543 |
+} |
|
544 |
+ |
|
545 |
+FUNCTION {format.vol.num.pages} |
|
546 |
+{ volume field.or.null |
|
547 |
+ number empty$ |
|
548 |
+ 'skip$ |
|
549 |
+ { "(" number * ")" * * |
|
550 |
+ volume empty$ |
|
551 |
+ { "there's a number but no volume in " cite$ * warning$ } |
|
552 |
+ 'skip$ |
|
553 |
+ if$ |
|
554 |
+ } |
|
555 |
+ if$ |
|
556 |
+ pages empty$ |
|
557 |
+ 'skip$ |
|
558 |
+ { duplicate$ empty$ |
|
559 |
+ { pop$ format.pages } |
|
560 |
+ { ":" * pages n.dashify * } |
|
561 |
+ if$ |
|
562 |
+ } |
|
563 |
+ if$ |
|
564 |
+} |
|
565 |
+ |
|
566 |
+FUNCTION {format.chapter.pages} |
|
567 |
+{ chapter empty$ |
|
568 |
+ 'format.pages |
|
569 |
+ { type empty$ |
|
570 |
+ { "chapter" } |
|
571 |
+ { type "l" change.case$ } |
|
572 |
+ if$ |
|
573 |
+ chapter tie.or.space.connect |
|
574 |
+ pages empty$ |
|
575 |
+ 'skip$ |
|
576 |
+ { ", " * format.pages * } |
|
577 |
+ if$ |
|
578 |
+ } |
|
579 |
+ if$ |
|
580 |
+} |
|
581 |
+ |
|
582 |
+FUNCTION {format.in.ed.booktitle} |
|
583 |
+{ booktitle empty$ |
|
584 |
+ { "" } |
|
585 |
+ { editor empty$ |
|
586 |
+ { "In " booktitle emphasize * } |
|
587 |
+ { "In " format.editors * ", " * booktitle emphasize * } |
|
588 |
+ if$ |
|
589 |
+ } |
|
590 |
+ if$ |
|
591 |
+} |
|
592 |
+ |
|
593 |
+FUNCTION {empty.misc.check} |
|
594 |
+{ author empty$ title empty$ howpublished empty$ |
|
595 |
+ month empty$ year empty$ note empty$ |
|
596 |
+ and and and and and |
|
597 |
+ { "all relevant fields are empty in " cite$ * warning$ } |
|
598 |
+ 'skip$ |
|
599 |
+ if$ |
|
600 |
+} |
|
601 |
+ |
|
602 |
+FUNCTION {format.thesis.type} |
|
603 |
+{ type empty$ |
|
604 |
+ 'skip$ |
|
605 |
+ { pop$ |
|
606 |
+ type "t" change.case$ |
|
607 |
+ } |
|
608 |
+ if$ |
|
609 |
+} |
|
610 |
+ |
|
611 |
+FUNCTION {format.tr.number} |
|
612 |
+{ type empty$ |
|
613 |
+ { "Technical Report" } |
|
614 |
+ 'type |
|
615 |
+ if$ |
|
616 |
+ number empty$ |
|
617 |
+ { "t" change.case$ } |
|
618 |
+ { number tie.or.space.connect } |
|
619 |
+ if$ |
|
620 |
+} |
|
621 |
+ |
|
622 |
+FUNCTION {format.article.crossref} |
|
623 |
+{ key empty$ |
|
624 |
+ { journal empty$ |
|
625 |
+ { "need key or journal for " cite$ * " to crossref " * crossref * |
|
626 |
+ warning$ |
|
627 |
+ "" |
|
628 |
+ } |
|
629 |
+ { "In {\em " journal * "\/}" * } |
|
630 |
+ if$ |
|
631 |
+ } |
|
632 |
+ { "In " key * } |
|
633 |
+ if$ |
|
634 |
+ " \cite{" * crossref * "}" * |
|
635 |
+} |
|
636 |
+ |
|
637 |
+FUNCTION {format.crossref.editor} |
|
638 |
+{ editor #1 "{vv~}{ll}" format.name$ |
|
639 |
+ editor num.names$ duplicate$ |
|
640 |
+ #2 > |
|
641 |
+ { pop$ " et~al." * } |
|
642 |
+ { #2 < |
|
643 |
+ 'skip$ |
|
644 |
+ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = |
|
645 |
+ { " et~al." * } |
|
646 |
+ { " and " * editor #2 "{vv~}{ll}" format.name$ * } |
|
647 |
+ if$ |
|
648 |
+ } |
|
649 |
+ if$ |
|
650 |
+ } |
|
651 |
+ if$ |
|
652 |
+} |
|
653 |
+ |
|
654 |
+FUNCTION {format.book.crossref} |
|
655 |
+{ volume empty$ |
|
656 |
+ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ |
|
657 |
+ "In " |
|
658 |
+ } |
|
659 |
+ { "Volume" volume tie.or.space.connect |
|
660 |
+ " of " * |
|
661 |
+ } |
|
662 |
+ if$ |
|
663 |
+ editor empty$ |
|
664 |
+ editor field.or.null author field.or.null = |
|
665 |
+ or |
|
666 |
+ { key empty$ |
|
667 |
+ { series empty$ |
|
668 |
+ { "need editor, key, or series for " cite$ * " to crossref " * |
|
669 |
+ crossref * warning$ |
|
670 |
+ "" * |
|
671 |
+ } |
|
672 |
+ { "{\em " * series * "\/}" * } |
|
673 |
+ if$ |
|
674 |
+ } |
|
675 |
+ { key * } |
|
676 |
+ if$ |
|
677 |
+ } |
|
678 |
+ { format.crossref.editor * } |
|
679 |
+ if$ |
|
680 |
+ " \cite{" * crossref * "}" * |
|
681 |
+} |
|
682 |
+ |
|
683 |
+FUNCTION {format.incoll.inproc.crossref} |
|
684 |
+{ editor empty$ |
|
685 |
+ editor field.or.null author field.or.null = |
|
686 |
+ or |
|
687 |
+ { key empty$ |
|
688 |
+ { booktitle empty$ |
|
689 |
+ { "need editor, key, or booktitle for " cite$ * " to crossref " * |
|
690 |
+ crossref * warning$ |
|
691 |
+ "" |
|
692 |
+ } |
|
693 |
+ { "In {\em " booktitle * "\/}" * } |
|
694 |
+ if$ |
|
695 |
+ } |
|
696 |
+ { "In " key * } |
|
697 |
+ if$ |
|
698 |
+ } |
|
699 |
+ { "In " format.crossref.editor * } |
|
700 |
+ if$ |
|
701 |
+ " \cite{" * crossref * "}" * |
|
702 |
+} |
|
703 |
+ |
|
704 |
+% urlbst... |
|
705 |
+% Functions for making hypertext links. |
|
706 |
+% In all cases, the stack has (link-text href-url) |
|
707 |
+% |
|
708 |
+% make 'null' specials |
|
709 |
+FUNCTION {make.href.null} |
|
710 |
+{ |
|
711 |
+ pop$ |
|
712 |
+} |
|
713 |
+% make hypertex specials |
|
714 |
+FUNCTION {make.href.hypertex} |
|
715 |
+{ |
|
716 |
+ "\special {html:<a href=" quote$ * |
|
717 |
+ swap$ * quote$ * "> }" * swap$ * |
|
718 |
+ "\special {html:</a>}" * |
|
719 |
+} |
|
720 |
+% make hyperref specials |
|
721 |
+FUNCTION {make.href.hyperref} |
|
722 |
+{ |
|
723 |
+ "\href {" swap$ * "} {\path{" * swap$ * "}}" * |
|
724 |
+} |
|
725 |
+FUNCTION {make.href} |
|
726 |
+{ hrefform #2 = |
|
727 |
+ 'make.href.hyperref % hrefform = 2 |
|
728 |
+ { hrefform #1 = |
|
729 |
+ 'make.href.hypertex % hrefform = 1 |
|
730 |
+ 'make.href.null % hrefform = 0 (or anything else) |
|
731 |
+ if$ |
|
732 |
+ } |
|
733 |
+ if$ |
|
734 |
+} |
|
735 |
+ |
|
736 |
+% If inlinelinks is true, then format.url should be a no-op, since it's |
|
737 |
+% (a) redundant, and (b) could end up as a link-within-a-link. |
|
738 |
+FUNCTION {format.url} |
|
739 |
+{ inlinelinks #1 = url empty$ or |
|
740 |
+ { "" } |
|
741 |
+ { hrefform #1 = |
|
742 |
+ { % special case -- add HyperTeX specials |
|
743 |
+ urlintro "\url{" url * "}" * url make.href.hypertex * } |
|
744 |
+ { urlintro "\url{" * url * "}" * } |
|
745 |
+ if$ |
|
746 |
+ } |
|
747 |
+ if$ |
|
748 |
+} |
|
749 |
+ |
|
750 |
+FUNCTION {format.eprint} |
|
751 |
+{ eprint empty$ |
|
752 |
+ { "" } |
|
753 |
+ { eprintprefix eprint * eprinturl eprint * make.href } |
|
754 |
+ if$ |
|
755 |
+} |
|
756 |
+ |
|
757 |
+FUNCTION {format.doi} |
|
758 |
+{ doi empty$ |
|
759 |
+ { "" } |
|
760 |
+ { doiprefix doi * doiurl doi * make.href } |
|
761 |
+ if$ |
|
762 |
+} |
|
763 |
+ |
|
764 |
+FUNCTION {format.pubmed} |
|
765 |
+{ pubmed empty$ |
|
766 |
+ { "" } |
|
767 |
+ { pubmedprefix pubmed * pubmedurl pubmed * make.href } |
|
768 |
+ if$ |
|
769 |
+} |
|
770 |
+ |
|
771 |
+% Output a URL. We can't use the more normal idiom (something like |
|
772 |
+% `format.url output'), because the `inbrackets' within |
|
773 |
+% format.lastchecked applies to everything between calls to `output', |
|
774 |
+% so that `format.url format.lastchecked * output' ends up with both |
|
775 |
+% the URL and the lastchecked in brackets. |
|
776 |
+FUNCTION {output.url} |
|
777 |
+{ url empty$ |
|
778 |
+ 'skip$ |
|
779 |
+ { new.block |
|
780 |
+ format.url output |
|
781 |
+ format.lastchecked output |
|
782 |
+ } |
|
783 |
+ if$ |
|
784 |
+} |
|
785 |
+ |
|
786 |
+FUNCTION {output.web.refs} |
|
787 |
+{ |
|
788 |
+ new.block |
|
789 |
+ inlinelinks |
|
790 |
+ 'skip$ % links were inline -- don't repeat them |
|
791 |
+ { |
|
792 |
+ output.url |
|
793 |
+ addeprints eprint empty$ not and |
|
794 |
+ { format.eprint output.nonnull } |
|
795 |
+ 'skip$ |
|
796 |
+ if$ |
|
797 |
+ adddoiresolver doi empty$ not and |
|
798 |
+ { format.doi output.nonnull } |
|
799 |
+ 'skip$ |
|
800 |
+ if$ |
|
801 |
+ addpubmedresolver pubmed empty$ not and |
|
802 |
+ { format.pubmed output.nonnull } |
|
803 |
+ 'skip$ |
|
804 |
+ if$ |
|
805 |
+ } |
|
806 |
+ if$ |
|
807 |
+} |
|
808 |
+ |
|
809 |
+% Wrapper for output.bibitem.original. |
|
810 |
+% If the URL field is not empty, set makeinlinelink to be true, |
|
811 |
+% so that an inline link will be started at the next opportunity |
|
812 |
+FUNCTION {output.bibitem} |
|
813 |
+{ outside.brackets 'bracket.state := |
|
814 |
+ output.bibitem.original |
|
815 |
+ inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and |
|
816 |
+ { #1 'makeinlinelink := } |
|
817 |
+ { #0 'makeinlinelink := } |
|
818 |
+ if$ |
|
819 |
+} |
|
820 |
+ |
|
821 |
+% Wrapper for fin.entry.original |
|
822 |
+FUNCTION {fin.entry} |
|
823 |
+{ output.web.refs % urlbst |
|
824 |
+ makeinlinelink % ooops, it appears we didn't have a title for inlinelink |
|
825 |
+ { possibly.setup.inlinelink % add some artificial link text here, as a fallback |
|
826 |
+ linktextstring output.nonnull } |
|
827 |
+ 'skip$ |
|
828 |
+ if$ |
|
829 |
+ bracket.state close.brackets = % urlbst |
|
830 |
+ { "]" * } |
|
831 |
+ 'skip$ |
|
832 |
+ if$ |
|
833 |
+ fin.entry.original |
|
834 |
+} |
|
835 |
+ |
|
836 |
+% Webpage entry type. |
|
837 |
+% Title and url fields required; |
|
838 |
+% author, note, year, month, and lastchecked fields optional |
|
839 |
+% See references |
|
840 |
+% ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm |
|
841 |
+% http://www.classroom.net/classroom/CitingNetResources.html |
|
842 |
+% http://neal.ctstateu.edu/history/cite.html |
|
843 |
+% http://www.cas.usf.edu/english/walker/mla.html |
|
844 |
+% for citation formats for web pages. |
|
845 |
+FUNCTION {webpage} |
|
846 |
+{ output.bibitem |
|
847 |
+ author empty$ |
|
848 |
+ { editor empty$ |
|
849 |
+ 'skip$ % author and editor both optional |
|
850 |
+ { format.editors output.nonnull } |
|
851 |
+ if$ |
|
852 |
+ } |
|
853 |
+ { editor empty$ |
|
854 |
+ { format.authors output.nonnull } |
|
855 |
+ { "can't use both author and editor fields in " cite$ * warning$ } |
|
856 |
+ if$ |
|
857 |
+ } |
|
858 |
+ if$ |
|
859 |
+ new.block |
|
860 |
+ title empty$ 'skip$ 'possibly.setup.inlinelink if$ |
|
861 |
+ format.title "title" output.check |
|
862 |
+ inbrackets onlinestring output |
|
863 |
+ new.block |
|
864 |
+ year empty$ |
|
865 |
+ 'skip$ |
|
866 |
+ { format.date "year" output.check } |
|
867 |
+ if$ |
|
868 |
+ % We don't need to output the URL details ('lastchecked' and 'url'), |
|
869 |
+ % because fin.entry does that for us, using output.web.refs. The only |
|
870 |
+ % reason we would want to put them here is if we were to decide that |
|
871 |
+ % they should go in front of the rather miscellaneous information in 'note'. |
|
872 |
+ new.block |
|
873 |
+ note output |
|
874 |
+ fin.entry |
|
875 |
+} |
|
876 |
+% ...urlbst to here |
|
877 |
+ |
|
878 |
+ |
|
879 |
+FUNCTION {article} |
|
880 |
+{ output.bibitem |
|
881 |
+ format.authors "author" output.check |
|
882 |
+ new.block |
|
883 |
+ title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst |
|
884 |
+ format.title "title" output.check |
|
885 |
+ new.block |
|
886 |
+ crossref missing$ |
|
887 |
+ { journal emphasize "journal" output.check |
|
888 |
+ possibly.setup.inlinelink format.vol.num.pages output% urlbst |
|
889 |
+ format.date "year" output.check |
|
890 |
+ } |
|
891 |
+ { format.article.crossref output.nonnull |
|
892 |
+ format.pages output |
|
893 |
+ } |
|
894 |
+ if$ |
|
895 |
+ new.block |
|
896 |
+ note output |
|
897 |
+ fin.entry |
|
898 |
+} |
|
899 |
+ |
|
900 |
+FUNCTION {book} |
|
901 |
+{ output.bibitem |
|
902 |
+ author empty$ |
|
903 |
+ { format.editors "author and editor" output.check } |
|
904 |
+ { format.authors output.nonnull |
|
9 |