diff options
author | Karl Berry <karl@freefriends.org> | 2022-12-04 21:05:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-12-04 21:05:53 +0000 |
commit | 2ee9e57442e9af14b45a0206867ee47b051b2489 (patch) | |
tree | e37eb5ca79de1e86ac1ebe42eccdeaeaffcda3c5 /Master/texmf-dist/doc/bibtex | |
parent | 9df4e7d3735969d514f93f30e3dc4633201fda73 (diff) |
urlbst (4dec22)
git-svn-id: svn://tug.org/texlive/trunk@65190 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/bibtex')
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/README | 16 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/VERSION | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.html | 148 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.in | 239 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf | bin | 205285 -> 222858 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex | 145 |
7 files changed, 357 insertions, 197 deletions
diff --git a/Master/texmf-dist/doc/bibtex/urlbst/README b/Master/texmf-dist/doc/bibtex/urlbst/README index d9705a58402..15daf759351 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/README +++ b/Master/texmf-dist/doc/bibtex/urlbst/README @@ -1,15 +1,15 @@ urlbst -- add @webpage entry and url/doi/eprint/pubmed fields to BibTeX ======================================================================= -Version 0.8, 2019 July 1. +Version 0.9, 2022 December 1. 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 -fields -- notably including 'url' -- to all other entry types. The +fields – notably including 'url' – to all other entry types. The distribution includes preconverted versions of the four standard BibTeX .bst style files. -It has a different goal from Patrick Daly's 'custom-bib' package -- +It has a different goal from Patrick Daly's 'custom-bib' package – that is intended to create a BibTeX style .bst file from scratch, and supports 'url' and 'eprint' fields. This package, on the other hand, is intended for the case where you already have a style file that @@ -19,10 +19,10 @@ to add the new `@webpage` entry type, plus the new fields. The added fields are: * 'url' and 'lastchecked', to associate a URL with a reference, - along with the date at which the URL was last checked to exist; + along with the date at which the URL was last checked to exist; * 'doi', for a reference's DOI (see https://doi.org); - * 'eprint', for an arXiv eprint reference (see http://arxiv.org); and - * 'pubmed' for a reference's PubMed identifier (PMID, see http://pubmed.gov). + * 'eprint', for an arXiv eprint reference (see https://arxiv.org); and + * 'pubmed' for a reference's PubMed identifier (PMID, see https://pubmed.gov). Licences -------- @@ -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, +`urlbst` program makes to these files are copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, and that these modifications are available for distribution under the terms of the LaTeX Project Public Licence. @@ -50,4 +50,4 @@ distribution, for the relevant licence text. Norman Gray -http://nxg.me.uk +https://nxg.me.uk diff --git a/Master/texmf-dist/doc/bibtex/urlbst/VERSION b/Master/texmf-dist/doc/bibtex/urlbst/VERSION index e2effdb0802..69b5bc8a8f6 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/VERSION +++ b/Master/texmf-dist/doc/bibtex/urlbst/VERSION @@ -1 +1 @@ -urlbst-0.8 +urlbst-0.9 diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib index c51ed5d2221..2b76ae71786 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.bib @@ -57,7 +57,7 @@ Webpage{emory95, } @Webpage{texfaq, - url = {http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citeURL}, + url = {https://texfaq.org/FAQ-citeURL}, title = {{UK \TeX\ FAQ: URLs in BibTeX bibliographies}}, key = {UK TeX FAQ}, editor = {Robin Fairbairns}, @@ -68,7 +68,7 @@ Webpage{emory95, @Webpage{url:daly, - url = {http://www.tex.ac.uk/tex-archive/macros/latex/contrib/custom-bib/}, + url = {https://ctan.org/pkg/custom-bib}, title = {Index of custom-bib}, author = {Patrick W Daly}, year = 2003, diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html index 1edeadcf3a0..6ee21377103 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.html @@ -3,7 +3,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Urlbst</title> -<link href="http://nxg.me.uk/" rev="author"/> +<link href="https://nxg.me.uk/" rev="author"/> <link type="text/css" rel="stylesheet" href="/style/base.css"/> </head> @@ -17,11 +17,14 @@ basic support for <code>eprint</code>, <code>doi</code> and <code>pubmed</code> hypertex/hyperref support.</p> <p>The Persistent URL for this page is -<code>http://purl.org/nxg/dist/urlbst</code>. -The code (and bugparade) is on -<a href='https://bitbucket.org/nxg/urlbst/'>bitbucket.org</a>.</p> - -<p>Version 0.8, 2019 July 1.</p> +<code>https://purl.org/nxg/dist/urlbst</code> +– <strong>please quote this rather than the URL it redirects to</strong>. +It is on CTAN at +<a href='https://ctan.org/pkg/urlbst'><code>https://ctan.org/pkg/urlbst</code></a>. +The code (and bugparade) is +<a href='https://heptapod.host/nxg/urlbst'>online</a>.</p> + +<p>Version 0.9, 2022 December 1.</p> </div> <p>Contents</p> @@ -54,18 +57,23 @@ eprint fields. Fuller details are in the <a href="urlbst.pdf" <h2><a name='usage'>Usage</a></h2> <pre> -urlbst [--[no]eprint] [--[no]doi] [--[no]pubmed] - [--inlinelinks] [--nohyperlinks] [--hypertex] [--hyperref] - [--literal key=value] +urlbst [--literal key=value] [--setting key=value] [input-file [output-file]] </pre> <p>If either the input-file or the output-file is omitted, they default to stdin and stdout respectively. If the input file already has a URL entry type, then the script objects. By default (in the current version), the output -includes support for eprint, doi and pubmed, but these can be disabled -by <code>--noeprint</code>, <code>--nodoi</code> and -<code>--nopubmed</code>, respectively.</p> +includes support for eprint, doi and pubmed.</p> + +<p>The support in the generated <code>.bst</code> file can be adjusted +with the options <code>--setting</code> and <code>--literal</code>; +see <code>--setting help</code> and <code>--literal help</code> for +the available switches. The options <code>--[no]eprint</code>, +<code>--[no]doi</code>, <code>--[no]pubmed</code>, +<code>--inlinelinks</code>, <code>--nohyperlinks</code>, +<code>--hypertex</code> and <code>--hyperref</code> are shortcuts for +some of these settings. <p>The added fields are:</p> <ul> @@ -78,27 +86,26 @@ by <code>--noeprint</code>, <code>--nodoi</code> and <a href='http://pubmed.gov'>PubMed</a> identifier (PMID).</li> </ul> -<p>If either of the <code>--hypertex</code> or <code>--hyperref</code> -options is present, then the generated <code>.bst</code> file includes +<p>If setting <code>hrefform</code> is 1 or 2, then the generated +<code>.bst</code> file includes support for hyperlinks in the generated eprint entries in the bibliography, with the format being either HyperTeX (see <a href="http://arxiv.org/hypertex/#implementation" >arXiv, again</a>), supported by xdvi, dvips and others, or using the support available -from the hyperref package. These options have no effect unless one of -the <code>--eprint</code> or <code>--doi</code> options is given: when +from the hyperref package. When URLs are included in the bibliography, they are written out using the <code>\url{...}</code> command, and hyperref automatically processes that in the correct way to include a hyperlink.</p> -<p>The <code>--inlinelinks</code> option tells urlbst not to write out -the URL as text within the bibliography entry. Instead, urlbst will -produce a more conventional-looking and compact bibliography entry, -but the entry's title will now be a hyperlink to that URL. This -hyperlink may be useful to anyone who reads your document online -(this option can only be used with <code>--hyperref</code> or -<code>--hypertex</code>). Any DOI or eprint text which would be -produced as a result of the appropriate option will still appear in -this mode.</p> +<p>The setting <code>inlinelinks</code> (option +<code>--inlinelinks</code>) tells urlbst not to write out the URL as +text within the bibliography entry. Instead, urlbst will produce a +more conventional-looking and compact bibliography entry, but the +entry's title will now be a hyperlink to that URL. This hyperlink may +be useful to anyone who reads your document online (this option can +only be used with <code>hrefform</code> 1 or 2. Any DOI or eprint +text which would be produced as a result of the appropriate option +will still appear in this mode.</p> <p>You may adjust various literal strings, either for the purposes of internationalisation, or simply because you prefer different text. To @@ -108,16 +115,28 @@ th'intert00bs"</code>, to replace the default <code>URL:</code> text. The possible values, and their defaults, are below (say <code>--literal help</code> to get this list printed out):</p> <table> -<tr><th>keyword</th><th>default</th><th>meaning</th></tr> -<tr><td>cited</td><td>cited</td><td>indicator of citation, or "last checked", date</td></tr> -<tr><td>doiprefix</td><td>doi:</td><td>text printed before DOI</td></tr> -<tr><td>eprintprefix</td><td>arXiv:</td><td>text printed before eprint -ref</td></tr> -<tr><td>linktext</td><td>[link]</td><td>fallback link text</td></tr> -<tr><td>pubmedprefix</td><td>PMID:</td><td>text printed before PUBMED reference</td></tr> -<tr><td>online</td><td>online</td><td>indication that resource is online</td></tr> -<tr><td>urlintro</td><td>URL:</td><td>location of online resource (an -alternative is "Available from:")</td></tr> +<tr><th>literal</th><th>description</th><th>default</th></tr> +<tr><td>urlintro</td><td>prefix before URL; typically "Available from:" or "URL:"</td><td>URL: </td></tr> +<tr><td>pubmedprefix</td><td>text prefix printed before PUBMED ref</td><td>PMID:</td></tr> +<tr><td>pubmedurl</td><td>prefix to make URL from PUBMED</td><td>http://www.ncbi.nlm.nih.gov/pubmed/</td></tr> +<tr><td>eprintprefix</td><td>text prefix printed before eprint ref</td><td>arXiv:</td></tr> +<tr><td>linktextstring</td><td>anonymous link text</td><td>[link]</td></tr> +<tr><td>citedstring</td><td>label that something is cited by something else</td><td>cited </td></tr> +<tr><td>eprinturl</td><td>prefix to make URL from eprint ref</td><td>http://arxiv.org/abs/</td></tr> +<tr><td>doiurl</td><td>prefix to make URL from DOI</td><td>https://doi.org/</td></tr> +<tr><td>doiprefix</td><td>printed text to introduce DOI</td><td>doi:</td></tr> +<tr><td>onlinestring</td><td>label that a resource is online</td><td>online</td></tr> +</table> + +<p>The list of settings (<code>--setting help</code>) is:</p> +<table> +<tr><th>setting</th><th>description</th><th>default</th></tr> +<tr><td>inlinelinks</td><td>0=URLs explicit; 1=URLs attached to titles</td><td>0</td></tr> +<tr><td>addpubmed</td><td>0=no PUBMED resolver; 1=include it</td><td>1</td></tr> +<tr><td>addeprints</td><td>0=no eprints; 1=include eprints</td><td>1</td></tr> +<tr><td>hrefform</td><td>0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs</td><td>0</td></tr> +<tr><td>adddoi</td><td>0=no DOI resolver; 1=include it</td><td>1</td></tr> +<tr><td>doiform</td><td>0=with href; 1=with \doi{}</td><td>0</td></tr> </table> <p>The distribution includes preconverted versions of the four @@ -182,17 +201,16 @@ which have been pre-converted.</p> <p>There is more general discussion of including URLs in bibliographies in the <a -href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citeURL" >UK TeX -FAQ</a>.</p> +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.8.tar.gz" >tarball</a> +<a href="urlbst-0.9.tar.gz" >tarball</a> or -<a href="urlbst-0.8.zip" >zip file</a> -and unpack it. Or you can clone the source repository at -<a href='http://bitbucket.org/nxg/urlbst/'>bitbucket.org</a>.</p> +<a href="urlbst-0.9.zip" >zip file</a> +and unpack it. Or you can clone the source repository +<a href='https://heptapod.host/nxg/urlbst'>online</a>.</p> <p>To install, you should simply copy the distributed <code>urlbst</code> script to someplace on the path (such as @@ -209,9 +227,9 @@ and you will probably need to use <code>texhash</code>, <code>mktexlsr</code> or its equivalent, to update LaTeX's filename cache. For further hints here, see the TeX FAQ entries on <a -href='http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages' +href='https://texfaq.org/#installing' >installing a package</a> and <a -href='http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wherefiles' +href='https://texfaq.org/FAQ-inst-wlcf' >where LaTeX puts files</a>.</p> <p>That should be all you have to do.</p> @@ -297,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, +<code>urlbst</code> program makes to these files are copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray, and that these modifications are available for distribution under the terms of the LaTeX Project Public Licence.</p> @@ -318,18 +336,17 @@ distribution, for the relevant licence text.</p> <h2><a name='information'>Further Information and acknowledgements</a></h2> -<p><code>urlbst</code> is archived <a -href='https://ctan.org/pkg/urlbst' ->on CTAN</a>, and discussed in the -<a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=citeURL" >TeX -FAQ</a>.</p> +<p><code>urlbst</code> is archived <a href='https://ctan.org/pkg/urlbst' >on CTAN</a>, +and discussed in the +<a href="https://texfaq.org/FAQ-citeURL" >TeX FAQ</a>.</p> -<p>The source code for the package is maintained at -<a href='http://bitbucket.org/nxg/urlbst/'>bitbucket.org</a>, +<p>The source code for the package is maintained +<a href='https://heptapod.host/nxg/urlbst'>online</a>. +<!-- which also includes an issue tracker, where you can report bugs (or -just mail me).</p> +just mail me).--></p> -<p>The <a href="http://purl.org/nxg/dist/urlbst" +<p>The <a href="https://purl.org/nxg/dist/urlbst" >home page of urlbst</a> might possibly have more recent versions than the one you're looking at now.</p> @@ -348,6 +365,20 @@ to Katrin Leinweber for the pull request which fixed the format of DOI references.</p> <dl> +<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> + (when Bitbucket dropped support for Mercurial). + The issue links below, pointing to Bitbucket, will therefore no + longer work.</li> + <li>Refactoring of the mechanism for configuring the generated + <code>.bst</code> file, specifically adding the + <code>--setting</code> option.</li> + <li>Added the <code>doiform</code> setting to generate DOIs wrapped + in <code>\doi{...}</code>.</li> +</ul> +</dd> + <dt><strong>0.8, 2019 July 1</strong></dt> <dd><ul> <li>The presence of a preexisting <code>format.doi</code>, @@ -365,8 +396,9 @@ thanks to </dd> <dt>0.7, 2011 July 20</dt> -<dd>Add <code>--nodoi</code>, <code>--noeprints</code> and <code>--nopubmed</code> options (which defaulted -on, and couldn't otherwise be turned off)</dd> +<dd>Add <code>--nodoi</code>, <code>--noeprints</code> and +<code>--nopubmed</code> options (which defaulted on, and couldn't +otherwise be turned off)</dd> <dt>0.7b1, 2011 March 17</dt> <dd>Allow parameterisation of literal strings, with option <code>--literal</code>.</dd> @@ -449,13 +481,13 @@ documentation added.</dd> </dl> </div> -<p>Copyright 2002-03, 2005-12, 2014, 2019, Norman Gray. Released under the terms of the GNU +<p>Copyright 2002-03, 2005-12, 2014, 2019, 2022, Norman Gray. Released under the terms of the GNU General Public Licence.</p> <div class="signature"> -<a href="http://nxg.me.uk" +<a href="https://nxg.me.uk" >Norman Gray</a><br/> -2019 July 1 +2022 December 1 </div> </body> diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in index 1039dfb6c5a..569bb7c4fb4 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.in @@ -6,9 +6,9 @@ # If either input-file or output-file is omitted, they are replaced by # stdin or stdout respectively. # -# See http://purl.org/nxg/dist/urlbst for documentation +# See https://purl.org/nxg/dist/urlbst for documentation # -# Copyright @COPYRIGHTYEARS@, Norman Gray <http://nxg.me.uk> +# Copyright @COPYRIGHTYEARS@, Norman Gray <https://nxg.me.uk> # # This program is distributed under the terms of the # GNU General Public Licence, v2.0. @@ -17,38 +17,61 @@ # See the package README for further dicussion of licences. $version = '@PACKAGE_VERSION@'; +$releasedate = '@RELEASEDATE@'; ($progname = $0) =~ s/.*\///; $mymarker = "% $progname"; $mymarkerend = "% ...$progname to here"; -$myurl = 'http://purl.org/nxg/dist/urlbst'; - +$homepageurl = 'https://purl.org/nxg/dist/urlbst'; +$repourl = '@REPOURL@'; $infile = '-'; $outfile = '-'; -$addeprints = @WITHEPRINTS@; # if true (nonzero) we add support for eprints +# eprint support +$settings{addeprints} = @WITHEPRINTS@; +$docstring{addeprints} = '0=no eprints; 1=include eprints'; $literals{eprintprefix} = 'arXiv:'; # make these settable with --eprint? syntax? -$eprinturl = '@EPRINTURL@'; +$docstring{eprintprefix} = "text prefix printed before eprint ref"; +$literals{eprinturl} = '@EPRINTURL@'; +$docstring{eprinturl} = 'prefix to make URL from eprint ref'; -$adddoiresolver = @WITHDOIRESOLVER@; +# DOI resolver +$settings{adddoi} = @WITHDOIRESOLVER@; +$docstring{adddoi} = '0=no DOI resolver; 1=include it'; $literals{doiprefix} = 'doi:'; -$doiurl = '@DOIURL@'; - -$addpubmedresolver = @WITHPUBMEDRESOLVER@; +$docstring{doiprefix} = 'printed text to introduce DOI'; +$literals{doiurl} = '@DOIURL@'; +$docstring{doiurl} = 'prefix to make URL from DOI'; +$settings{doiform} = 0; +$docstring{doiform} = '0=with href; 1=with \\doi{}'; + +# PUBMED resolver +$settings{addpubmed} = @WITHPUBMEDRESOLVER@; +$docstring{addpubmed} = '0=no PUBMED resolver; 1=include it'; $literals{pubmedprefix} = 'PMID:'; -$pubmedurl = '@PUBMEDURL@'; +$docstring{pubmedprefix} = 'text prefix printed before PUBMED ref'; +$literals{pubmedurl} = '@PUBMEDURL@'; +$docstring{pubmedurl} = 'prefix to make URL from PUBMED'; -$makehref = @WITHHREF@; +# how do we make hypterlinks +$settings{hrefform} = @WITHHREF@; +$docstring{hrefform} = '0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs'; $literals{urlintro} = "URL: "; -$inlinelinks = 0; - -$literals{online} = "online"; -$literals{cited} = "cited "; -$literals{linktext} = "[link]"; +$docstring{urlintro} = 'text prefix before URL'; +$settings{inlinelinks} = 0; +$docstring{inlinelinks} = '0=URLs explicit; 1=URLs attached to titles'; + +# other text +$literals{onlinestring} = "online"; +$docstring{onlinestring} = 'label that a resource is online'; +$literals{citedstring} = "cited "; +$docstring{citedstring} = 'label in "lastchecked" remark'; +$literals{linktextstring} = "[link]"; +$docstring{linktextstring} = 'anonymous link text'; $automatic_output_filename = 0; -$Usage = "$progname [--eprint] [--doi] [--pubmed]\n [--nohyperlinks] [--[no]inlinelinks] [--hypertex] [--hyperref]\n [--literal key=value]\n [--help] [input-file [output-file]]"; +$Usage = "$progname [--literal key=value]\n [--setting key=value]\n [--help] [input-file [output-file]]"; # Magic environment variable: if this is set, then we're being called from a Platypus wrapper # See http://www.sveinbjorn.org/platypus @@ -58,27 +81,29 @@ if ($ENV{"CALLED_FROM_PLATYPUS"}) { while ($#ARGV >= 0) { if ($ARGV[0] eq '--eprint') { - $addeprints = 1; + $settings{addeprints} = 1; } elsif ($ARGV[0] eq '--noeprint') { - $addeprints = 0; + $settings{addeprints} = 0; } elsif ($ARGV[0] eq '--doi') { - $adddoiresolver = 1; + $settings{adddoi} = 1; } elsif ($ARGV[0] eq '--nodoi') { - $adddoiresolver = 0; + $settings{adddoi} = 0; } elsif ($ARGV[0] eq '--pubmed') { - $addpubmedresolver = 1; + $settings{addpubmed} = 1; } elsif ($ARGV[0] eq '--nopubmed') { - $addpubmedresolver = 0; + $settings{addpubmed} = 0; } elsif ($ARGV[0] eq '--nohyperlinks') { - $makehref = 0; + $settings{hrefform} = 0; + } elsif ($ARGV[0] eq '--hyperlinks') { + $settings{hrefform} = 1; # redundant with --hypertex, for consistency } elsif ($ARGV[0] eq '--hypertex') { - $makehref = 1; + $settings{hrefform} = 1; } elsif ($ARGV[0] eq '--hyperref') { - $makehref = 2; + $settings{hrefform} = 2; } elsif ($ARGV[0] eq '--inlinelinks') { - $inlinelinks = 1; + $settings{inlinelinks} = 1; } elsif ($ARGV[0] eq '--noinlinelinks') { - $inlinelinks = 0; + $settings{inlinelinks} = 0; } elsif ($ARGV[0] eq '--automatic-output') { $automatic_output_filename = 1; } elsif ($ARGV[0] eq '--literal') { @@ -93,16 +118,42 @@ while ($#ARGV >= 0) { $showstrings = 1; } if ($showstrings) { - print " Possible literal strings (and defaults) are...\n"; + print "Possible literal strings (and defaults) are...\n"; while (($k, $v) = each (%literals)) { - print " $k ($v)\n"; + print " $k \t$docstring{$k} [$v]\n"; + } + exit(0); + } + } elsif ($ARGV[0] eq '--setting') { + shift; + my $showstrings = 0; + if ((($k, $v) = ($ARGV[0] =~ /^(\w+)=(.*)/)) && exists $settings{$k}) { + $settings{$k} = $v; + } elsif ($ARGV[0] eq 'help') { + $showstrings = 1; + } else { + print "No setting found in $ARGV[0]; ignoring that\n"; + $showstrings = 1; + } + if ($showstrings) { + print "Possible settings (and defaults) are...\n"; + while (($k, $v) = each (%settings)) { + print " $k \t$docstring{$k} [$v]\n"; } exit(0); } } elsif ($ARGV[0] eq '--help') { print <<EOD; -urlbst version $version - Usage: $Usage +urlbst version $version, $releasedate +Usage: $Usage + + Options: + --literal key=value set one of the literal strings + (see `--literal help' for possibilities) + --setting key=value (as --literal) + --help print this help + + Convenience options (can also be controlled using --setting): --[no]eprint include support for `eprint' fields --[no]doi include support for `doi' field --[no]pubmed include support for `pubmed' field @@ -111,18 +162,19 @@ urlbst version $version --hypertex include HyperTeX-style hyperlink support --hyperref include {hyperref}-style hyperlink support (generally better) - --literal key=value set one of the literal strings - (see `--literal help' for possibilities) - --help print this help + Input and output files may be given as `-' (default) to indicate stdin/out. + Homepage: $homepageurl + Repository: $repourl + EOD printf(" Defaults:\n"); - printf(" eprint refs %s\n", ($addeprints ? "included" : "not included")); - printf(" DOIs %s\n", ($adddoiresolver ? "included" : "not included")); - printf(" PUBMED refs %s\n", ($addpubmedresolver ? "included" : "not included")); - printf(" hyperlinks %s\n", ($makehref==0 ? "none" : $makehref==1 ? "hypertex" : "hyperref")); - printf(" inline links %s\n", ($inlinelinks ? "included" : "not included")); + printf(" eprint refs %s\n", ($settings{addeprints} ? "included" : "not included")); + printf(" DOIs %s\n", ($settings{adddoi} ? "included" : "not included")); + printf(" PUBMED refs %s\n", ($settings{addpubmed} ? "included" : "not included")); + printf(" hyperlinks %s\n", ($settings{hrefform}==0 ? "none" : $settings{hrefform}==1 ? "hypertex" : "hyperref")); + printf(" inline links %s\n", ($settings{inlinelinks} ? "included" : "not included")); exit(0); } elsif ($ARGV[0] =~ /^-/) { die "Unrecognised option $ARGV[0]: Usage: $Usage\n"; @@ -136,13 +188,13 @@ EOD shift(@ARGV); } -if ($inlinelinks && $makehref == 0) { +if ($settings{inlinelinks} && $settings{hrefform} == 0) { print <<'EOD'; Warning: --inlinelinks and --nohyperlinks were both specified (possibly implicitly). That combination makes no sense, so I'll ignore --nohyperlinks and use --hyperref instead EOD - $makehref = 2; + $settings{hrefform} = 2; } if ($automatic_output_filename) { @@ -200,16 +252,16 @@ open (OUT, ">$outfile") || die "Can't open $outfile to write"; # make it less ugly, and more robust. print OUT "%%% Modification of BibTeX style file ", ($infile eq '-' ? '<stdin>' : $infile), "\n"; -print OUT "%%% ... by $progname, version $version (marked with \"$mymarker\")\n%%% See <$myurl>\n"; +print OUT "%%% ... by $progname, version $version (marked with \"$mymarker\")\n%%% See <$homepageurl> and repository <$repourl>\n"; print OUT "%%% Modifications Copyright @COPYRIGHTYEARS@, 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"; -print OUT "%%% Added eprint support.\n" if ($addeprints); -print OUT "%%% Added DOI support.\n" if ($adddoiresolver); -print OUT "%%% Added PUBMED support.\n" if ($addpubmedresolver); -print OUT "%%% Added HyperTeX support.\n" if ($makehref == 1); -print OUT "%%% Added hyperref support.\n" if ($makehref == 2); +print OUT "%%% Added eprint support.\n" if ($settings{addeprints}); +print OUT "%%% Added DOI support.\n" if ($settings{adddoi}); +print OUT "%%% Added PUBMED support.\n" if ($settings{addpubmed}); +print OUT "%%% Added HyperTeX support.\n" if ($settings{hrefform} == 1); +print OUT "%%% Added hyperref support.\n" if ($settings{hrefform} == 2); print OUT "%%% Original headers follow...\n\n"; $found{initconsts} = 0; @@ -232,7 +284,7 @@ while (<IN>) { print OUT; next; }; - + /^ *ENTRY/ && do { # Work through the list of entry types, finding what ones are there. # If we find a URL entry there already, object, since these edits @@ -280,30 +332,25 @@ STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl citedstring onlinestring linktextstring openinlinelink closeinlinelink } -INTEGERS { hrefform inlinelinks makeinlinelink - addeprints adddoiresolver addpubmedresolver } +INTEGERS { hrefform doiform inlinelinks makeinlinelink + addeprints adddoi addpubmed } 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. - #$addeprints 'addeprints := % 0=no eprints; 1=include eprints - #$adddoiresolver 'adddoiresolver := % 0=no DOI resolver; 1=include it - #$addpubmedresolver 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it - #$makehref 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs - #$inlinelinks 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles - - % String constants, which you _might_ want to tweak. - "$literals{urlintro}" 'urlintro := % prefix before URL; typically "Available from:" or "URL": - "$literals{online}" 'onlinestring := % indication that resource is online; typically "online" - "$literals{cited}" 'citedstring := % indicator of citation date; typically "cited " - "$literals{linktext}" 'linktextstring := % dummy link text; typically "[link]" - "$eprinturl" 'eprinturl := % prefix to make URL from eprint ref - "$literals{eprintprefix}" 'eprintprefix := % text prefix printed before eprint ref; typically "arXiv:" - "$doiurl" 'doiurl := % prefix to make URL from DOI - "$literals{doiprefix}" 'doiprefix := % text prefix printed before DOI ref; typically "doi:" - "$pubmedurl" 'pubmedurl := % prefix to make URL from PUBMED - "$literals{pubmedprefix}" 'pubmedprefix := % text prefix printed before PUBMED ref; typically "PMID:" +EOD + + while (($k, $v) = each(%settings)) { + print OUT " #$v '$k :=\t% $docstring{$k}\n"; + } + + print OUT "\n % String constants, which you _might_ want to tweak.\n"; + while (($k, $v) = each(%literals)) { + print OUT " \"$v\" '$k :=\t% $docstring{$k}\n"; + } + + print OUT <<EOD; % The following are internal state variables, not configuration constants, % so they shouldn't be fiddled with. @@ -311,7 +358,7 @@ FUNCTION {init.urlbst.variables} "" 'openinlinelink := % ditto "" 'closeinlinelink := % ditto } -INTEGERS { +INTEGERS { bracket.state outside.brackets open.brackets @@ -346,21 +393,21 @@ EOD }; /^ *FUNCTION *\{format.doi\}/ && do { - #print STDERR "$progname: style file $infile already supports DOIs; urlbst format.doi disabled\n(see generated .bst style: you may need to make edits near \$adddoiresolver)\n"; + #print STDERR "$progname: style file $infile already supports DOIs; urlbst format.doi disabled\n(see generated .bst style: you may need to make edits near \$settings{adddoi})\n"; $found{formatdoi} = 1; - $adddoiresolver = 0; + $settings{adddoi} = 0; }; /^ *FUNCTION *\{format.eprint\}/ && do { - #print STDERR "$progname: style file $infile already supports eprints; urlbst format.eprint disabled\n(see generated .bst style: you may need to make edits near \$addeprints)\n"; + #print STDERR "$progname: style file $infile already supports eprints; urlbst format.eprint disabled\n(see generated .bst style: you may need to make edits near \$settings{addeprints})\n"; $found{formateprint} = 1; - $addeprints = 0; + $settings{addeprints} = 0; }; /^ *FUNCTION *\{format.pubmed\}/ && do { - #print STDERR "$progname: style file $infile already supports Pubmed; urlbst format.pubmed disabled\n(see generated .bst style: you may need to make edits near \$addpubmedresolver)\n"; + #print STDERR "$progname: style file $infile already supports Pubmed; urlbst format.pubmed disabled\n(see generated .bst style: you may need to make edits near \$settings{addpubmed})\n"; $found{formatpubmed} = 1; - $addpubmedresolver = 0; + $settings{addpubmed} = 0; }; /^ *FUNCTION *{output\.nonnull}/ && do { @@ -469,8 +516,8 @@ 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 + { doi empty$ adddoi uand + { pubmed empty$ addpubmed uand { eprint empty$ addeprints uand { url empty$ { "" } @@ -535,14 +582,14 @@ FUNCTION {output.nonnull} bracket.state open.brackets = { " [" * } { ", " * } % bracket.state will be within.brackets - if$ - s * + if$ + s * close.brackets 'bracket.state := } if$ } -% Call this function just before adding something which should be presented in +% Call this function just before adding something which should be presented in % brackets. bracket.state is handled specially within output.nonnull. FUNCTION {inbrackets} { bracket.state close.brackets = @@ -583,14 +630,14 @@ FUNCTION {make.href.null} } % make hypertex specials FUNCTION {make.href.hypertex} -{ +{ "\special {html:<a href=" quote$ * swap$ * quote$ * "> }" * swap$ * "\special {html:</a>}" * } % make hyperref specials FUNCTION {make.href.hyperref} -{ +{ "\href {" swap$ * "} {\path{" * swap$ * "}}" * } FUNCTION {make.href} @@ -636,13 +683,17 @@ EOD FUNCTION {format.doi} { doi empty$ { "" } - { doiprefix doi * doiurl doi * make.href } + { doiform #1 = + { "\doi{" doi * "}" * } + { doiprefix doi * doiurl doi * make.href } + if$ + } if$ } EOD output_replacement_function($found{formatdoi}, 'format.doi', - 'adddoiresolver', + 'adddoi', $formatdoifunction); $formatpubmedfunction = <<'EOD'; @@ -655,7 +706,7 @@ FUNCTION {format.pubmed} EOD output_replacement_function($found{formatpubmed}, 'format.pubmed', - 'addpubmedresolver', + 'addpubmed', $formatpubmedfunction); print OUT <<'EOD'; @@ -666,10 +717,10 @@ EOD % the URL and the lastchecked in brackets. FUNCTION {output.url} { url empty$ - 'skip$ - { new.block + 'skip$ + { new.block format.url output - format.lastchecked output + format.lastchecked output } if$ } @@ -682,7 +733,7 @@ FUNCTION {output.web.refs} { % If the generated DOI will be the same as the URL, % then don't print the URL (thanks to Joseph Wright for this code, % at http://tex.stackexchange.com/questions/5660) - adddoiresolver + adddoi doiurl doi empty$ { "X" } { doi } if$ * % DOI URL to be generated url empty$ { "Y" } { url } if$ % the URL, or "Y" if empty = % are the strings equal? @@ -694,11 +745,11 @@ FUNCTION {output.web.refs} { format.eprint output.nonnull } 'skip$ if$ - adddoiresolver doi empty$ not and + adddoi doi empty$ not and { format.doi output.nonnull } 'skip$ if$ - addpubmedresolver pubmed empty$ not and + addpubmed pubmed empty$ not and { format.pubmed output.nonnull } 'skip$ if$ @@ -736,7 +787,7 @@ FUNCTION {fin.entry} % Webpage entry type. % Title and url fields required; % author, note, year, month, and lastchecked fields optional -% See references +% See references % ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm % http://www.classroom.net/classroom/CitingNetResources.html % http://neal.ctstateu.edu/history/cite.html @@ -793,7 +844,7 @@ sub output_replacement_function { %%% and disabled urlbst's version; proceed with some caution. EOD - print STDERR "$progname: WARNING: style file $infile already includes a $function_name function;\nyou may need to disable the urlbst version by setting \$$disabling_variable to zero.\nYou might want to edit the output file (search for $function_name).\n"; + print STDERR "$progname: WARNING: style file $infile already includes a $function_name function;\nyou may need to disable the urlbst version by setting \$settings{$disabling_variable} to zero.\nYou might want to edit the output file (search for $function_name).\n"; ($t = $function_definition_string) =~ s/\n/\n%%% /g; print OUT "%%% " . $t . "$mymarker\n"; diff --git a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.pdf Binary files differindex d3955eef1fb..7b2a34c1240 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 7743ce05641..a8d828e38fd 100644 --- a/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex +++ b/Master/texmf-dist/doc/bibtex/urlbst/urlbst.tex @@ -1,8 +1,8 @@ \documentclass[a4paper]{article} \title{The \texttt{urlbst} package} -\author{Norman Gray\\\texttt{<http://nxg.me.uk>}} -\date{Version 0.8, 2019 July 1} +\author{Norman Gray\\\texttt{<https://nxg.me.uk>}} +\date{Version 0.9, 2022 December 1} %\usepackage{times} \usepackage{url} @@ -54,21 +54,83 @@ The added fields are: \item \btfield{doi}, for a reference's DOI (see \url{https://doi.org}); \item \btfield{eprint}, for an arXiv eprint reference - (see \url{http://arxiv.org}); and + (see \url{https://arxiv.org}); and \item \btfield{pubmed} for a reference's PubMed identifier (\textsc{PMID}, see \url{http://pubmed.gov}). \end{itemize} -Usage is simple: +The script's home page is \url{https://purl.org/nxg/dist/urlbst} +(\textbf{please quote this rather than the URL it redirects to}). +It is on CTAN at \url{https://ctan.org/pkg/urlbst}. +The code repository is at \url{https://heptapod.host/nxg/urlbst}. + + +\section{Usage} +Command line: \begin{verbatim} -% urlbst [--eprint] [--doi] [--pubmed] - [--nohyperlinks] [--inlinelinks] [--hypertex] [--hyperref] +% urlbst [--setting key=value] [--literal key=value] [input-file [output-file]] \end{verbatim} where the |input-file| is an existing |.bst| file, and the |output-file| is the name of the new style file to be created. If either file name is missing, the default is the standard input or standard output respectively. + +There are a number of settings which can be applied on the +command-line, to adjust the support in the generated style file. See +the following tables for the (current) list, and \texttt{urlbst --setting help} +and \texttt{urlbst --literal help}. Some of these can be alternately +set with particular options as shown in Table~\ref{t:options}. Each +of these options sets a flag in the generated \texttt{.bst} file, but +you should feel free to adjust/hack these flags by editing the generated +file (for example |#0 'adddoi :=| will disable generation of DOI +links; don't blame me for the eccentric \texttt{.bst} syntax). + +\begin{table} + \begin{tabular}{lll} + setting&description&default\\ + \hline +inlinelinks & 0=URLs explicit; 1=URLs attached to titles & 0\\ +addpubmed & 0=no PUBMED resolver; 1=include it & 1\\ +addeprints & 0=no eprints; 1=include eprints & 1\\ +hrefform & 0=no crossrefs; 1=hypertex hrefs; 2=hyperref hrefs & 0\\ +adddoi & 0=no DOI resolver; 1=include it & 1\\ +doiform & 0=with href; 1=with |\doi{}| & 0\\ + \end{tabular} + \caption{Defined settings} +\end{table} +\begin{table} + \begin{tabular}{lll} + literal&description&default\\ + \hline +urlintro & prefix before URL & URL: \\ +pubmedprefix & prefix before PUBMED ref & PMID:\\ +pubmedurl & prefix to make URL from PMID \\ + && \multicolumn1r{\llap{http://www.ncbi.nlm.nih.gov/pubmed/}}\\ +eprintprefix & prefix printed before eprint ref & arXiv:\\ +linktextstring & anonymous link text & [link]\\ +citedstring & label in `lastchecked' remark & cited \\ +eprinturl & prefix to make URL from eprint ref & https://arxiv.org/abs/\\ +doiurl & prefix to make URL from DOI & https://doi.org/\\ +doiprefix & printed text to introduce DOI & doi:\\ +onlinestring & label that a resource is online & online\\ + \end{tabular} +\caption{Literal strings for inclusion in the generated file} +\end{table} + +\begin{table} + \begin{tabular}{ll} + option & setting\\ + \hline + \texttt{--[no]eprint} & addeprints\\ + \texttt{--[no]doi} & adddoi\\ + \texttt{--nohyperlinks} & hrefform=0\\ + \texttt{--hyper[tex/ref]} & hrefform=1/2\\ + \texttt{--inlinelinks} & inlinelinks\\ + \end{tabular} + \caption{Backward-compatibility options\label{t:options}} +\end{table} + For example: \begin{verbatim} % urlbst --eprint bibstyle.bst @@ -78,39 +140,36 @@ for e-prints, and sending the result to the standard output (ie, the screen, so it would more useful if you were to either redirect this to a file or supply the output-file argument). -If the option |--eprint| is present, then we switch on support for -\texttt{eprint} fields in the modified .bst file, with a citation +If the setting \texttt{addeprint} is true (ie, 1), then we switch on support for +\btfield{eprint} fields in the modified .bst file, with a citation format matching that recommended in -\url{http://arxiv.org/help/faq/references}. If the option -|--doi| is present, we include support for a |doi| field, referring +\url{https://arxiv.org/help/faq/references}. If the option +\texttt{adddoi} is true, we include support for a \btfield{doi} field, referring to a Digital Object Identifier (DOI) as standardised by -\url{http://www.doi.org/}. And if |--pubmed| is present, we include -support for a |pubmed| field, referring to a PubMed identifier as +\url{https://doi.org/}. And if \texttt{addpubmed} is true, we include +support for a \btfield{pubmed} field, referring to a PubMed identifier as supported at \url{http://www.pubmed.gov}. -If either of the |--hypertex| or |--hyperref| options is present, then -the generated .bst file includes support for hyperlinks in the -generated eprint entries in the bibliography, with the format being -either Hyper\TeX\ (see -\url{http://arxiv.org/hypertex/#implementation}), supported by xdvi, -dvips and others, or using the support available from the -\package{hyperref} package. These options have no effect unless one -of the |--eprint|, |--doi|, |--pubmed| or |--inlinelinks| options is given: -when URLs are included -in the bibliography, they are written out using the |\url{...}| -command. The \package{hyperref} support is more generic, and more -generally supported, and so you should choose this unless you have a -particular need for the Hyper\TeX\ support. The |--nohyperlinks| -option, which is present by default, suppresses all hyperlinking. +The genereated .bst file may include support for hyperlinks where +appropriate, in the generated entries in the bibliography. If the +\texttt{hrefform} setting is zero, this is suppressed, and it if is~1 +or~2, the support is include using Hyper\TeX\ (see +\url{https://arxiv.org/hypertex/#implementation}), supported by xdvi, +dvips and others, or the \package{hyperref} package, respectively. When +URLs are included in the bibliography, they are written out using the +|\url{...}| command. The \package{hyperref} support is more generic, +and more generally supported, and so you should choose this unless you +have a particular need for the Hyper\TeX\ support. The +\texttt{--nohyperlinks} option, which is present by default, +suppresses all hyperlinking. By default, any URL field is displayed as part of the bibliography -entry, linked to the corresponding URL via the mechanism managed by -the |--hypertex| and |--hyperref| options. If the |--inlinelinks| -option is present, however, then the URL is not displayed in the +entry, linked to the corresponding URL. If the \texttt{inlinelinks} +setting is true, however, then the URL is not displayed in the printed entry, but instead a hyperlink is created, linked to suitable text within the bibliography entry, such as the citation title. This option does not affect the display of eprints, DOI or PubMed fields. It makes -no sense to specify |--inlinelinks| with |--nohyperlinks|, and the +no sense to specify \texttt{inlinelinks} with \texttt{hrefform=0}, and the script warns you if you do that, for example by failing to specify one of the link-style options. This option is (primarily) useful if you're preparing a version of a document which will be read on-screen; @@ -137,7 +196,7 @@ When the style file generates a link for DOIs, it does so by prepending the string \texttt{https://doi.org/} to the DOI. This is generally reasonable, but some DOIs have characters in them which are illegal in URLs, with the result that the resulting -\texttt{dx.doi.org} URL doesn't work. The only real way of resolving +\texttt{doi.org} URL doesn't work. The only real way of resolving this is to write a URL-encoding function in the style-file implementation language, but while that would doubtless be feasible in principle, it would be hard and very, very, ugly. The only advice I @@ -146,7 +205,10 @@ appear in the typeset bibliography, and that users who would want to take advantage of the DOI will frequently (or usually?) know how to resolve the DOI when then need to. As a workaround, you could include a URL-encoded DOI URL in the \btfield{url} field of the entry (thanks -to Eric Chamberland for this suggestion). +to Eric Chamberland for this suggestion). A slightly more generic +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 \ub\ script works by spotting patterns and characteristic function names in the input |.bst| file. It works as-is in the case of the @@ -293,6 +355,20 @@ to Katrin Leinweber for the pull request which fixed the format of DOI references. \begin{description} +\item[\textbf{0.9, 2022 December 1}]\relax +\begin{itemize} + \item Changed repository location to heptapod\footnote{\url{https://heptapod.host/nxg/urlbst}} + (when Bitbucket dropped support for Mercurial). + The issue links below, pointing to Bitbucket, will therefore no + longer work. + \item Refactoring of the mechanism for configuring the generated + |.bst| file, specifically adding the + |--setting| option. + \item Added the |doiform| setting to generate DOIs wrapped + in |\doi{...}|. +\end{itemize} + + \item[\textbf{0.8, 2019 July 1}]\relax \begin{itemize} \item The presence of a preexisting |format.doi|, @@ -309,8 +385,9 @@ code contributed by Katrin Leinweber\footnote{\url{https://bitbucket.org/nxg/url \item[0.7, 2011 July 20]\relax -Add |--nodoi|, |--noeprints| and |--nopubmed| options (which defaulted -on, and couldn't otherwise be turned off) +Add |--nodoi|, |--noeprints| and +|--nopubmed| options (which defaulted on, and couldn't +otherwise be turned off) \item[0.7b1, 2011 March 17]\relax Allow parameterisation of literal strings, with option |--literal|. |