diff options
author | Karl Berry <karl@freefriends.org> | 2011-03-09 00:48:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-03-09 00:48:41 +0000 |
commit | e5abb7960d35683e02c220371b77d39148079a77 (patch) | |
tree | ea200eb0788b69c158c0edbd23955317330eed84 /Master/texmf-dist/bibtex | |
parent | fb580c9b1cafa00d5e4040ac1fd6eb17d878a94e (diff) |
urlbst (8mar11)
git-svn-id: svn://tug.org/texlive/trunk@21650 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/bibtex')
-rw-r--r-- | Master/texmf-dist/bibtex/bib/urlbst/urlbst.bib | 217 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst | 152 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst | 152 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst | 152 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst | 152 |
5 files changed, 360 insertions, 465 deletions
diff --git a/Master/texmf-dist/bibtex/bib/urlbst/urlbst.bib b/Master/texmf-dist/bibtex/bib/urlbst/urlbst.bib deleted file mode 100644 index d981b820df0..00000000000 --- a/Master/texmf-dist/bibtex/bib/urlbst/urlbst.bib +++ /dev/null @@ -1,217 +0,0 @@ -% Webpage with lastchecked and date -@webpage{url:weapas, - url = {http://www.beadsland.com/weapas/}, - title = {Web Extension to {American Psychological Association} Style ({WEAPAS}) (Rev.2.0)}, - author = {B Land}, - year = 2001, - month = jul, - lastchecked = {23 October 2002} -} - -@Webpage{apastyle, - url = {http://www.apastyle.org/elecref.html}, - author = {{American Psychological Association}}, - title = {Electronic References}, - year = 2001, - lastchecked = {23 October 2002}, - note = {Excerpted from 5th edition of the APA Publication Manual} -} - -@webpage{url:iso690, - author = {{International Standards Organisation}}, - title = {{ISO 690-2}}, - url = {http://www.collectionscanada.gc.ca/iso/tc46sc9/standard/690-2e.htm}, - lastchecked = {20 August 2001} -} - -% This one appears to be dead -@Webpage{gone:classroom96, - title = {Citing Internet Addresses: how students should - reference online sources in their bibliographies}, - year = 1996, - month = mar, - key = {Classroom}, - url = "http://www.classroom.net/classroom/CitingNetResources.html" -} - -@Webpage{emory95, - author = "libsf@web.cc.emory.edu", - title = "Citation Formats", - date = {1997}, - lastchecked = {23 October 2002}, - url = {http://business.library.emory.edu/eresources/citing.html} -} - -@Book{walker, - author = {Janice R. Walker and Todd Taylor}, - title = {The Columbia Guide to Online Style}, - publisher = {Columbia University Press}, - year = 2006, - DEADurl = {http://www.columbia.edu/cu/cup/cgos/}, - edition = {2nd}, - isbn = {978-0-231-13211-4}, - DEADlastchecked = {23 October 2002} -} - -@Webpage{walker-orig, - title = {{MLA}-Style Citations of Electronic Sources}, - author = {Janice R. Walker}, - url = {http://www.cas.usf.edu/english/walker/mla.html}, - year = 1995, - lastchecked = {23 October 2002}, - note = {Updated and superceded by \cite{walker}} -} - -@Webpage{texfaq, - url = {http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citeURL}, - title = {{UK \TeX\ FAQ: URLs in \BibTeX\ bibliographies}}, - key = {UK TeX FAQ}, - editor = {Robin Fairbairns}, - year = 2002, - lastchecked = {23 October 2002} -} - - - -@Webpage{url:daly, - url = {http://www.tex.ac.uk/tex-archive/macros/latex/contrib/custom-bib/}, - title = {Index of custom-bib}, - author = {Patrick W Daly}, - year = 2003, - lastchecked = {4 June 2003} -} - -% Following are test entries - -% Article with URL and lastchecked -@article{test:towell, - title = {Presence in Text-Based Networked Virtual - Environments or `{MUDs}'}, - author = {John Towell and Elizabeth Towell}, - journal = {Presence}, - volume = 6, - number = 5, - pages = {590-595}, - year = 1997, - url = {http://www-unix.mcs.anl.gov/~towell/presence.html}, - lastchecked = {13 February 2002} -} - -% Book with URL, lastchecked, and note. -@Book{test:raymond99, - author = {Eric S Raymond}, - title = {The Cathedral and the Bazaar}, - publisher = {O'Reilly}, - year = 1999, - url = {http://www.tuxedo.org}, - isbn = {1-56592-724-9}, - lastchecked = {1 April 2002}, - note = {The seminal book on the commercialisation of open-source} -} - -% Plain book, no URLs at all -@book{test:laurillard93, - author = {Diana Laurillard}, - title = {Rethinking University Teaching}, - publisher = {Routledge}, - year = 1993 -} - -% Webpage with lastchecked but no date -@webpage{test:iso690, - author = {{International Standards Organisation}}, - title = {{ISO 690-2}}, - url = {http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm}, - lastchecked = {20 August 2001} -} - -% Webpage with date but no lastchecked -@Webpage{test:classroom96, - title = {Citing Internet Addresses: how students should - reference online sources in their bibliographies}, - year = 1996, - month = mar, - key = {Classroom}, - url = "http://www.classroom.net/classroom/CitingNetResources.html" -} - -% Webpage with neither date nor lastchecked -@Webpage{test:emory95, - author = "libsf@web.cc.emory.edu", - title = "Citation Formats", - url = "http://www.emory.edu/WHSCL/citation.formats.html" -} - -% The same, but with no title either -@Webpage{test:emory95x, - author = "libsf@web.cc.emory.edu", - url = "http://www.emory.edu/WHSCL/citation.formats.html" -} - -% Article with eprint number -@techreport{test:simkin, - author = {Mikhail Simkin and V. P. Roychowdhury}, - title = {Read before you cite!}, - year = 2002, - institution = {UCLA}, - eprint = {cond-mat/0212043} -} - -% Article with a DOI -% an underscore -@article{test:gray00c, - author = "Norman Gray", - title = "Automatic Reduction of Elliptic Integrals using - {Carlson's} Relations", - journal = {Mathematics of Computation}, - volume = 71, - pages = {311-318}, - year = 2002, - doi = {10.1090/S0025-5718-01-01333-3} -} - -% Article with a PUBMED reference - - -@Article{test:giffin03, - author = {M J Giffin and J C Stroud and D L Bates and von Koenig, K D and J Hardin and L Chen}, - title = {Structure of {NFAT1} Bound as a Dimer to the {HIV-1 LTR} kappa {B} element}, - journal = {Nature Structural Biology}, - year = {2003}, - volume = {10}, - number = {10}, - pages = {800-6}, - month = oct, - pubmed = {12949493} -} - -@ARTICLE{test:nastydoi, - author = {Zemla, Adam and Venclovas, Ceslovas and Moult, John and - Fidelis, Krzysztof}, - title = {{P}rocessing and analysis of {CASP}3 protein structure predictions}, - journal = {Proteins: Structure, Function, and Genetics}, - year = {1999}, - volume = {37}, - pages = {22--29}, - number = {S3}, - month = jan, - comment = {Description of GDT measure.}, - doi = {10.1002/(SICI)1097-0134(1999)37:3+<22::AID-PROT5>3.0.CO;2-W}, - keywords = {CASP}, - timestamp = {2007-03-13} -} - -% Example from Jason Eisner, by mail (nothing special about the entry, -% but he seemed to be having formatting problems with unsrturl and proceedings -% entries. -@InProceedings{test:eisner-sample, - author = {Damianos Karakos and Sanjeev Khudanpur and Jason - Eisner and Carey~E. Priebe}, - title = {Iterative denoising using {J}ensen-{R}eny\'{\i} - divergences with an application to unsupervised - document categorization}, - booktitle = {Proceedings of ICASSP}, - year = 2007, - url = {http://cs.jhu.edu/~jason/papers/#icassp07} -} - diff --git a/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst index aefda0e00f9..636613f34d4 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst @@ -1,5 +1,5 @@ -%%% Modification of BibTeX style file /usr/local/texlive/2007/texmf-dist/bibtex/bst/base/abbrv.bst -%%% ... by urlbst, version 0.6-1 (marked with "% urlbst") +%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/abbrv.bst +%%% ... by urlbst, version 0.6-5 (marked with "% urlbst") %%% See <http://purl.org/nxg/dist/urlbst> %%% Added webpage entry type, and url and lastchecked fields. %%% Added eprint support. @@ -52,11 +52,25 @@ ENTRY INTEGERS { output.state before.all mid.sentence after.sentence after.block } -STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst... -INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver } -% Following constants may be adjusted by hand, if desired +% urlbst... +% urlbst constants and state variables +STRINGS { urlintro + eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl + openinlinelink closeinlinelink } +INTEGERS { hrefform inlinelinks makeinlinelink + addeprints adddoiresolver addpubmedresolver } FUNCTION {init.urlbst.variables} { + % The following constants may be adjusted by hand, if desired + + % The first set allow you to enable or disable certain functionality. + #1 'addeprints := % 0=no eprints; 1=include eprints + #1 'adddoiresolver := % 0=no DOI resolver; 1=include it + #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + + % String constants, which you _might_ want to tweak. "Available from: " 'urlintro := % prefix before URL "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "arXiv:" 'eprintprefix := % text prefix printed before eprint ref @@ -64,13 +78,10 @@ FUNCTION {init.urlbst.variables} "doi:" 'doiprefix := % text prefix printed before DOI ref "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - #1 'addeprints := % 0=no eprints; 1=include eprints - #1 'adddoiresolver := % 0=no DOI resolver; 1=include it - #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it - #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - % the following are internal state variables, not config constants - #0 'makeinlinelink := % state variable managed by setup.inlinelink + + % The following are internal state variables, not configuration constants, + % so they shouldn't be fiddled with. + #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink "" 'openinlinelink := % ditto "" 'closeinlinelink := % ditto } @@ -83,10 +94,10 @@ INTEGERS { } % ...urlbst to here FUNCTION {init.state.consts} -{ #0 'outside.brackets := % urlbst +{ #0 'outside.brackets := % urlbst... #1 'open.brackets := #2 'within.brackets := - #3 'close.brackets := + #3 'close.brackets := % ...urlbst to here #0 'before.all := #1 'mid.sentence := @@ -129,24 +140,36 @@ FUNCTION {output.nonnull.original} % previously set makeinlinelink true, and the two ...end.inlinelink functions % will only do their stuff if start.inlinelink has previously set % closeinlinelink to be non-empty. -FUNCTION {setup.inlinelink} -{ makeinlinelink - { hrefform #1 = % hypertex - { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink := - "\special {html:</a>}" 'closeinlinelink := - } - { hrefform #2 = % hyperref - { "\href{" url * "}{" * 'openinlinelink := - "}" 'closeinlinelink := - } - 'skip$ - if$ % hrefform #2 = - } - if$ % hrefform #1 = +% (thanks to 'ijvm' for suggested code here) +FUNCTION {uand} +{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) +FUNCTION {possibly.setup.inlinelink} +{ makeinlinelink hrefform #0 > uand + { doi empty$ adddoiresolver uand + { pubmed empty$ addpubmedresolver uand + { eprint empty$ addeprints uand + { url empty$ + { "" } + { url } + if$ } + { eprinturl eprint * } + if$ } + { pubmedurl pubmed * } + if$ } + { doiurl doi * } + if$ + % an appropriately-formatted URL is now on the stack + hrefform #1 = % hypertex + { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink := + "\special {html:</a>}" 'closeinlinelink := } + { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref + % the space between "} {" matters: a URL of just the right length can cause "\% newline em" + "}" 'closeinlinelink := } + if$ #0 'makeinlinelink := - } + } 'skip$ - if$ % makeinlinelink + if$ % makeinlinelink } FUNCTION {add.inlinelink} { openinlinelink empty$ @@ -222,7 +245,7 @@ FUNCTION {output.check} if$ } -FUNCTION {output.bibitem.original} +FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) { newline$ "\bibitem{" write$ cite$ write$ @@ -232,7 +255,7 @@ FUNCTION {output.bibitem.original} before.all 'output.state := } -FUNCTION {fin.entry.original} +FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) { add.period$ write$ newline$ @@ -760,18 +783,23 @@ FUNCTION {output.url} FUNCTION {output.web.refs} { new.block - output.url - addeprints eprint empty$ not and - { format.eprint output.nonnull } - 'skip$ - if$ - adddoiresolver doi empty$ not and - { format.doi output.nonnull } - 'skip$ - if$ - addpubmedresolver pubmed empty$ not and - { format.pubmed output.nonnull } - 'skip$ + inlinelinks + 'skip$ % links were inline -- don't repeat them + { + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ + addpubmedresolver pubmed empty$ not and + { format.pubmed output.nonnull } + 'skip$ + if$ + } if$ } @@ -781,7 +809,7 @@ FUNCTION {output.web.refs} FUNCTION {output.bibitem} { outside.brackets 'bracket.state := output.bibitem.original - inlinelinks url empty$ not and + inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and { #1 'makeinlinelink := } { #0 'makeinlinelink := } if$ @@ -791,7 +819,7 @@ FUNCTION {output.bibitem} FUNCTION {fin.entry} { output.web.refs % urlbst makeinlinelink % ooops, it appears we didn't have a title for inlinelink - { setup.inlinelink % add some artificial link text here, as a fallback + { possibly.setup.inlinelink % add some artificial link text here, as a fallback "[link]" output.nonnull } 'skip$ if$ @@ -826,7 +854,7 @@ FUNCTION {webpage} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ + title empty$ 'skip$ 'possibly.setup.inlinelink if$ format.title "title" output.check inbrackets "online" output new.block @@ -849,12 +877,12 @@ FUNCTION {article} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ { journal emphasize "journal" output.check - format.vol.num.pages output + possibly.setup.inlinelink format.vol.num.pages output% urlbst format.date "year" output.check } { format.article.crossref output.nonnull @@ -878,7 +906,7 @@ FUNCTION {book} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -903,7 +931,7 @@ FUNCTION {booklet} { output.bibitem format.authors output new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check howpublished address new.block.checkb howpublished output @@ -926,7 +954,7 @@ FUNCTION {inbook} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -953,7 +981,7 @@ FUNCTION {incollection} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -980,7 +1008,7 @@ FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -1026,7 +1054,7 @@ FUNCTION {manual} { format.authors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check author empty$ { organization empty$ @@ -1052,7 +1080,7 @@ FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block "Master's thesis" format.thesis.type output.nonnull @@ -1068,7 +1096,7 @@ FUNCTION {misc} { output.bibitem format.authors output title howpublished new.block.checkb - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title output howpublished new.block.checka howpublished output @@ -1083,7 +1111,7 @@ FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check new.block "PhD thesis" format.thesis.type output.nonnull @@ -1102,7 +1130,7 @@ FUNCTION {proceedings} { format.editors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check format.bvolume output format.number.series output @@ -1135,7 +1163,7 @@ FUNCTION {techreport} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block format.tr.number output.nonnull @@ -1151,7 +1179,7 @@ FUNCTION {unpublished} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block note "note" output.check @@ -1408,7 +1436,7 @@ FUNCTION {begin.bib} EXECUTE {begin.bib} -EXECUTE {init.urlbst.variables} +EXECUTE {init.urlbst.variables} % urlbst EXECUTE {init.state.consts} ITERATE {call.type$} diff --git a/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst index 19ed512e504..687aeeccede 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst @@ -1,5 +1,5 @@ -%%% Modification of BibTeX style file /usr/local/texlive/2007/texmf-dist/bibtex/bst/base/alpha.bst -%%% ... by urlbst, version 0.6-1 (marked with "% urlbst") +%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/alpha.bst +%%% ... by urlbst, version 0.6-5 (marked with "% urlbst") %%% See <http://purl.org/nxg/dist/urlbst> %%% Added webpage entry type, and url and lastchecked fields. %%% Added eprint support. @@ -52,11 +52,25 @@ ENTRY INTEGERS { output.state before.all mid.sentence after.sentence after.block } -STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst... -INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver } -% Following constants may be adjusted by hand, if desired +% urlbst... +% urlbst constants and state variables +STRINGS { urlintro + eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl + openinlinelink closeinlinelink } +INTEGERS { hrefform inlinelinks makeinlinelink + addeprints adddoiresolver addpubmedresolver } FUNCTION {init.urlbst.variables} { + % The following constants may be adjusted by hand, if desired + + % The first set allow you to enable or disable certain functionality. + #1 'addeprints := % 0=no eprints; 1=include eprints + #1 'adddoiresolver := % 0=no DOI resolver; 1=include it + #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + + % String constants, which you _might_ want to tweak. "Available from: " 'urlintro := % prefix before URL "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "arXiv:" 'eprintprefix := % text prefix printed before eprint ref @@ -64,13 +78,10 @@ FUNCTION {init.urlbst.variables} "doi:" 'doiprefix := % text prefix printed before DOI ref "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - #1 'addeprints := % 0=no eprints; 1=include eprints - #1 'adddoiresolver := % 0=no DOI resolver; 1=include it - #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it - #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - % the following are internal state variables, not config constants - #0 'makeinlinelink := % state variable managed by setup.inlinelink + + % The following are internal state variables, not configuration constants, + % so they shouldn't be fiddled with. + #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink "" 'openinlinelink := % ditto "" 'closeinlinelink := % ditto } @@ -83,10 +94,10 @@ INTEGERS { } % ...urlbst to here FUNCTION {init.state.consts} -{ #0 'outside.brackets := % urlbst +{ #0 'outside.brackets := % urlbst... #1 'open.brackets := #2 'within.brackets := - #3 'close.brackets := + #3 'close.brackets := % ...urlbst to here #0 'before.all := #1 'mid.sentence := @@ -129,24 +140,36 @@ FUNCTION {output.nonnull.original} % previously set makeinlinelink true, and the two ...end.inlinelink functions % will only do their stuff if start.inlinelink has previously set % closeinlinelink to be non-empty. -FUNCTION {setup.inlinelink} -{ makeinlinelink - { hrefform #1 = % hypertex - { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink := - "\special {html:</a>}" 'closeinlinelink := - } - { hrefform #2 = % hyperref - { "\href{" url * "}{" * 'openinlinelink := - "}" 'closeinlinelink := - } - 'skip$ - if$ % hrefform #2 = - } - if$ % hrefform #1 = +% (thanks to 'ijvm' for suggested code here) +FUNCTION {uand} +{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) +FUNCTION {possibly.setup.inlinelink} +{ makeinlinelink hrefform #0 > uand + { doi empty$ adddoiresolver uand + { pubmed empty$ addpubmedresolver uand + { eprint empty$ addeprints uand + { url empty$ + { "" } + { url } + if$ } + { eprinturl eprint * } + if$ } + { pubmedurl pubmed * } + if$ } + { doiurl doi * } + if$ + % an appropriately-formatted URL is now on the stack + hrefform #1 = % hypertex + { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink := + "\special {html:</a>}" 'closeinlinelink := } + { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref + % the space between "} {" matters: a URL of just the right length can cause "\% newline em" + "}" 'closeinlinelink := } + if$ #0 'makeinlinelink := - } + } 'skip$ - if$ % makeinlinelink + if$ % makeinlinelink } FUNCTION {add.inlinelink} { openinlinelink empty$ @@ -222,7 +245,7 @@ FUNCTION {output.check} if$ } -FUNCTION {output.bibitem.original} +FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) { newline$ "\bibitem[" write$ label write$ @@ -234,7 +257,7 @@ FUNCTION {output.bibitem.original} before.all 'output.state := } -FUNCTION {fin.entry.original} +FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) { add.period$ write$ newline$ @@ -762,18 +785,23 @@ FUNCTION {output.url} FUNCTION {output.web.refs} { new.block - output.url - addeprints eprint empty$ not and - { format.eprint output.nonnull } - 'skip$ - if$ - adddoiresolver doi empty$ not and - { format.doi output.nonnull } - 'skip$ - if$ - addpubmedresolver pubmed empty$ not and - { format.pubmed output.nonnull } - 'skip$ + inlinelinks + 'skip$ % links were inline -- don't repeat them + { + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ + addpubmedresolver pubmed empty$ not and + { format.pubmed output.nonnull } + 'skip$ + if$ + } if$ } @@ -783,7 +811,7 @@ FUNCTION {output.web.refs} FUNCTION {output.bibitem} { outside.brackets 'bracket.state := output.bibitem.original - inlinelinks url empty$ not and + inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and { #1 'makeinlinelink := } { #0 'makeinlinelink := } if$ @@ -793,7 +821,7 @@ FUNCTION {output.bibitem} FUNCTION {fin.entry} { output.web.refs % urlbst makeinlinelink % ooops, it appears we didn't have a title for inlinelink - { setup.inlinelink % add some artificial link text here, as a fallback + { possibly.setup.inlinelink % add some artificial link text here, as a fallback "[link]" output.nonnull } 'skip$ if$ @@ -828,7 +856,7 @@ FUNCTION {webpage} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ + title empty$ 'skip$ 'possibly.setup.inlinelink if$ format.title "title" output.check inbrackets "online" output new.block @@ -851,12 +879,12 @@ FUNCTION {article} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ { journal emphasize "journal" output.check - format.vol.num.pages output + possibly.setup.inlinelink format.vol.num.pages output% urlbst format.date "year" output.check } { format.article.crossref output.nonnull @@ -880,7 +908,7 @@ FUNCTION {book} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -905,7 +933,7 @@ FUNCTION {booklet} { output.bibitem format.authors output new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check howpublished address new.block.checkb howpublished output @@ -928,7 +956,7 @@ FUNCTION {inbook} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -955,7 +983,7 @@ FUNCTION {incollection} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -982,7 +1010,7 @@ FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -1028,7 +1056,7 @@ FUNCTION {manual} { format.authors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check author empty$ { organization empty$ @@ -1054,7 +1082,7 @@ FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block "Master's thesis" format.thesis.type output.nonnull @@ -1070,7 +1098,7 @@ FUNCTION {misc} { output.bibitem format.authors output title howpublished new.block.checkb - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title output howpublished new.block.checka howpublished output @@ -1085,7 +1113,7 @@ FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check new.block "PhD thesis" format.thesis.type output.nonnull @@ -1104,7 +1132,7 @@ FUNCTION {proceedings} { format.editors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check format.bvolume output format.number.series output @@ -1137,7 +1165,7 @@ FUNCTION {techreport} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block format.tr.number output.nonnull @@ -1153,7 +1181,7 @@ FUNCTION {unpublished} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block note "note" output.check @@ -1568,7 +1596,7 @@ FUNCTION {begin.bib} EXECUTE {begin.bib} -EXECUTE {init.urlbst.variables} +EXECUTE {init.urlbst.variables} % urlbst EXECUTE {init.state.consts} ITERATE {call.type$} diff --git a/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst index 5c0788e1398..79f9623857d 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst @@ -1,5 +1,5 @@ -%%% Modification of BibTeX style file /usr/local/texlive/2007/texmf-dist/bibtex/bst/base/plain.bst -%%% ... by urlbst, version 0.6-1 (marked with "% urlbst") +%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/plain.bst +%%% ... by urlbst, version 0.6-5 (marked with "% urlbst") %%% See <http://purl.org/nxg/dist/urlbst> %%% Added webpage entry type, and url and lastchecked fields. %%% Added eprint support. @@ -52,11 +52,25 @@ ENTRY INTEGERS { output.state before.all mid.sentence after.sentence after.block } -STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst... -INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver } -% Following constants may be adjusted by hand, if desired +% urlbst... +% urlbst constants and state variables +STRINGS { urlintro + eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl + openinlinelink closeinlinelink } +INTEGERS { hrefform inlinelinks makeinlinelink + addeprints adddoiresolver addpubmedresolver } FUNCTION {init.urlbst.variables} { + % The following constants may be adjusted by hand, if desired + + % The first set allow you to enable or disable certain functionality. + #1 'addeprints := % 0=no eprints; 1=include eprints + #1 'adddoiresolver := % 0=no DOI resolver; 1=include it + #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + + % String constants, which you _might_ want to tweak. "Available from: " 'urlintro := % prefix before URL "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "arXiv:" 'eprintprefix := % text prefix printed before eprint ref @@ -64,13 +78,10 @@ FUNCTION {init.urlbst.variables} "doi:" 'doiprefix := % text prefix printed before DOI ref "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - #1 'addeprints := % 0=no eprints; 1=include eprints - #1 'adddoiresolver := % 0=no DOI resolver; 1=include it - #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it - #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - % the following are internal state variables, not config constants - #0 'makeinlinelink := % state variable managed by setup.inlinelink + + % The following are internal state variables, not configuration constants, + % so they shouldn't be fiddled with. + #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink "" 'openinlinelink := % ditto "" 'closeinlinelink := % ditto } @@ -83,10 +94,10 @@ INTEGERS { } % ...urlbst to here FUNCTION {init.state.consts} -{ #0 'outside.brackets := % urlbst +{ #0 'outside.brackets := % urlbst... #1 'open.brackets := #2 'within.brackets := - #3 'close.brackets := + #3 'close.brackets := % ...urlbst to here #0 'before.all := #1 'mid.sentence := @@ -129,24 +140,36 @@ FUNCTION {output.nonnull.original} % previously set makeinlinelink true, and the two ...end.inlinelink functions % will only do their stuff if start.inlinelink has previously set % closeinlinelink to be non-empty. -FUNCTION {setup.inlinelink} -{ makeinlinelink - { hrefform #1 = % hypertex - { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink := - "\special {html:</a>}" 'closeinlinelink := - } - { hrefform #2 = % hyperref - { "\href{" url * "}{" * 'openinlinelink := - "}" 'closeinlinelink := - } - 'skip$ - if$ % hrefform #2 = - } - if$ % hrefform #1 = +% (thanks to 'ijvm' for suggested code here) +FUNCTION {uand} +{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) +FUNCTION {possibly.setup.inlinelink} +{ makeinlinelink hrefform #0 > uand + { doi empty$ adddoiresolver uand + { pubmed empty$ addpubmedresolver uand + { eprint empty$ addeprints uand + { url empty$ + { "" } + { url } + if$ } + { eprinturl eprint * } + if$ } + { pubmedurl pubmed * } + if$ } + { doiurl doi * } + if$ + % an appropriately-formatted URL is now on the stack + hrefform #1 = % hypertex + { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink := + "\special {html:</a>}" 'closeinlinelink := } + { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref + % the space between "} {" matters: a URL of just the right length can cause "\% newline em" + "}" 'closeinlinelink := } + if$ #0 'makeinlinelink := - } + } 'skip$ - if$ % makeinlinelink + if$ % makeinlinelink } FUNCTION {add.inlinelink} { openinlinelink empty$ @@ -222,7 +245,7 @@ FUNCTION {output.check} if$ } -FUNCTION {output.bibitem.original} +FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) { newline$ "\bibitem{" write$ cite$ write$ @@ -232,7 +255,7 @@ FUNCTION {output.bibitem.original} before.all 'output.state := } -FUNCTION {fin.entry.original} +FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) { add.period$ write$ newline$ @@ -760,18 +783,23 @@ FUNCTION {output.url} FUNCTION {output.web.refs} { new.block - output.url - addeprints eprint empty$ not and - { format.eprint output.nonnull } - 'skip$ - if$ - adddoiresolver doi empty$ not and - { format.doi output.nonnull } - 'skip$ - if$ - addpubmedresolver pubmed empty$ not and - { format.pubmed output.nonnull } - 'skip$ + inlinelinks + 'skip$ % links were inline -- don't repeat them + { + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ + addpubmedresolver pubmed empty$ not and + { format.pubmed output.nonnull } + 'skip$ + if$ + } if$ } @@ -781,7 +809,7 @@ FUNCTION {output.web.refs} FUNCTION {output.bibitem} { outside.brackets 'bracket.state := output.bibitem.original - inlinelinks url empty$ not and + inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and { #1 'makeinlinelink := } { #0 'makeinlinelink := } if$ @@ -791,7 +819,7 @@ FUNCTION {output.bibitem} FUNCTION {fin.entry} { output.web.refs % urlbst makeinlinelink % ooops, it appears we didn't have a title for inlinelink - { setup.inlinelink % add some artificial link text here, as a fallback + { possibly.setup.inlinelink % add some artificial link text here, as a fallback "[link]" output.nonnull } 'skip$ if$ @@ -826,7 +854,7 @@ FUNCTION {webpage} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ + title empty$ 'skip$ 'possibly.setup.inlinelink if$ format.title "title" output.check inbrackets "online" output new.block @@ -849,12 +877,12 @@ FUNCTION {article} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ { journal emphasize "journal" output.check - format.vol.num.pages output + possibly.setup.inlinelink format.vol.num.pages output% urlbst format.date "year" output.check } { format.article.crossref output.nonnull @@ -878,7 +906,7 @@ FUNCTION {book} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -903,7 +931,7 @@ FUNCTION {booklet} { output.bibitem format.authors output new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check howpublished address new.block.checkb howpublished output @@ -926,7 +954,7 @@ FUNCTION {inbook} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -953,7 +981,7 @@ FUNCTION {incollection} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -980,7 +1008,7 @@ FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -1026,7 +1054,7 @@ FUNCTION {manual} { format.authors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check author empty$ { organization empty$ @@ -1052,7 +1080,7 @@ FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block "Master's thesis" format.thesis.type output.nonnull @@ -1068,7 +1096,7 @@ FUNCTION {misc} { output.bibitem format.authors output title howpublished new.block.checkb - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title output howpublished new.block.checka howpublished output @@ -1083,7 +1111,7 @@ FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check new.block "PhD thesis" format.thesis.type output.nonnull @@ -1102,7 +1130,7 @@ FUNCTION {proceedings} { format.editors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check format.bvolume output format.number.series output @@ -1135,7 +1163,7 @@ FUNCTION {techreport} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block format.tr.number output.nonnull @@ -1151,7 +1179,7 @@ FUNCTION {unpublished} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block note "note" output.check @@ -1408,7 +1436,7 @@ FUNCTION {begin.bib} EXECUTE {begin.bib} -EXECUTE {init.urlbst.variables} +EXECUTE {init.urlbst.variables} % urlbst EXECUTE {init.state.consts} ITERATE {call.type$} diff --git a/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst b/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst index 602c0f105c7..0ccd294c018 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst @@ -1,5 +1,5 @@ -%%% Modification of BibTeX style file /usr/local/texlive/2007/texmf-dist/bibtex/bst/base/unsrt.bst -%%% ... by urlbst, version 0.6-1 (marked with "% urlbst") +%%% Modification of BibTeX style file /usr/local/texlive/2009/texmf-dist/bibtex/bst/base/unsrt.bst +%%% ... by urlbst, version 0.6-5 (marked with "% urlbst") %%% See <http://purl.org/nxg/dist/urlbst> %%% Added webpage entry type, and url and lastchecked fields. %%% Added eprint support. @@ -52,11 +52,25 @@ ENTRY INTEGERS { output.state before.all mid.sentence after.sentence after.block } -STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst... -INTEGERS { hrefform inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver } -% Following constants may be adjusted by hand, if desired +% urlbst... +% urlbst constants and state variables +STRINGS { urlintro + eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl + openinlinelink closeinlinelink } +INTEGERS { hrefform inlinelinks makeinlinelink + addeprints adddoiresolver addpubmedresolver } FUNCTION {init.urlbst.variables} { + % The following constants may be adjusted by hand, if desired + + % The first set allow you to enable or disable certain functionality. + #1 'addeprints := % 0=no eprints; 1=include eprints + #1 'adddoiresolver := % 0=no DOI resolver; 1=include it + #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + + % String constants, which you _might_ want to tweak. "Available from: " 'urlintro := % prefix before URL "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "arXiv:" 'eprintprefix := % text prefix printed before eprint ref @@ -64,13 +78,10 @@ FUNCTION {init.urlbst.variables} "doi:" 'doiprefix := % text prefix printed before DOI ref "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - #1 'addeprints := % 0=no eprints; 1=include eprints - #1 'adddoiresolver := % 0=no DOI resolver; 1=include it - #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it - #2 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - % the following are internal state variables, not config constants - #0 'makeinlinelink := % state variable managed by setup.inlinelink + + % The following are internal state variables, not configuration constants, + % so they shouldn't be fiddled with. + #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink "" 'openinlinelink := % ditto "" 'closeinlinelink := % ditto } @@ -83,10 +94,10 @@ INTEGERS { } % ...urlbst to here FUNCTION {init.state.consts} -{ #0 'outside.brackets := % urlbst +{ #0 'outside.brackets := % urlbst... #1 'open.brackets := #2 'within.brackets := - #3 'close.brackets := + #3 'close.brackets := % ...urlbst to here #0 'before.all := #1 'mid.sentence := @@ -129,24 +140,36 @@ FUNCTION {output.nonnull.original} % previously set makeinlinelink true, and the two ...end.inlinelink functions % will only do their stuff if start.inlinelink has previously set % closeinlinelink to be non-empty. -FUNCTION {setup.inlinelink} -{ makeinlinelink - { hrefform #1 = % hypertex - { "\special {html:<a href=" quote$ * url * quote$ * "> }{" * 'openinlinelink := - "\special {html:</a>}" 'closeinlinelink := - } - { hrefform #2 = % hyperref - { "\href{" url * "}{" * 'openinlinelink := - "}" 'closeinlinelink := - } - 'skip$ - if$ % hrefform #2 = - } - if$ % hrefform #1 = +% (thanks to 'ijvm' for suggested code here) +FUNCTION {uand} +{ 'skip$ { pop$ #0 } if$ } % 'and' (which isn't defined at this point in the file) +FUNCTION {possibly.setup.inlinelink} +{ makeinlinelink hrefform #0 > uand + { doi empty$ adddoiresolver uand + { pubmed empty$ addpubmedresolver uand + { eprint empty$ addeprints uand + { url empty$ + { "" } + { url } + if$ } + { eprinturl eprint * } + if$ } + { pubmedurl pubmed * } + if$ } + { doiurl doi * } + if$ + % an appropriately-formatted URL is now on the stack + hrefform #1 = % hypertex + { "\special {html:<a href=" quote$ * swap$ * quote$ * "> }{" * 'openinlinelink := + "\special {html:</a>}" 'closeinlinelink := } + { "\href {" swap$ * "} {" * 'openinlinelink := % hrefform=#2 -- hyperref + % the space between "} {" matters: a URL of just the right length can cause "\% newline em" + "}" 'closeinlinelink := } + if$ #0 'makeinlinelink := - } + } 'skip$ - if$ % makeinlinelink + if$ % makeinlinelink } FUNCTION {add.inlinelink} { openinlinelink empty$ @@ -222,7 +245,7 @@ FUNCTION {output.check} if$ } -FUNCTION {output.bibitem.original} +FUNCTION {output.bibitem.original} % urlbst (renamed from output.bibitem, so it can be wrapped below) { newline$ "\bibitem{" write$ cite$ write$ @@ -232,7 +255,7 @@ FUNCTION {output.bibitem.original} before.all 'output.state := } -FUNCTION {fin.entry.original} +FUNCTION {fin.entry.original} % urlbst (renamed from fin.entry, so it can be wrapped below) { add.period$ write$ newline$ @@ -759,18 +782,23 @@ FUNCTION {output.url} FUNCTION {output.web.refs} { new.block - output.url - addeprints eprint empty$ not and - { format.eprint output.nonnull } - 'skip$ - if$ - adddoiresolver doi empty$ not and - { format.doi output.nonnull } - 'skip$ - if$ - addpubmedresolver pubmed empty$ not and - { format.pubmed output.nonnull } - 'skip$ + inlinelinks + 'skip$ % links were inline -- don't repeat them + { + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ + addpubmedresolver pubmed empty$ not and + { format.pubmed output.nonnull } + 'skip$ + if$ + } if$ } @@ -780,7 +808,7 @@ FUNCTION {output.web.refs} FUNCTION {output.bibitem} { outside.brackets 'bracket.state := output.bibitem.original - inlinelinks url empty$ not and + inlinelinks url empty$ not doi empty$ not or pubmed empty$ not or eprint empty$ not or and { #1 'makeinlinelink := } { #0 'makeinlinelink := } if$ @@ -790,7 +818,7 @@ FUNCTION {output.bibitem} FUNCTION {fin.entry} { output.web.refs % urlbst makeinlinelink % ooops, it appears we didn't have a title for inlinelink - { setup.inlinelink % add some artificial link text here, as a fallback + { possibly.setup.inlinelink % add some artificial link text here, as a fallback "[link]" output.nonnull } 'skip$ if$ @@ -825,7 +853,7 @@ FUNCTION {webpage} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ + title empty$ 'skip$ 'possibly.setup.inlinelink if$ format.title "title" output.check inbrackets "online" output new.block @@ -848,12 +876,12 @@ FUNCTION {article} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ { journal emphasize "journal" output.check - format.vol.num.pages output + possibly.setup.inlinelink format.vol.num.pages output% urlbst format.date "year" output.check } { format.article.crossref output.nonnull @@ -877,7 +905,7 @@ FUNCTION {book} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -902,7 +930,7 @@ FUNCTION {booklet} { output.bibitem format.authors output new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check howpublished address new.block.checkb howpublished output @@ -925,7 +953,7 @@ FUNCTION {inbook} } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check crossref missing$ { format.bvolume output @@ -952,7 +980,7 @@ FUNCTION {incollection} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -979,7 +1007,7 @@ FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block crossref missing$ @@ -1025,7 +1053,7 @@ FUNCTION {manual} { format.authors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check author empty$ { organization empty$ @@ -1051,7 +1079,7 @@ FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block "Master's thesis" format.thesis.type output.nonnull @@ -1067,7 +1095,7 @@ FUNCTION {misc} { output.bibitem format.authors output title howpublished new.block.checkb - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title output howpublished new.block.checka howpublished output @@ -1082,7 +1110,7 @@ FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check new.block "PhD thesis" format.thesis.type output.nonnull @@ -1101,7 +1129,7 @@ FUNCTION {proceedings} { format.editors output.nonnull } if$ new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.btitle "title" output.check format.bvolume output format.number.series output @@ -1134,7 +1162,7 @@ FUNCTION {techreport} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block format.tr.number output.nonnull @@ -1150,7 +1178,7 @@ FUNCTION {unpublished} { output.bibitem format.authors "author" output.check new.block - title empty$ 'skip$ 'setup.inlinelink if$ % urlbst + title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst format.title "title" output.check new.block note "note" output.check @@ -1262,7 +1290,7 @@ FUNCTION {begin.bib} EXECUTE {begin.bib} -EXECUTE {init.urlbst.variables} +EXECUTE {init.urlbst.variables} % urlbst EXECUTE {init.state.consts} ITERATE {call.type$} |