%%
%% This is file `uri.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% uri.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% IMPORTANT NOTICE:
%% The package takes options.
%% 
%% The usual disclaimers apply:
%% 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.)
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% 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).
%% 
%% This work consists of the main source file uri.dtx
%% and the derived files
%%    uri.sty, uri.pdf, uri.ins, uri.drv,
%%    uri-example.tex.
%% 
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{uri}[2011/03/04 v1.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
%% 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

\SetupKeyvalOptions{family = uri, prefix = uri@}

\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[{PubMed:}]{pubmedpre}[{PubMed:}]
\DeclareStringOption[{}]{pubmedpost}[{}]

\DeclareStringOption[{URN:OID:}]{oidpre}[{URN:OID:}]
\DeclareStringOption[{}]{oidpost}[{}]

\DeclareStringOption[{TINY:}]{tinypre}[{TINY:}]
\DeclareStringOption[{}]{tinypost}[{}]

\DeclareStringOption[{TINY:P:}]{tinyppre}[{TINY:P:}]
\DeclareStringOption[{}]{tinyppost}[{}]

\DeclareStringOption[{URN:XMPP:}]{xmpppre}[{}]
\DeclareStringOption[{}]{xmpppost}[{}]

\DeclareStringOption[{<}]{citeurlpre}[{<}]
\DeclareStringOption[{>}]{citeurlpost}[{>}]

\DeclareStringOption[{mailto:}]{mailtopre}[{mailto:}]
\DeclareStringOption[{}]{mailtopost}[{}]

\DeclareStringOption[{http://ukoeln.de/}]{ukoelnpre}[{http://ukoeln.de/}]
\DeclareStringOption[{}]{ukoelnpost}[{}]

\ProcessKeyvalOptions*

\@ifpackageloaded{hyperref}{%
\newcommand{\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}}}%
%% ASIN
\DeclareUrlCommand\asin{\def\UrlLeft##1\UrlRight{\href{http://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}}}%
%% HDL
\DeclareUrlCommand\hdl{\def\UrlLeft##1\UrlRight{\href{http://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}}}%
%% 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}}}%
%% 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}}}%
%% TINY
\DeclareUrlCommand\tinyuri{\def\UrlLeft##1\UrlRight{\href{http://tinyurl.com/##1}{\uri@tinypre##1\uri@tinypost}}}%
%% TINYP (tiny with preview)
\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\href{http://preview.tinyurl.com/##1}{\uri@tinyppre##1\uri@tinyppost}}}%
%% XMPP
\DeclareUrlCommand\xmpp{\def\UrlLeft##1\UrlRight{\href{http://xmpp.org/protocols/urn:xmpp:##1/}{\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}}}%
%% ukoeln
\DeclareUrlCommand\ukoeln{\def\UrlLeft##1\UrlRight{\href{http://ukoeln.de/##1}{\uri@ukoelnpre##1\uri@ukoelnpost}}}%
}{% otherwise, i.e. if hyperref has not been loaded:
\newcommand{\uref}[2]{\protect\nolinkurl{#2}}%
%% arXiv
\DeclareUrlCommand\arxiv{\def\UrlLeft##1\UrlRight{\uri@arxivpre##1\uri@arxivpost}}%
%% ASIN
\DeclareUrlCommand\asin{\def\UrlLeft##1\UrlRight{\uri@asinpre##1\uri@asinpost}}%
%% DOI
\DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{\uri@doipre##1\uri@doipost}}%
%% HDL
\DeclareUrlCommand\hdl{\def\UrlLeft##1\UrlRight{\uri@hdlpre##1\uri@hdlpost}}%
%% NBN
\DeclareUrlCommand\nbn{\def\UrlLeft##1\UrlRight{\uri@nbnpre##1\uri@nbnpost}}%
%% 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}}%
%% TINYP (tiny with preview)
\DeclareUrlCommand\tinypuri{\def\UrlLeft##1\UrlRight{\uri@tinyppre##1\uri@tinyppost}}%
%% 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}}%
%% ukoeln
\DeclareUrlCommand\ukoeln{\def\UrlLeft##1\UrlRight{\uri@ukoelnpre##1\uri@ukoelnpost}}%
}

\AtBeginDocument{%
  \@ifpackageloaded{doi}%
    {\PackageWarning{uri}{Packages uri AND doi detected.\MessageBreak%
       Result will depend on order of loading!\MessageBreak%
       Consider using only one package.\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%
       Consider using only one package.\MessageBreak%
       The uri package alone should be sufficient.\MessageBreak%
       }%
    }{\relax}%
  }
\endinput
%%
%% End of file `uri.sty'.
