From fbabe9c02ed44f25fc959d8917d915e6ac774181 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 26 Jul 2007 18:00:51 +0000 Subject: doi update (24jul07) git-svn-id: svn://tug.org/texlive/trunk@4654 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/doi/doi.sty | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/tex/latex/doi') diff --git a/Master/texmf-dist/tex/latex/doi/doi.sty b/Master/texmf-dist/tex/latex/doi/doi.sty index 1bbc14e0f0d..5d8e5dbcfce 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/04/17 handle doi numbers] +\ProvidesPackage{doi}[2007/07/24 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 @@ -29,6 +29,7 @@ %% few bugs introduced by Maarten (oops). %% 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. %% We need hyperref, but you probably want to load hyperref %% beforehand, or set some options later on. @@ -44,12 +45,15 @@ \begingroup \lccode`\~=`\#\relax \lowercase{\def~{\#}}% + \lccode`\~=`\_\relax + \lowercase{\def~{\_}}% \lccode`\~=`\<\relax \lowercase{\def~{\textless}}% \lccode`\~=`\>\relax \lowercase{\def~{\textgreater}}% \lccode`\~=0\relax \catcode`\#=\active + \catcode`\_=\active \catcode`\<=\active \catcode`\>=\active \@doi @@ -59,12 +63,14 @@ %% set in the previous command %% it closes the group, and spits out the url. \def\@doi#1{% - \let\#\relax + \let\#\relax + \let\_\relax \let\textless\relax \let\textgreater\relax \edef\x{\toks0={{#1}}}% \x \edef\#{\@percentchar23}% + \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}}}% -- cgit v1.2.3