diff options
author | Karl Berry <karl@freefriends.org> | 2018-09-01 22:17:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-09-01 22:17:45 +0000 |
commit | 95255951c26abc51018d66c287c71bc96576a899 (patch) | |
tree | 9be83aa868e95b5a10653d039dbd1662f9fe2ca5 /Master/texmf-dist/doc/latex/uri/uri-example.tex | |
parent | 1aa09bbe7c7947051bd2c25388be7f8d502eb728 (diff) |
uri (1sep18)
git-svn-id: svn://tug.org/texlive/trunk@48538 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/uri/uri-example.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/uri/uri-example.tex | 205 |
1 files changed, 146 insertions, 59 deletions
diff --git a/Master/texmf-dist/doc/latex/uri/uri-example.tex b/Master/texmf-dist/doc/latex/uri/uri-example.tex index a5ae4d0633f..1f90b5364f6 100644 --- a/Master/texmf-dist/doc/latex/uri/uri-example.tex +++ b/Master/texmf-dist/doc/latex/uri/uri-example.tex @@ -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,16 +34,21 @@ %% %% 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. %% -\documentclass{article} +%% In memoriam +%% Claudia Simone Barth + 1996/01/30 +%% Tommy Muench + 2014/01/02 +%% Hans-Klaus Muench + 2014/08/24 +%% +\documentclass[british]{article}[2014/09/29]% v1.4h %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\PassOptionsToPackage{hyphens}{url}% url is loaded internally by hyperref \usepackage{hyperref}[2011/02/07]% v6.82b \hypersetup{% extension=pdf,% @@ -54,81 +65,157 @@ pdfpagelayout=SinglePage,% bookmarksopen=false% } -\usepackage{uri}[2011/03/04]% v1.0a +\usepackage{uri}[2018/09/01]% v2.0a +\RequirePackage{amsmath} +\RequirePackage{relsize} +\gdef\doialternative{% + \hbox{\text{\fontfamily{lmss}\selectfont{\smaller{% + DO\hspace{-0.025em}I\raisebox{0.24ex}{:}}}\kern-0.01em}}\allowbreak% + }% used later for demonstration of \urisetup +\renewcommand*{\thesubsection}{\arabic{subsection}} \listfiles \begin{document} \pagenumbering{arabic} \section*{Example for uri} -\markboth{Example for uri}{Example for uri} - This example demonstrates the use of package\newline -\textsf{uri}, v1.0a as of 2011/03/04 (HMM).\newline +\textsf{uri}, v2.0a as of 2018/09/01 (HMM).\newline No options were given, thereby the default options were used.\newline -For more details please see the documentation!\newline +For more details please see the documentation! -\bigskip - -The \textsf{uri} package allows to hyperlink (with the \textsf{hyperref} package -of \textsc{Heiko Oberdiek}) uris of type +\subsection{Supported types of uri\label{uritypes}} +The \textsf{uri} package allows to hyperlink (with the +\textsf{hyperref} package of \textsc{Heiko Ober\-diek}) uris of type \begin{itemize} -\item[--] arXiv (\url{http://www.arXiv.org/}), e.\,g. \arxiv{0905.0105v2}. +\item[--] arXiv (\url{https://www.arXiv.org/}), e.\,g. \arxiv{math/9201303}. -\item[--] ASIN \newline -(\url{% -http://www.amazon.co.uk/gp/help/customer/display.html/277-3416785-8259466?ie=UTF8&nodeId=898182}% -), \newline -(that one is a good example for using a TINY url: \tinyuri{687j3oh})\newline - e.\,g. \asin{0471491039}. +\item[--] ASIN % + (\url{https://www.amazon.co.uk/gp/help/customer/display.html/277-3416785-8259466?ie=UTF8&nodeId=898182}), % + (that one is a good example for using a TINY url: \tinyuri{y7ju25ln}) % + e.\,g. \asin{0201134489}. -\item[--] DOI (\url{http://www.doi.org/index.html}), e.\,g. \doi{10.1000/182}. +\item[--] DOI (\url{https://www.doi.org/index.html}), e.\,g. \doi{10.1000/182} or\linebreak% + \doi{10.1111/coin.12165}. For DOIs also \url{http://www.shortdoi.org/} % + should be mentioned, which provides \doi{10/b8xfbg} as synonym for that long doi % + given in \hyperref[relaxation]{\ref*{relaxation} Stress test} % + (and also synonyms for all other DOIs). -\item[--] HDL (\url{http://www.handle.net/factsheet.html}), e.\,g. \hdl{2128/2486}. +\item[--] HDL (\url{https://www.handle.net/index.html}), e.\,g. \hdl{2128/2486}. -\item[--] NBN (\url{http://nbn-resolving.de/urn:nbn:de:1111-200606309}), \newline - e.\,g. \nbn{urn:nbn:de:kobv:83-opus-16928}. (You could also use the option - \texttt{nbnpre=URN:NBN:DE:} and then \texttt{\textbackslash nbn\{kobv:83-opus-16928\}}.) +\item[--] NBN (\url{http://nbn-resolving.de/urn:nbn:de:1111-200606309}),\newline% + e.\,g. \nbn{urn:nbn:de:bsz:mit1-opus-3145}. -\item[--] PubMed (\url{http://www.ncbi.nlm.nih.gov/pubmed/}), \newline - e.\,g. \pubmed{17822909}. +\item[--] OCLC (the global library cooperative % + \href{https://www.oclc.org/en/about.html}{OCLC} maintains % + \href{https://www.worldcat.org/whatis/default.jsp}{WorldCat}), % + e.\,g. \oclc{935889548}. \item[--] OID (\url{http://www.oid-info.com/#oid}), e.\,g. \oid{2.16.840}. -\item[--] TINY (\url{http://tinyurl.com}), e.\,g. \tinyuri{MST19-105603} \newline - (uses \texttt{tinyuri} instead of \texttt{tiny}, because that command already existed). +\item[--] PubMed (\url{https://www.ncbi.nlm.nih.gov/pubmed/}),\newline% + e.\,g. \pubmed{24925405}. + +\item[--] TINY (\url{https://tinyurl.com/}), e.\,g. \tinyuri{MST19-105603}\newline% + (uses \verb|\tinyuri| instead of \verb|\tiny|, because that command already existed). + +\item[--] TINY with preview (\url{https://preview.tinyurl.com/}), % + e.\,g. \tinypuri{MST19-105603}. -\item[--] TINY with preview, e.\,g. \tinypuri{MST19-105603}. +\item[--] WebCite (\url{https://www.webcitation.org/}), e.\,g. \wc{71dxjl73I}, + which is short for \wc{query?url=http%3A%2F%2Fctan.org&date=2018-08-13}{% + }. -\item[--] XMPP (\url{http://xmpp.org/about/}), e.\,g. \xmpp{time}. +\item[--] XMPP (\url{https://xmpp.org/about/}) changed, for example + \verb|URN:XMPP:time| was moved from \url{https://xmpp.org/protocols/urn:xmpp:time/} + to\linebreak \url{https://xmpp.org/extensions/xep-0202.html}. Therefore + \verb|\xmpp| is no longer provided by this package. For backward compatibility + \verb|\xmpp{...}| gives an error message and links to + \url{https://xmpp.org/extensions/}. \end{itemize} +\subsection{Pre/post text, \texttt{\textbackslash urisetup}} +\noindent Text before (e.\,g. \textsf{DOI:}) and after (well, no example) +the uri to be displayed can be adapted by the package options. +After loading the package it is possible (even somewhere within the document's body) +to change these \hbox{\ldots \verb|pre|} (and \hbox{\ldots \verb|post|)} texts +by \verb|\urisetup|, e.\,g.\newline +\verb|\urisetup{arxivpre={\textsf{\scshape arXiv:}\hspace{.2em}}}|.\newline +This command can also be used in the preamble to define pre/post texts +which otherwise are not understood by \LaTeX. -- Compare +\arxiv{0905.0105v2} to +\urisetup{arxivpre={\textsf{\scshape arXiv:}\hspace{.2em}}} +\arxiv{0905.0105v2} or +\doi{10.1000/182} to +\urisetup{doipre={\doialternative}}% \doialternative was defined in the example's preamble. +\doi{10.1000/182}. + +\subsection{\texttt{\textbackslash citeurl}, \texttt{\textbackslash mailto}, % + \texttt{\textbackslash ukoeln}, and \texttt{\textbackslash uref}} Additionally some commands are provided by the uri package: \begin{itemize} -\item[--] \texttt{siteurl} similar to the command of the \textsf{doipubmed} package, \newline - \citeurl{http://ctan.org/pkg/doipubmed}. - -\item[--] \texttt{mailto} for e-mail addresses, e.\,g. \mailto{spam@dante.de}. - Adding something like \texttt{?subject=Concerning uri package} after \texttt{mailto:\#\#1} - in the style file would even add this subject to (every!) e-mail hyperlink. - -\item[--] \texttt{ukoeln} for short University of Cologne (Universit\"{a}t zu K\"{o}ln, - U~Koeln; Germany; \url{http://www.pressoffice.uni-koeln.de/}) addresses, \newline - e.\,g. \ukoeln{XM492}. - -\item[--] \texttt{uref} takes two arguments, the first gives the target of the hyperlink, -the second gives the text to be displayed for it, e.\,g. information about -the \uref{http://ctan.org/pkg/pageslts}{pagesLTS} package, similar to \texttt{\textbackslash href}. +\item[--] \verb|\citeurl| similar to the command of the \textsf{doipubmed} package,\newline% + \citeurl{https://ctan.org/pkg/doipubmed}. + +\item[--] \verb|\mailto| for e-mail addresses (optionally with e-mail subject), e.\,g.\newline% +\mailto{spam@example.org} or with subject % +\mailto[Some subject of the e-mail]{spam@example.org}. + +\item[--] \verb|\ukoeln| for short University of Cologne (Universit\"{a}t zu K\"{o}ln, % + U~Koeln; Germany; \url{https://www.portal.uni-koeln.de/8911.html?&L=1}) + ad-\linebreak dresses, e.\,g. \ukoeln{PDGKL}. + +\item[--] \verb|\uref| takes two arguments, the first gives the target of the hyperlink, % + the second gives the text to be displayed for it, e.\,g. information about the % + \uref{https://ctan.org/pkg/uri}{uri package}, similar to \verb|\href|. % + When \textsf{hyperref} was not loaded, \newline% + \verb|\uref{first argument}{second argument}| % + defaults to\newline + \verb|\url{second argument}|. \end{itemize} -\bigskip - -Text before (e.\,g. \textsf{DOI:}) and after (well, no example) the uri to be displayed can be -adapted by the package options.\newline - -Even \begin{verbatim} \doi{1.2/3-4(5)6:7<8::A-B9>0.9.C8;7-\654%23!$} \end{verbatim} -would work (if that DOI would exist):\newline -\doi{1.2/3-4(5)6:7<8::A-B9>0.9.C8;7-\654%23!$}. - +\subsection{Stress test\label{relaxation}} +Even \verb|\doi{1.2/3-.(5):<>;%A\8!$~&{}#X}| +would work (if that DOI would exist; same for the other types of uri): +\doi{1.2/3-.(5):<>;%A\8!$~&{}#X}{% +} (In the error message at doi.org the \verb|#X| is not included, +because it is interpreted as \textquotedblleft anchor X\textquotedblright{} at +page \verb|1.2/3-.(5):<>;%A\8!$~&{}|, which already is not found.)\newline +Adding \verb|opening bracket percent-sign line break closing bracket|\newline +(please see the source code of the example) +makes programs happy, which check for bracket pairs and take the +first percent sign as the start of a comment and therefore miss +the closing bracket (but therefore also the following opening one). +And this real DOI works:\newline +\doi{10.1002/1097-4636(200108)56:2<282::AID-JBM1096>3.0.CO;2-5}\newline +(short: \doi{10/b8xfbg}, see DOI in % +\hyperref[uritypes]{\ref*{uritypes} Supported types of uri}). +\pagebreak + +\subsection{Name-to-Thing resolver} +It is also possible to resolve a lot of identifiers by +the Name-to-Thing resolver by just appending the identifier to +\url{https://n2t.net/}, e.\,g. \newline% +\url{https://n2t.net/arXiv:math/9201303}, \newline% +\url{https://n2t.net/ASIN:0201134489}, \newline% +\url{https://n2t.net/DOI:10.1111/coin.12165}, \newline% +\url{https://n2t.net/HDL:2128/2486}, \newline% +\url{https://n2t.net/urn:nbn:de:bsz:mit1-opus-3145}, \newline% +\url{https://n2t.net/OCLC:935889548}, \newline% +\url{https://n2t.net/OID:2.16.840} (which at the time of writing did not work, % +\url{https://identifiers.org/OID:2.16.840} did), \newline% +\url{https://n2t.net/PubMed:24925405}, and also \newline% +\url{https://n2t.net/ISBN:9783638922005} and \newline% +\url{https://n2t.net/ARK:12148/bpt6k15385d}.\newline% +Disadvantages: It is longer and requires \url{n2t.net} to work.\newline% +Advantage: Anybody reading the printed document can just enter % +the url as given into their browser without thinking about how to resolve % +that type of uri. + +\subsection{Disclaimer for web links} +The author is not responsible for any contents referred +to in this work unless if having full knowledge of illegal contents. If any damage +occurs by the use of information presented there, only the author of the respective +pages might be liable, not the one who has referred to these pages. \end{document} \endinput %% |