summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst')
-rw-r--r--Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst152
1 files changed, 90 insertions, 62 deletions
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$}