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/bst/urlbst/alphaurl.bst | |
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/bst/urlbst/alphaurl.bst')
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst | 152 |
1 files changed, 90 insertions, 62 deletions
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$} |