summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-01 22:17:45 +0000
committerKarl Berry <karl@freefriends.org>2018-09-01 22:17:45 +0000
commit95255951c26abc51018d66c287c71bc96576a899 (patch)
tree9be83aa868e95b5a10653d039dbd1662f9fe2ca5 /Master/texmf-dist/tex
parent1aa09bbe7c7947051bd2c25388be7f8d502eb728 (diff)
uri (1sep18)
git-svn-id: svn://tug.org/texlive/trunk@48538 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/uri/uri.sty265
1 files changed, 199 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/latex/uri/uri.sty b/Master/texmf-dist/tex/latex/uri/uri.sty
index 92187fd9014..41ee32d6d00 100644
--- a/Master/texmf-dist/tex/latex/uri/uri.sty
+++ b/Master/texmf-dist/tex/latex/uri/uri.sty
@@ -8,10 +8,16 @@
%%
%% This is a generated file.
%%
-%% IMPORTANT NOTICE:
-%% The package takes options.
+%% Project: uri
+%% Version: 2018/09/01 v2.0a
%%
-%% The usual disclaimers apply:
+%% Copyright (C) 2011 - 2018 by
+%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+%% Portions of code copyrighted by other people as marked.
+%%
+%% IMPORTANT NOTICE: The package takes options.
+%%
+%% The usual disclaimer applies:
%% If it doesn't work right that's your problem.
%% (Nevertheless, send an e-mail to the maintainer
%% when you find an error in this package.)
@@ -28,99 +34,219 @@
%%
%% This work has the LPPL maintenance status "maintained".
%%
-%% The Current Maintainer of this work is H.-Martin Muench
-%% (Martin dot Muench at Uni-Bonn dot de).
+%% The Current Maintainer of this work is H.-Martin Muench.
%%
-%% This work consists of the main source file uri.dtx
-%% and the derived files
+%% This work consists of the main source file uri.dtx,
+%% the README, and the derived files
%% uri.sty, uri.pdf, uri.ins, uri.drv,
-%% uri-example.tex.
+%% uri-example.tex, uri-example.pdf.
%%
-\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\ProvidesPackage{uri}[2011/03/04 v1.0a
+%% In memoriam
+%% Claudia Simone Barth + 1996/01/30
+%% Tommy Muench + 2014/01/02
+%% Hans-Klaus Muench + 2014/08/24
+%%
+\NeedsTeXFormat{LaTeX2e}[2015/01/01]
+\ProvidesPackage{uri}[2018/09/01 v2.0a
Hyperlinks URIs like DOI,HDL,NBN,PubMed (HMM)]
-%% Allows to automatically hyperlink uris of type
-%% arXiv, ASIN, DOI, HDL, NBN, PubMed, OID, TINY, TINY with preview, XMPP
+%% Allows to automatically hyperlink uris of types
+%% arXiv, ASIN, DOI, HDL, NBN, OCLC, OID, PubMed, TINY, TINY with preview,
+%% and WebCite
%% in such a way that they are resolved to an address understood by browsers
-%% without native support or add-ons for such types of uri
-%% and provides commands citeurl, mailto, ukoeln, and uref.
-\RequirePackage{kvoptions}[2010/02/22]% v3.7
-\RequirePackage{url}[2006/04/12]% v3.3, documentation as of 2010/01/20
+%% independent of native support or add-ons for such types of uri
+%% and provides commands \citeurl, \mailto, \ukoeln, and \uref.
+\RequirePackage{kvoptions}[2011/06/30]% v3.11
+\RequirePackage{url}[2013/09/16]% v3.4
\SetupKeyvalOptions{family = uri, prefix = uri@}
-\DeclareStringOption[{arXiv:}]{arxivpre}[{arXiv:}]
-\DeclareStringOption[{}]{arxivpost}[{}]
+\DeclareStringOption[arXiv:]{arxivpre}[arXiv:]
+\DeclareStringOption[]{arxivpost}[]
+
+\DeclareStringOption[ASIN:]{asinpre}[ASIN:]
+\DeclareStringOption[]{asinpost}[]
+
+\DeclareStringOption[DOI:]{doipre}[DOI:]
+\DeclareStringOption[]{doipost}[]
+
+\DeclareStringOption[HDL:]{hdlpre}[HDL:]
+\DeclareStringOption[]{hdlpost}[]
+
+\DeclareStringOption[]{nbnpre}[]
+\DeclareStringOption[]{nbnpost}[]
+
+\DeclareStringOption[OCLC:]{oclcpre}[OCLC:]
+\DeclareStringOption[]{oclcpost}[]
-\DeclareStringOption[{ASIN:}]{asinpre}[{ASIN:}]
-\DeclareStringOption[{}]{asinpost}[{}]
+\DeclareStringOption[URN:OID:]{oidpre}[URN:OID:]
+\DeclareStringOption[]{oidpost}[]
-\DeclareStringOption[{DOI:}]{doipre}[{DOI:}]
-\DeclareStringOption[{}]{doipost}[{}]
+\DeclareStringOption[PubMed:]{pubmedpre}[PubMed:]
+\DeclareStringOption[]{pubmedpost}[]
-\DeclareStringOption[{HDL:}]{hdlpre}[{HDL:}]
-\DeclareStringOption[{}]{hdlpost}[{}]
+\def\uri@tiny@pre@default{TINY:}
+\def\uri@tiny@post@default{}
-\DeclareStringOption[{}]{nbnpre}[{}]
-\DeclareStringOption[{}]{nbnpost}[{}]
+\def\uri@tinyp@pre@default{TINY:P:}
+\def\uri@tinyp@post@default{}
-\DeclareStringOption[{PubMed:}]{pubmedpre}[{PubMed:}]
-\DeclareStringOption[{}]{pubmedpost}[{}]
+\DeclareStringOption[\uri@tiny@pre@default]{tinypre}[\uri@tiny@pre@default]
+\DeclareStringOption[\uri@tiny@post@default]{tinypost}[\uri@tiny@post@default]
-\DeclareStringOption[{URN:OID:}]{oidpre}[{URN:OID:}]
-\DeclareStringOption[{}]{oidpost}[{}]
+\DeclareStringOption[\uri@tinyp@pre@default]{tinyppre}[\uri@tinyp@pre@default]
+\DeclareStringOption[\uri@tinyp@post@default]{tinyppost}[\uri@tinyp@post@default]
-\DeclareStringOption[{TINY:}]{tinypre}[{TINY:}]
-\DeclareStringOption[{}]{tinypost}[{}]
+\DeclareStringOption[\uri@tiny@pre@default]{tinyuripre}[\uri@tiny@pre@default]
+\DeclareStringOption[\uri@tiny@post@default]{tinyuripost}[\uri@tiny@post@default]
-\DeclareStringOption[{TINY:P:}]{tinyppre}[{TINY:P:}]
-\DeclareStringOption[{}]{tinyppost}[{}]
+\DeclareStringOption[\uri@tinyp@pre@default]{tinypuripre}[\uri@tinyp@pre@default]
+\DeclareStringOption[\uri@tinyp@post@default]{tinypuripost}[\uri@tinyp@post@default]
-\DeclareStringOption[{URN:XMPP:}]{xmpppre}[{}]
-\DeclareStringOption[{}]{xmpppost}[{}]
+\DeclareStringOption[WC:]{wcpre}[WC:]
+\DeclareStringOption[]{wcpost}[]
-\DeclareStringOption[{<}]{citeurlpre}[{<}]
-\DeclareStringOption[{>}]{citeurlpost}[{>}]
+\DeclareStringOption[URN:XMPP:]{xmpppre}[]
+\DeclareStringOption[]{xmpppost}[]
-\DeclareStringOption[{mailto:}]{mailtopre}[{mailto:}]
-\DeclareStringOption[{}]{mailtopost}[{}]
+\DeclareStringOption[<]{citeurlpre}[<]
+\DeclareStringOption[>]{citeurlpost}[>]
-\DeclareStringOption[{http://ukoeln.de/}]{ukoelnpre}[{http://ukoeln.de/}]
-\DeclareStringOption[{}]{ukoelnpost}[{}]
+\DeclareStringOption[mailto:]{mailtopre}[mailto:]
+\DeclareStringOption[]{mailtopost}[]
+
+\DeclareStringOption[http://UKoeln.de/]{ukoelnpre}[http://UKoeln.de/]
+\DeclareStringOption[]{ukoelnpost}[]
\ProcessKeyvalOptions*
+\gdef\urisetup{\kvsetkeys{uri}}
+
+\def\uri@wrapper{\uri@tiny@pre@default}
+\ifx\uri@tinypre\uri@wrapper%
+\else%
+ \ifx\uri@tinyuripre\uri@wrapper%
+ \PackageWarning{uri}{Option tinypre deprecated.\MessageBreak%
+ Please use tinyuripre instead!\MessageBreak%
+ Transfering content of option tinypre to tinyuripre now;\MessageBreak%
+ }%
+ \let\uri@tinyuripre\uri@tinypre%
+ \else%
+ \PackageError{uri}{Conflicting options tinypre and tinyuripre used}{%
+ Option tinypre deprecated.\MessageBreak%
+ Please use ONLY option tinyuripre instead!\MessageBreak%
+ Ignoring option tinypre now.\MessageBreak%
+ }%
+ \fi%
+\fi%
+
+\def\uri@wrapper{\uri@tiny@post@default}
+\ifx\uri@tinypost\uri@wrapper%
+\else%
+ \ifx\uri@tinyuripost\uri@wrapper%
+ \PackageWarning{uri}{Option tinypost deprecated.\MessageBreak%
+ Please use tinyuripost instead!\MessageBreak%
+ Transfering content of option tinypost to tinyuripost now;\MessageBreak%
+ }%
+ \let\uri@tinyuripost\uri@tinypost%
+ \else%
+ \PackageError{uri}{Conflicting options tinypost and tinyuripost used}{%
+ Option tinypost deprecated.\MessageBreak%
+ Please use ONLY option tinyuripost instead!\MessageBreak%
+ Ignoring option tinypost now.\MessageBreak%
+ }%
+ \fi%
+\fi%
+
+\def\uri@wrapper{\uri@tinyp@pre@default}
+\ifx\uri@tinyppre\uri@wrapper%
+\else%
+ \ifx\uri@tinypuripre\uri@wrapper%
+ \PackageWarning{uri}{Option tinyppre deprecated.\MessageBreak%
+ Please use tinypuripre instead!\MessageBreak%
+ Transfering content of option tinyppre to tinypuripre now;\MessageBreak%
+ }%
+ \let\uri@tinypuripre\uri@tinyppre%
+ \else%
+ \PackageError{uri}{Conflicting options tinyppre and tinypuripre used}{%
+ Option tinyppre deprecated.\MessageBreak%
+ Please use ONLY option tinypuripre instead!\MessageBreak%
+ Ignoring option tinyppre now.\MessageBreak%
+ }%
+ \fi%
+\fi%
+
+\def\uri@wrapper{\uri@tinyp@post@default}
+\ifx\uri@tinyppost\uri@wrapper%
+\else%
+ \ifx\uri@tinypuripost\uri@wrapper%
+ \PackageWarning{uri}{Option tinyppost deprecated.\MessageBreak%
+ Please use tinypuripost instead!\MessageBreak%
+ Transfering content of option tinyppost to tinypuripost now;\MessageBreak%
+ }%
+ \let\uri@tinypuripost\uri@tinyppost%
+ \else%
+ \PackageError{uri}{Conflicting options tinyppost and tinypuripost used}{%
+ Option tinyppost deprecated.\MessageBreak%
+ Please use ONLY option tinypuripost instead!\MessageBreak%
+ Ignoring option tinyppost now.\MessageBreak%
+ }%
+ \fi%
+\fi%
+
+\DisableKeyvalOption[action={error},package=uri]{uri}{tinypre}
+\DisableKeyvalOption[action={error},package=uri]{uri}{tinypost}
+\DisableKeyvalOption[action={error},package=uri]{uri}{tinyppre}
+\DisableKeyvalOption[action={error},package=uri]{uri}{tinyppost}
+
\@ifpackageloaded{hyperref}{%
-\newcommand{\uref}[2]{\protect\href{#1}{\protect\nolinkurl{#2}}}%
+\DeclareRobustCommand{\uref}[2]{\protect\href{#1}{\protect\nolinkurl{#2}}}%
%% arXiv
-\DeclareUrlCommand\arxiv{\def\UrlLeft##1\UrlRight{\href{http://arxiv.org/abs/##1}{\uri@arxivpre##1\uri@arxivpost}}}%
+\DeclareUrlCommand\arxiv{\def\UrlLeft##1\UrlRight{\href{https://arxiv.org/abs/##1}{\uri@arxivpre##1\uri@arxivpost}}}%
%% ASIN
-\DeclareUrlCommand\asin{\def\UrlLeft##1\UrlRight{\href{http://amzn.com/##1}{\uri@asinpre##1\uri@asinpost}}}%
+\DeclareUrlCommand\asin{\def\UrlLeft##1\UrlRight{\href{https://amzn.com/##1}{\uri@asinpre##1\uri@asinpost}}}%
%% DOI
-\DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{\href{http://dx.doi.org/##1}{\uri@doipre##1\uri@doipost}}}%
+\DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{\href{https://dx.doi.org/##1}{\uri@doipre##1\uri@doipost}}}%
%% HDL
-\DeclareUrlCommand\hdl{\def\UrlLeft##1\UrlRight{\href{http://hdl.handle.net/##1}{\uri@hdlpre##1\uri@hdlpost}}}%
+\DeclareUrlCommand\hdl{\def\UrlLeft##1\UrlRight{\href{https://hdl.handle.net/##1}{\uri@hdlpre##1\uri@hdlpost}}}%
%% NBN
-\DeclareUrlCommand\nbn{\def\UrlLeft##1\UrlRight{\href{http://nbn-resolving.org/##1}{\uri@nbnpre##1\uri@nbnpost}}}%
+\DeclareUrlCommand\nbn{\def\UrlLeft##1\UrlRight{\href{https://nbn-resolving.org/urn/resolver.pl?urn=##1}{\uri@nbnpre##1\uri@nbnpost}}}%
+%% OCLC
+\DeclareUrlCommand\oclc{\def\UrlLeft##1\UrlRight{\href{https://www.worldcat.org/oclc/##1}{\uri@oclcpre##1\uri@oclcpost}}}%
%% OID
-\DeclareUrlCommand\oid{\def\UrlLeft##1\UrlRight{\href{http://www.oid-info.com/cgi-bin/display?oid=##1&submit=Display&action=display}{\uri@oidpre##1\uri@oidpost}}}%
+\DeclareUrlCommand\oid{\def\UrlLeft##1\UrlRight{\href{http://www.oid-info.com/cgi-bin/display?oid=##1&submit=Display&action=display}{%
+\uri@oidpre##1\uri@oidpost}}}%
%% PubMed
-\DeclareUrlCommand\pubmed{\def\UrlLeft##1\UrlRight{\href{http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=##1&dopt=Abstract}{\uri@pubmedpre##1\uri@pubmedpost}}}%
+\DeclareUrlCommand\pubmed{\def\UrlLeft##1\UrlRight{%
+\href{https://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=##1&dopt=Abstract}{\uri@pubmedpre##1\uri@pubmedpost}}}%
%% TINY
-\DeclareUrlCommand\tinyuri{\def\UrlLeft##1\UrlRight{\href{http://tinyurl.com/##1}{\uri@tinypre##1\uri@tinypost}}}%
+\DeclareUrlCommand\tinyuri{\def\UrlLeft##1\UrlRight{\href{https://tinyurl.com/##1}{\uri@tinyuripre##1\uri@tinyuripost}}}%
%% TINYP (tiny with preview)
-\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\href{http://preview.tinyurl.com/##1}{\uri@tinyppre##1\uri@tinyppost}}}%
+\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\href{https://preview.tinyurl.com/##1}{\uri@tinypuripre##1\uri@tinypuripost}}}%
+%% WebCite
+\DeclareUrlCommand\wc{\def\UrlLeft##1\UrlRight{\href{https://www.webcitation.org/##1}{\uri@wcpre##1\uri@wcpost}}}%
%% XMPP
-\DeclareUrlCommand\xmpp{\def\UrlLeft##1\UrlRight{\href{http://xmpp.org/protocols/urn:xmpp:##1/}{\uri@xmpppre##1\uri@xmpppost}}}%
+\DeclareUrlCommand\xmpp{%
+ \PackageError{uri}{Command \string\xmpp\space deprecated}{%
+ XMPP (https://xmpp.org/about/) changed, for example URN:XMPP:time\MessageBreak%
+ was moved from https://xmpp.org/protocols/urn:xmpp:time/\MessageBreak%
+ to https://xmpp.org/extensions/xep-0202.html. Therefore\MessageBreak%
+ \string\xmpp\space is no longer provided by this package.\MessageBreak%
+ For backward compatibility \string\xmpp\space links to\MessageBreak%
+ https://xmpp.org/extensions/.\MessageBreak%
+ Please replace \string\xmpp\space in your document by the appropriate url.\MessageBreak%
+ }%
+ \def\UrlLeft##1\UrlRight{\href{https://xmpp.org/extensions/}{\uri@xmpppre##1\uri@xmpppost}}%
+ }%
%% citeurl
\DeclareUrlCommand\citeurl{\def\UrlLeft##1\UrlRight{\href{##1}{\uri@citeurlpre##1\uri@citeurlpost}}}%
%% mailto
-\DeclareUrlCommand\mailto{\def\UrlLeft##1\UrlRight{\href{mailto:##1}{\uri@mailtopre##1\uri@mailtopost}}}%
+\DeclareUrlCommand\mailto@{\def\UrlLeft##1\UrlRight{\href{mailto:##1\mailto@subject}{\uri@mailtopre##1\uri@mailtopost}}}%
+\DeclareRobustCommand\mailto[1][]{\def\mailto@subject{?subject=#1}\mailto@}%
%% ukoeln
-\DeclareUrlCommand\ukoeln{\def\UrlLeft##1\UrlRight{\href{http://ukoeln.de/##1}{\uri@ukoelnpre##1\uri@ukoelnpost}}}%
+\DeclareUrlCommand\ukoeln{\def\UrlLeft##1\UrlRight{\href{https://UKoeln.de/##1}{\uri@ukoelnpre##1\uri@ukoelnpost}}}%
}{% otherwise, i.e. if hyperref has not been loaded:
-\newcommand{\uref}[2]{\protect\nolinkurl{#2}}%
+\DeclareRobustCommand{\uref}[1]{\url}%
%% arXiv
\DeclareUrlCommand\arxiv{\def\UrlLeft##1\UrlRight{\uri@arxivpre##1\uri@arxivpost}}%
%% ASIN
@@ -131,40 +257,47 @@
\DeclareUrlCommand\hdl{\def\UrlLeft##1\UrlRight{\uri@hdlpre##1\uri@hdlpost}}%
%% NBN
\DeclareUrlCommand\nbn{\def\UrlLeft##1\UrlRight{\uri@nbnpre##1\uri@nbnpost}}%
+%% OCLC
+\DeclareUrlCommand\oclc{\def\UrlLeft##1\UrlRight{\uri@oclcpre##1\uri@oclcpost}}%
%% OID
\DeclareUrlCommand\oid{\def\UrlLeft##1\UrlRight{\uri@oidpre##1\uri@oidpost}}%
%% PubMed
\DeclareUrlCommand\pubmed{\def\UrlLeft##1\UrlRight{\uri@pubmedpre##1\uri@pubmedpost}}%
%% TINY
-\DeclareUrlCommand\tinyuri{\def\UrlLeft##1\UrlRight{\uri@tinypre##1\uri@tinypost}}%
+\DeclareUrlCommand\tinyuri{\def\UrlLeft##1\UrlRight{\uri@tinyuripre##1\uri@tinyuripost}}%
%% TINYP (tiny with preview)
-\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\uri@tinyppre##1\uri@tinyppost}}%
+\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\uri@tinypuripre##1\uri@tinypuripost}}%
+%% WebCite
+\DeclareUrlCommand\wc{\def\UrlLeft##1\UrlRight{\uri@wcpre##1\uri@wcpost}}%
%% XMPP
\DeclareUrlCommand\xmpp{\def\UrlLeft##1\UrlRight{\uri@xmpppre##1\uri@xmpppost}}%
%% citeurl
\DeclareUrlCommand\citeurl{\def\UrlLeft##1\UrlRight{\uri@citeurlpre##1\uri@citeurlpost}}%
%% mailto
-\DeclareUrlCommand\mailto{\def\UrlLeft##1\UrlRight{\uri@mailtopre##1\uri@mailtopost}}%
+\DeclareUrlCommand\mailto@{\def\UrlLeft##1\UrlRight{\uri@mailtopre##1\uri@mailtopost}}%
+\DeclareRobustCommand\mailto[1][]{\mailto@}%
%% ukoeln
\DeclareUrlCommand\ukoeln{\def\UrlLeft##1\UrlRight{\uri@ukoelnpre##1\uri@ukoelnpost}}%
}
\AtBeginDocument{%
+ \@ifpackageloaded{aurl}%
+ {\PackageWarning{uri}{Packages uri AND aurl detected.\MessageBreak%
+ Results might depend on order of loading;\MessageBreak}%
+ }{\relax}%
\@ifpackageloaded{doi}%
{\PackageWarning{uri}{Packages uri AND doi detected.\MessageBreak%
- Result will depend on order of loading!\MessageBreak%
+ Results will depend on order of loading!\MessageBreak%
Consider using only one package.\MessageBreak%
- The uri package alone should be sufficient.\MessageBreak%
- }%
+ The uri package alone should be sufficient;\MessageBreak}%
}{\relax}%
\@ifpackageloaded{doipubmed}%
{\PackageWarning{uri}{Packages uri AND doipubmed detected.\MessageBreak%
- Result will depend on order of loading!\MessageBreak%
+ Results will depend on order of loading!\MessageBreak%
Consider using only one package.\MessageBreak%
- The uri package alone should be sufficient.\MessageBreak%
- }%
+ The uri package alone should be sufficient;\MessageBreak}%
}{\relax}%
- }
+ }%
\endinput
%%
%% End of file `uri.sty'.