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 /Master/texmf-dist/doc | |
parent | 37ea12f13b2344449b0a4c21a2fafb33b40b4fc6 (diff) |
urlbst (30jan23)
git-svn-id: svn://tug.org/texlive/trunk@65694 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-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 |
7 files changed, 73 insertions, 30 deletions
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 |