summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-09-09 21:24:32 +0000
committerKarl Berry <karl@freefriends.org>2018-09-09 21:24:32 +0000
commit291ffa486bda3897df6644cd974ada5c7874a8e1 (patch)
tree2b9a2076759995c95b6792acac6eb83586fd1d60 /Master/texmf-dist/tex/latex
parent989c3cb88a72f0f7f1247721fffd10fd49cb89d8 (diff)
doi (9sep18)
git-svn-id: svn://tug.org/texlive/trunk@48634 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/doi/doi.sty31
1 files changed, 23 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/doi/doi.sty b/Master/texmf-dist/tex/latex/doi/doi.sty
index 5d8e5dbcfce..0c3c152b910 100644
--- a/Master/texmf-dist/tex/latex/doi/doi.sty
+++ b/Master/texmf-dist/tex/latex/doi/doi.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{doi}[2007/07/24 handle doi numbers]
+\ProvidesPackage{doi}[2018/09/09 handle doi numbers]
%% This style file is based original code written by Heiko Oberdiek
%% and published on comp.text.tex. It was packaged with permission
@@ -11,6 +11,9 @@
%% Original discussion on Google under:
%% http://groups.google.com/group/comp.text.tex/msg/922919daa207d613
%%
+%% Comments and bug reports may be submitted via
+%% https://github.com/ho-tex/doi/issues
+%%
%% You can hyperlink DOI numbers to dx.doi.org. Some publishers have elected to
%% use some nasty characters in their doi numbering scheme (<, >, ; have all
%% been spotted). This will either upset (La)TeX, or your pdf reader. This style
@@ -30,17 +33,29 @@
%% A \doitext command is added, following the example from doipubmed.
%% Some comments are added to make the code a little more readable.
%% July 2007: Michael Orlov sends in a patch to correctly handle underscores.
+%% September 2018: David Carlisle for "Oberdiek Package Support Group"
+%% Move to github https://github.com/ho-tex/doi/issues
+%% Add macro defaulting to new
+%% https://doi.org/ URL but may be set to old http://dx.doi.org/
+%%
+
%% We need hyperref, but you probably want to load hyperref
%% beforehand, or set some options later on.
\RequirePackage{hyperref}
-%% to change the default prefix, redefine this command within your own code.
+%% To change the default prefix, redefine this command within your own code.
%% It takes no argument, which is different from the doipubmed package.
\newcommand{\doitext}{doi:}
-%% the meat of the code
-%% the first command opens a group, and changes a few catcodes.
+%% To change the default DOI URL resoloution URL, redefine this command
+%% within your own code.
+%% Previous versions of this package always used http://dx.doi.org/ but
+%% The preferred address is now as given here, https://doi.org/
+\newcommand{\doiurl}{https://doi.org/}
+
+%% The meat of the code.
+%% The first command opens a group, and changes a few catcodes.
\newcommand*{\doi}{%
\begingroup
\lccode`\~=`\#\relax
@@ -59,7 +74,7 @@
\@doi
}
-%% this is the actual command which processes the argument, with the catcodes
+%% This is the actual command which processes the argument, with the catcodes
%% set in the previous command
%% it closes the group, and spits out the url.
\def\@doi#1{%
@@ -73,11 +88,11 @@
\edef\_{_}%
\edef\textless{\@percentchar3C}% instead of {\string<} for Apple
\edef\textgreater{\@percentchar3E}% instead of {\sting>} for Apple
- \edef\x{\toks1={\noexpand\href{http://dx.doi.org/#1}}}%
+ \edef\x{\toks2={\noexpand\href{\doiurl#1}}}%
\x
- \edef\x{\endgroup\doitext\the\toks1 \the\toks0}%
+ \edef\x{\endgroup\doitext\the\toks2 \the\toks0}%
\x
}
-%% that's all folks.
+%% That's all folks.
\endinput