diff options
Diffstat (limited to 'Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst')
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst | 152 |
1 files changed, 90 insertions, 62 deletions
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$} |