From 4b9b1bcdd965d2220397723d248a8c0e7a4cdd32 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 11 Apr 2007 22:58:58 +0000
Subject: new latex package doi (11apr07)

git-svn-id: svn://tug.org/texlive/trunk@4146 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/doi/doi.sty | 42 +++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/doi/doi.sty

(limited to 'Master/texmf-dist/tex/latex/doi/doi.sty')

diff --git a/Master/texmf-dist/tex/latex/doi/doi.sty b/Master/texmf-dist/tex/latex/doi/doi.sty
new file mode 100644
index 00000000000..5e686c47e64
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/doi/doi.sty
@@ -0,0 +1,42 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{doi}[2005/03/24 handle doi numbers]
+%% original code written by Heiko Oberdiek and published on comp.text.tex
+%% Packaged as a style file by Maarten Sneep, with some minor 
+%% changes suggested by Bruno Voisin to accomodate the Apple 
+%% pdf framework
+%%
+%% This code is placed under the LPPL
+
+%% We need hyperref, but you probably want to load hyperref 
+%% beforehand, or set some options later on.
+\RequirePackage{hyperref}
+
+\newcommand*{\doi}{% 
+  \begingroup 
+  \lccode`\~=`\#\relax 
+  \lowercase{\def~{\#}}
+  \lccode`\~=`\<\relax 
+  \lowercase{\def~{\textless}}
+  \lccode`\~=`\>\relax 
+  \lowercase{\def~{\textgreater}}
+  \lccode`\~=0\relax 
+  \catcode`\#=\active 
+  \catcode`\<=\active 
+  \catcode`\>=\active 
+  \@doi
+}% 
+
+\def\@doi#1{% 
+  \let\#\relax 
+  \let\textless\relax 
+  \let\textgreater\relax 
+  \edef\x{\toks0={{#1}}}% 
+  \x
+  \edef\#{\@percentchar23}%
+  \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}}}% 
+  \x
+  \edef\x{\endgroup\the\toks1 \the\toks0}
+  \x
+}
-- 
cgit v1.2.3

