From 4b9b1bcdd965d2220397723d248a8c0e7a4cdd32 Mon Sep 17 00:00:00 2001 From: Karl Berry 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/doc/latex/doi/README | 1 + Master/texmf-dist/tex/latex/doi/doi.sty | 42 +++++++++++++++++++++++++++++++++ Master/texmf-dist/tpm/doi.tpm | 23 ++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/doi/README create mode 100644 Master/texmf-dist/tex/latex/doi/doi.sty create mode 100644 Master/texmf-dist/tpm/doi.tpm (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/doi/README b/Master/texmf-dist/doc/latex/doi/README new file mode 100644 index 00000000000..18d6914a2a4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/doi/README @@ -0,0 +1 @@ +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 file contains a single user-level command \doi{}, which takes a doi number, and creates a hyperlink from it. 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 +} diff --git a/Master/texmf-dist/tpm/doi.tpm b/Master/texmf-dist/tpm/doi.tpm new file mode 100644 index 00000000000..340c31f4bc4 --- /dev/null +++ b/Master/texmf-dist/tpm/doi.tpm @@ -0,0 +1,23 @@ + + + + doi + Package + 2007/04/11 12:12:00 + + karl + The doi package. + + + 1498 + + + +texmf-dist/tex/latex/doi/doi.sty +texmf-dist/tpm/doi.tpm + + texmf-dist/doc/latex/doi/README + Package/doi + + + -- cgit v1.2.3