Produce a hyperlinked DOI?
In my previous answer, there was some confusion between -
and _
. Well, here is a solution that takes _
as well. I used the doi
package.
\documentclass{article}
\usepackage{doi}
\usepackage{hyperref}
\begin{document}
\renewcommand\doitext{Doi: }
\doi{10.1007/978-3-540-70575-8_10}
\end{document}
Hope this will be useful.
Beside Harish’s solution with doi
you can use the package uri
, which uses facilities of the package url
to define some commands, one of them is \doi
again.
But if you want to keep the font family, you need to define this command yourself. I show you both. Comment out the line with \usepackage{uri}
and remove the comment sign before \DeclareUrlCommand
to see the effects.
\documentclass{article}
\usepackage{hyperref} % loads package "url", provides linking facilities
\usepackage[doipre={DOI:~}]{uri} % loads "url", if not already loaded
%\DeclareUrlCommand\doi{\def\UrlLeft##1\UrlRight{DOI\nobreakspace\href{http://dx.doi.org/##1}{##1}}\urlstyle{rm}} % works only, if "url" is loaded, but not "uri"
\begin{document}
\doi{10.1007/978-3-540-70575-8_10}\\
\doi{10.1002/(SICI)1099-114X(199904)23:5%3C415::AID-ER489%3E3.0.CO;2-7}
\end{document}
Note, that you can’t change the font family with the options for uri
(‘doipre’ and ‘doipost’) – at least here at me the computer freezed. The syntaxes for \DeclareUrlCommand
and \urlstyle
are described in the documentation for url
.
Update: Added a even more weird DOI given by matth in comments.