diff options
author | Karl Berry <karl@freefriends.org> | 2023-01-30 22:07:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-01-30 22:07:37 +0000 |
commit | 1ff1e4f491a86cfda2b22a46ba4ea14ddd190d1d (patch) | |
tree | fb7e153394c0ccd215d936c6f8ea1c736588b936 | |
parent | 37ea12f13b2344449b0a4c21a2fafb33b40b4fc6 (diff) |
urlbst (30jan23)
git-svn-id: svn://tug.org/texlive/trunk@65694 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/urlbst/urlbst | 43 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst | 57 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst | 53 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst | 55 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst | 53 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/VERSION | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib | 18 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.html | 20 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.in | 33 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf | bin | 222858 -> 223396 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex | 26 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/urlbst/urlbst | 43 | ||||
-rwxr-xr-x | Master/texmf-dist/source/bibtex/urlbst/configure | 22 | ||||
-rw-r--r-- | Master/texmf-dist/source/bibtex/urlbst/configure.ac | 8 |
15 files changed, 304 insertions, 133 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/urlbst/urlbst b/Build/source/texk/texlive/linked_scripts/urlbst/urlbst index 1a7625ee882..cfe72a52b0a 100755 --- a/Build/source/texk/texlive/linked_scripts/urlbst/urlbst +++ b/Build/source/texk/texlive/linked_scripts/urlbst/urlbst @@ -8,16 +8,16 @@ # # See https://purl.org/nxg/dist/urlbst for documentation # -# Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray <https://nxg.me.uk> +# Copyright 2002–23, Norman Gray <https://nxg.me.uk> # # This program is distributed under the terms of the # GNU General Public Licence, v2.0. -# The modifications to the input .bst files are asserted as Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +# The modifications to the input .bst files are asserted as Copyright 2002–23, Norman Gray, # and distributed under the terms of the LaTeX Project Public Licence. # See the package README for further dicussion of licences. -$version = '0.9'; -$releasedate = '2022 December 1'; +$version = '0.9.1'; +$releasedate = '2023 January 30'; ($progname = $0) =~ s/.*\///; $mymarker = "% $progname"; $mymarkerend = "% ...$progname to here"; @@ -253,7 +253,7 @@ open (OUT, ">$outfile") || die "Can't open $outfile to write"; print OUT "%%% Modification of BibTeX style file ", ($infile eq '-' ? '<stdin>' : $infile), "\n"; print OUT "%%% ... by $progname, version $version (marked with \"$mymarker\")\n%%% See <$homepageurl> and repository <$repourl>\n"; -print OUT "%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray,\n"; +print OUT "%%% Modifications Copyright 2002–23, Norman Gray,\n"; print OUT "%%% and distributed under the terms of the LPPL; see README for discussion.\n"; print OUT "%%%\n"; print OUT "%%% Added webpage entry type, and url and lastchecked fields.\n"; @@ -501,6 +501,19 @@ sub print_output_functions { print OUT "$mymarker...\n"; print OUT <<'EOD'; +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -527,7 +540,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -683,9 +701,11 @@ EOD FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -731,10 +751,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst index 6f946853780..3fe9520b544 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/abbrvurl.bst @@ -1,7 +1,7 @@ %%% Modification of BibTeX style file /usr/local/texlive/2022/texmf-dist/bibtex/bst/base/abbrv.bst -%%% ... by urlbst, version 0.9 (marked with "% urlbst") +%%% ... by urlbst, version 0.9.1 (marked with "% urlbst") %%% See <https://purl.org/nxg/dist/urlbst> and repository <https://heptapod.host/nxg/urlbst> -%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +%%% Modifications Copyright 2002–23, Norman Gray, %%% and distributed under the terms of the LPPL; see README for discussion. %%% %%% Added webpage entry type, and url and lastchecked fields. @@ -68,24 +68,24 @@ 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 'adddoi := % 0=no DOI resolver; 1=include it #2 'hrefform := % 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs - #0 'doiform := % 0=with href; 1=with \doi{} + #1 'adddoi := % 0=no DOI resolver; 1=include it + #1 'addeprints := % 0=no eprints; 1=include eprints #1 'addpubmed := % 0=no PUBMED resolver; 1=include it #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + #0 'doiform := % 0=with href; 1=with \doi{} % String constants, which you _might_ want to tweak. - "[link]" 'linktextstring := % anonymous link text - "cited " 'citedstring := % label in "lastchecked" remark - "online" 'onlinestring := % label that a resource is online - "doi:" 'doiprefix := % printed text to introduce DOI - "arXiv:" 'eprintprefix := % text prefix printed before eprint ref - "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "cited " 'citedstring := % label in "lastchecked" remark "https://doi.org/" 'doiurl := % prefix to make URL from DOI "URL: " 'urlintro := % text prefix before URL + "[link]" 'linktextstring := % anonymous link text + "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "doi:" 'doiprefix := % printed text to introduce DOI + "online" 'onlinestring := % label that a resource is online + "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref % The following are internal state variables, not configuration constants, % so they shouldn't be fiddled with. @@ -138,6 +138,19 @@ FUNCTION {output.nonnull.original} } % urlbst... +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -164,7 +177,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -761,9 +779,11 @@ FUNCTION {format.eprint} FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -797,10 +817,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst index e4fc0af4eb7..c72e293d4ff 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/alphaurl.bst @@ -1,7 +1,7 @@ %%% Modification of BibTeX style file /usr/local/texlive/2022/texmf-dist/bibtex/bst/base/alpha.bst -%%% ... by urlbst, version 0.9 (marked with "% urlbst") +%%% ... by urlbst, version 0.9.1 (marked with "% urlbst") %%% See <https://purl.org/nxg/dist/urlbst> and repository <https://heptapod.host/nxg/urlbst> -%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +%%% Modifications Copyright 2002–23, Norman Gray, %%% and distributed under the terms of the LPPL; see README for discussion. %%% %%% Added webpage entry type, and url and lastchecked fields. @@ -69,23 +69,23 @@ FUNCTION {init.urlbst.variables} % The first set allow you to enable or disable certain functionality. #1 'addeprints := % 0=no eprints; 1=include eprints - #2 'hrefform := % 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles + #1 'addpubmed := % 0=no PUBMED resolver; 1=include it #1 'adddoi := % 0=no DOI resolver; 1=include it + #2 'hrefform := % 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs #0 'doiform := % 0=with href; 1=with \doi{} - #1 'addpubmed := % 0=no PUBMED resolver; 1=include it % String constants, which you _might_ want to tweak. - "cited " 'citedstring := % label in "lastchecked" remark - "URL: " 'urlintro := % text prefix before URL - "[link]" 'linktextstring := % anonymous link text + "doi:" 'doiprefix := % printed text to introduce DOI "arXiv:" 'eprintprefix := % text prefix printed before eprint ref - "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - "online" 'onlinestring := % label that a resource is online + "[link]" 'linktextstring := % anonymous link text + "cited " 'citedstring := % label in "lastchecked" remark + "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref - "doi:" 'doiprefix := % printed text to introduce DOI + "online" 'onlinestring := % label that a resource is online "https://doi.org/" 'doiurl := % prefix to make URL from DOI + "URL: " 'urlintro := % text prefix before URL % The following are internal state variables, not configuration constants, % so they shouldn't be fiddled with. @@ -138,6 +138,19 @@ FUNCTION {output.nonnull.original} } % urlbst... +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -164,7 +177,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -763,9 +781,11 @@ FUNCTION {format.eprint} FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -799,10 +819,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst b/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst index 34084b54765..e2df8eb6134 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/plainurl.bst @@ -1,7 +1,7 @@ %%% Modification of BibTeX style file /usr/local/texlive/2022/texmf-dist/bibtex/bst/base/plain.bst -%%% ... by urlbst, version 0.9 (marked with "% urlbst") +%%% ... by urlbst, version 0.9.1 (marked with "% urlbst") %%% See <https://purl.org/nxg/dist/urlbst> and repository <https://heptapod.host/nxg/urlbst> -%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +%%% Modifications Copyright 2002–23, Norman Gray, %%% and distributed under the terms of the LPPL; see README for discussion. %%% %%% Added webpage entry type, and url and lastchecked fields. @@ -68,24 +68,24 @@ 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 'addpubmed := % 0=no PUBMED resolver; 1=include it - #1 'addeprints := % 0=no eprints; 1=include eprints - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles #1 'adddoi := % 0=no DOI resolver; 1=include it + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles #2 'hrefform := % 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs + #1 'addeprints := % 0=no eprints; 1=include eprints #0 'doiform := % 0=with href; 1=with \doi{} + #1 'addpubmed := % 0=no PUBMED resolver; 1=include it % String constants, which you _might_ want to tweak. - "cited " 'citedstring := % label in "lastchecked" remark - "[link]" 'linktextstring := % anonymous link text - "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "https://doi.org/" 'doiurl := % prefix to make URL from DOI + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref "online" 'onlinestring := % label that a resource is online + "URL: " 'urlintro := % text prefix before URL "doi:" 'doiprefix := % printed text to introduce DOI - "https://doi.org/" 'doiurl := % prefix to make URL from DOI "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED - "URL: " 'urlintro := % text prefix before URL + "[link]" 'linktextstring := % anonymous link text + "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref - "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "cited " 'citedstring := % label in "lastchecked" remark % The following are internal state variables, not configuration constants, % so they shouldn't be fiddled with. @@ -138,6 +138,19 @@ FUNCTION {output.nonnull.original} } % urlbst... +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -164,7 +177,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -761,9 +779,11 @@ FUNCTION {format.eprint} FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -797,10 +817,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst b/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst index 185483c1b63..80cd43e8c9c 100644 --- a/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst +++ b/Master/texmf-dist/bibtex/bst/urlbst/unsrturl.bst @@ -1,7 +1,7 @@ %%% Modification of BibTeX style file /usr/local/texlive/2022/texmf-dist/bibtex/bst/base/unsrt.bst -%%% ... by urlbst, version 0.9 (marked with "% urlbst") +%%% ... by urlbst, version 0.9.1 (marked with "% urlbst") %%% See <https://purl.org/nxg/dist/urlbst> and repository <https://heptapod.host/nxg/urlbst> -%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +%%% Modifications Copyright 2002–23, Norman Gray, %%% and distributed under the terms of the LPPL; see README for discussion. %%% %%% Added webpage entry type, and url and lastchecked fields. @@ -68,24 +68,24 @@ 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. - #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - #1 'adddoi := % 0=no DOI resolver; 1=include it + #1 'addpubmed := % 0=no PUBMED resolver; 1=include it #0 'doiform := % 0=with href; 1=with \doi{} + #1 'adddoi := % 0=no DOI resolver; 1=include it #1 'addeprints := % 0=no eprints; 1=include eprints - #1 'addpubmed := % 0=no PUBMED resolver; 1=include it + #0 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles #2 'hrefform := % 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs % String constants, which you _might_ want to tweak. + "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED - "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref "[link]" 'linktextstring := % anonymous link text - "online" 'onlinestring := % label that a resource is online - "https://doi.org/" 'doiurl := % prefix to make URL from DOI - "doi:" 'doiprefix := % printed text to introduce DOI "URL: " 'urlintro := % text prefix before URL - "https://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "https://doi.org/" 'doiurl := % prefix to make URL from DOI "cited " 'citedstring := % label in "lastchecked" remark + "doi:" 'doiprefix := % printed text to introduce DOI "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref + "online" 'onlinestring := % label that a resource is online % The following are internal state variables, not configuration constants, % so they shouldn't be fiddled with. @@ -138,6 +138,19 @@ FUNCTION {output.nonnull.original} } % urlbst... +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -164,7 +177,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -760,9 +778,11 @@ FUNCTION {format.eprint} FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -796,10 +816,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/doc/bibtex/urlbst/README b/Master/texmf-dist/doc/bibtex/urlbst/README index 15daf759351..8b80f1ec474 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/README +++ b/Master/texmf-dist/doc/bibtex/urlbst/README @@ -1,7 +1,7 @@ urlbst -- add @webpage entry and url/doi/eprint/pubmed fields to BibTeX ======================================================================= -Version 0.9, 2022 December 1. +Version 0.9.1, 2023 January 30. The urlbst package consists of a Perl script which edits BibTeX style files (.bst) to add a `@webpage` entry type, and which adds a few new @@ -30,7 +30,7 @@ Licences The copyright and licence position for the modified `.bst` files seems slightly muddy to me. On the grounds that any licence is better than no licence, I therefore assert that the _modifications_ which the -`urlbst` program makes to these files are copyright 2002-03, 2005-12, 2014, 2019, 2022, +`urlbst` program makes to these files are copyright 2002–23, Norman Gray, and that these modifications are available for distribution under the terms of the LaTeX Project Public Licence. diff --git a/Master/texmf-dist/doc/bibtex/urlbst/VERSION b/Master/texmf-dist/doc/bibtex/urlbst/VERSION index 69b5bc8a8f6..0bcbc60c108 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/VERSION +++ b/Master/texmf-dist/doc/bibtex/urlbst/VERSION @@ -1 +1 @@ -urlbst-0.9 +urlbst-0.9.1 diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib index 2b76ae71786..0c8043f5b65 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib @@ -162,7 +162,7 @@ Webpage{emory95, year = 2002, doi = {10.1090/S0025-5718-01-01333-3} } - + % Article with a DOI and a URL which refers to the same resource as the DOI % (we shouldn't get both in the output) @Article{test:doi2, @@ -170,8 +170,19 @@ Webpage{emory95, title = {Fun with {DOIs}}, journal = {Journal of Indirection}, year = 1999, - doi = {10.1234/5678}, - url = {https://doi.org/10.1234/5678} + doi = {10.1234/5678-without}, + url = {https://doi.org/10.1234/5678-without} +} + +% An article which includes a DOI which includes the doi.org prefix. +% We shouldn't add a second one. +@Article{test:doi3, + author = {A N Other}, + title = {More Fun with {DOIs}}, + journal = {Journal of Indirection (over there)}, + year = 2000, + doi = {https://doi.org/10.1234/5678-with}, + url = {https://doi.org/10.1234/5678-with} } % Article with a PUBMED reference @@ -218,4 +229,3 @@ Webpage{emory95, year = 2007, url = {http://cs.jhu.edu/~jason/papers/#icassp07} } - diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html index 6ee21377103..4ba263e3f4a 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html @@ -24,7 +24,7 @@ It is on CTAN at The code (and bugparade) is <a href='https://heptapod.host/nxg/urlbst'>online</a>.</p> -<p>Version 0.9, 2022 December 1.</p> +<p>Version 0.9.1, 2023 January 30.</p> </div> <p>Contents</p> @@ -206,9 +206,9 @@ href="https://texfaq.org/FAQ-citeURL" >TeX FAQ</a>.</p> <h2><a name='download'>Download and installation</a></h2> <p>Download the file as a -<a href="urlbst-0.9.tar.gz" >tarball</a> +<a href="urlbst-0.9.1.tar.gz" >tarball</a> or -<a href="urlbst-0.9.zip" >zip file</a> +<a href="urlbst-0.9.1.zip" >zip file</a> and unpack it. Or you can clone the source repository <a href='https://heptapod.host/nxg/urlbst'>online</a>.</p> @@ -315,7 +315,7 @@ is distributed as a PDF file, but if you want to regenerate it, use</p> <p>The copyright and licence position for the modified <code>.bst</code> files seems slightly muddy to me. On the grounds that any licence is better than no licence, I therefore assert that the <em>modifications</em> which the -<code>urlbst</code> program makes to these files are copyright 2002-03, 2005-12, 2014, 2019, 2022, +<code>urlbst</code> program makes to these files are copyright 2002–23, Norman Gray, and that these modifications are available for distribution under the terms of the LaTeX Project Public Licence.</p> @@ -365,6 +365,12 @@ to Katrin Leinweber for the pull request which fixed the format of DOI references.</p> <dl> +<dt><strong>0.9.1, 2023 January 30</strong></dt> +<dd> + Added code to spot and wrangle the <code>https://doi.org/</code> URL + prefix – the code now behaves correctly whether this is present or not. +</dd> + <dt><strong>0.9, 2022 December 1</strong></dt> <dd><ul> <li>Changed repository location to <a href='https://heptapod.host/nxg/urlbst'>heptapod</a> @@ -379,7 +385,7 @@ references.</p> </ul> </dd> -<dt><strong>0.8, 2019 July 1</strong></dt> +<dt>0.8, 2019 July 1</dt> <dd><ul> <li>The presence of a preexisting <code>format.doi</code>, <code>format.eprint</code> or <code>format.pubmed</code> function is @@ -481,13 +487,13 @@ documentation added.</dd> </dl> </div> -<p>Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray. Released under the terms of the GNU +<p>Copyright 2002–23, Norman Gray. Released under the terms of the GNU General Public Licence.</p> <div class="signature"> <a href="https://nxg.me.uk" >Norman Gray</a><br/> -2022 December 1 +2023 January 30 </div> </body> diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in index 569bb7c4fb4..3cd06089f5b 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in @@ -501,6 +501,19 @@ sub print_output_functions { print OUT "$mymarker...\n"; print OUT <<'EOD'; +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -527,7 +540,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -683,9 +701,11 @@ EOD FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -731,10 +751,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf Binary files differindex 7b2a34c1240..f0960f46776 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex index a8d828e38fd..8f16c6260f9 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex @@ -2,7 +2,7 @@ \title{The \texttt{urlbst} package} \author{Norman Gray\\\texttt{<https://nxg.me.uk>}} -\date{Version 0.9, 2022 December 1} +\date{Version 0.9.1, 2023 January 30} %\usepackage{times} \usepackage{url} @@ -210,6 +210,14 @@ approach is to apply the setting \texttt{doiform=1}, which will generate DOIs wrapped in the macro |\doi{...}|. This allows you to supply a generic |\doi| macro to format them as you desire. +The \btfield{doi} field may include the \texttt{https://doi.org/}, or +it may omit it; the stylefile adds or removes the prefix as +appropriate. Note that this parsing is rudimentary: it won't detect +any of the variants of this prefix, meaning \texttt{http:} or +\texttt{dx.doi.org}, both of which are now deprecated. +% Note that this string is configured in configure.ac, but changing it +% there wouldn't change it here (I could, but... Makefile) + The \ub\ script works by spotting patterns and characteristic function names in the input |.bst| file. It works as-is in the case of the four standard \BibTeX\ style files |plain.bst|, |unsrt.bst|, @@ -333,14 +341,6 @@ generated bibliographies. See also the URL entry in the UK \TeX\ FAQ~\cite{texfaq}, and references therein. -%% \textbf{Acknowledgements:} Thanks -%% to Jason Eisner for suggesting the |--inlinelinks| option; -%% to `ijvm' for code contributions in the |urlbst| script; -%% to Pawe\l{} Widera for the suggestion to use |\path| when formatting DOIs; -%% to Michael Giffin for the suggestion to include PubMed URLs; -%% to Katrin Leinweber for the pull request which fixed the format of DOI -%% references. - \section{Acknowledgements, and release notes} %%% include:release-notes.tex @@ -355,6 +355,12 @@ to Katrin Leinweber for the pull request which fixed the format of DOI references. \begin{description} +\item[\textbf{0.9.1, 2023 January 30}]\relax + + Added code to spot and wrangle the |https://doi.org/| URL + prefix – the code now behaves correctly whether this is present or not. + + \item[\textbf{0.9, 2022 December 1}]\relax \begin{itemize} \item Changed repository location to heptapod\footnote{\url{https://heptapod.host/nxg/urlbst}} @@ -369,7 +375,7 @@ references. \end{itemize} -\item[\textbf{0.8, 2019 July 1}]\relax +\item[0.8, 2019 July 1]\relax \begin{itemize} \item The presence of a preexisting |format.doi|, |format.eprint| or |format.pubmed| function is diff --git a/Master/texmf-dist/scripts/urlbst/urlbst b/Master/texmf-dist/scripts/urlbst/urlbst index 1a7625ee882..cfe72a52b0a 100755 --- a/Master/texmf-dist/scripts/urlbst/urlbst +++ b/Master/texmf-dist/scripts/urlbst/urlbst @@ -8,16 +8,16 @@ # # See https://purl.org/nxg/dist/urlbst for documentation # -# Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray <https://nxg.me.uk> +# Copyright 2002–23, Norman Gray <https://nxg.me.uk> # # This program is distributed under the terms of the # GNU General Public Licence, v2.0. -# The modifications to the input .bst files are asserted as Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, +# The modifications to the input .bst files are asserted as Copyright 2002–23, Norman Gray, # and distributed under the terms of the LaTeX Project Public Licence. # See the package README for further dicussion of licences. -$version = '0.9'; -$releasedate = '2022 December 1'; +$version = '0.9.1'; +$releasedate = '2023 January 30'; ($progname = $0) =~ s/.*\///; $mymarker = "% $progname"; $mymarkerend = "% ...$progname to here"; @@ -253,7 +253,7 @@ open (OUT, ">$outfile") || die "Can't open $outfile to write"; print OUT "%%% Modification of BibTeX style file ", ($infile eq '-' ? '<stdin>' : $infile), "\n"; print OUT "%%% ... by $progname, version $version (marked with \"$mymarker\")\n%%% See <$homepageurl> and repository <$repourl>\n"; -print OUT "%%% Modifications Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray,\n"; +print OUT "%%% Modifications Copyright 2002–23, Norman Gray,\n"; print OUT "%%% and distributed under the terms of the LPPL; see README for discussion.\n"; print OUT "%%%\n"; print OUT "%%% Added webpage entry type, and url and lastchecked fields.\n"; @@ -501,6 +501,19 @@ sub print_output_functions { print OUT "$mymarker...\n"; print OUT <<'EOD'; +% Minimal DOI parsing. +% Given a DOI on the stack, check whether it starts with 'doiurl' or not. +% In either case, leave on the stack first a DOI with, and then a DOI without, the URL prefix. +FUNCTION {parse.doi} +{ + #1 doiurl text.length$ substring$ + doiurl = + { doi + doi doiurl text.length$ #1 + #999 substring$ } + { doiurl doi * + doi } + if$ +} % The following three functions are for handling inlinelink. They wrap % a block of text which is potentially output with write$ by multiple % other functions, so we don't know the content a priori. @@ -527,7 +540,12 @@ FUNCTION {possibly.setup.inlinelink} if$ } { pubmedurl pubmed * } if$ } - { doiurl doi * } +% { doiurl doi * } + { doi empty$ + { "XXX" } + { doi parse.doi pop$ } + if$ + } if$ % an appropriately-formatted URL is now on the stack hrefform #1 = % hypertex @@ -683,9 +701,11 @@ EOD FUNCTION {format.doi} { doi empty$ { "" } - { doiform #1 = - { "\doi{" doi * "}" * } - { doiprefix doi * doiurl doi * make.href } + { doi parse.doi % leaves "https://doi.org/DOI" DOI on the stack + 's := 't := + doiform #1 = + { "\doi{" s * "}" * } + { doiprefix s * t make.href } if$ } if$ @@ -731,10 +751,11 @@ FUNCTION {output.web.refs} inlinelinks 'skip$ % links were inline -- don't repeat them { % If the generated DOI will be the same as the URL, - % then don't print the URL (thanks to Joseph Wright for this code, + % then don't print the URL (thanks to Joseph Wright + % for (the original version of) this code, % at http://tex.stackexchange.com/questions/5660) adddoi - doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated + doi empty$ { "X" } { doi parse.doi pop$ } if$ % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? and diff --git a/Master/texmf-dist/source/bibtex/urlbst/configure b/Master/texmf-dist/source/bibtex/urlbst/configure index 6817ec0028c..dcdda31145c 100755 --- a/Master/texmf-dist/source/bibtex/urlbst/configure +++ b/Master/texmf-dist/source/bibtex/urlbst/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac @PACKAGE_VERSION@. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for urlbst 0.9. +# Generated by GNU Autoconf 2.71 for urlbst 0.9.1. # # Report bugs to <gray@nxg.name>. # @@ -611,8 +611,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='urlbst' PACKAGE_TARNAME='urlbst' -PACKAGE_VERSION='0.9' -PACKAGE_STRING='urlbst 0.9' +PACKAGE_VERSION='0.9.1' +PACKAGE_STRING='urlbst 0.9.1' PACKAGE_BUGREPORT='gray@nxg.name' PACKAGE_URL='' @@ -1229,7 +1229,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures urlbst 0.9 to adapt to many kinds of systems. +\`configure' configures urlbst 0.9.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1291,7 +1291,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of urlbst 0.9:";; + short | recursive ) echo "Configuration of urlbst 0.9.1:";; esac cat <<\_ACEOF @@ -1367,7 +1367,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -urlbst configure 0.9 +urlbst configure 0.9.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1404,7 +1404,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by urlbst $as_me 0.9, which was +It was created by urlbst $as_me 0.9.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -1744,7 +1744,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASEDATE="2022 December 1" +RELEASEDATE="2023 January 30" REPOURL=https://heptapod.host/nxg/urlbst @@ -1754,7 +1754,7 @@ CTANURL=https://ctan.org/pkg/urlbst -COPYRIGHTYEARS="2002-03, 2005-12, 2014, 2019, 2022" +COPYRIGHTYEARS="2002–23" @@ -2427,7 +2427,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by urlbst $as_me 0.9, which was +This file was extended by urlbst $as_me 0.9.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2482,7 +2482,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -urlbst config.status 0.9 +urlbst config.status 0.9.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/Master/texmf-dist/source/bibtex/urlbst/configure.ac b/Master/texmf-dist/source/bibtex/urlbst/configure.ac index d8f52270447..dc1d706b022 100644 --- a/Master/texmf-dist/source/bibtex/urlbst/configure.ac +++ b/Master/texmf-dist/source/bibtex/urlbst/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script -AC_INIT(urlbst, 0.9, gray@nxg.name) -RELEASEDATE="2022 December 1" +AC_INIT(urlbst, 0.9.1, gray@nxg.name) +RELEASEDATE="2023 January 30" AC_SUBST(RELEASEDATE) AC_SUBST(REPOURL, [https://heptapod.host/nxg/urlbst]) @@ -8,7 +8,9 @@ AC_SUBST(CTANURL, [https://ctan.org/pkg/urlbst]) AC_REVISION(@PACKAGE_VERSION@) -COPYRIGHTYEARS="2002-03, 2005-12, 2014, 2019, 2022" +dnl COPYRIGHTYEARS="2002-03, 2005-12, 2014, 2019, 2022, 2023" +dnl simpler... +COPYRIGHTYEARS="2002–23" AC_SUBST(COPYRIGHTYEARS) AC_PREREQ(2.50) |