The doi
package has a neat \doi
command, that transforms a doi string into \href{http://dx.doi.org/<the doi>}{doi:<the doi>}
. The uri
package has something similar with the help of the url
package.
I would like to have an extended version of that command that takes an arbitrary link text as an optional argument, like \mydoi[Paper title]{doi}
. I tried that myself with the help of this, but the weird characters in DOIs destroy that.
Take, e.g., the DOI 10.1002/(SICI)1097-0037(199712)30:4<263::AID-NET4>3.0.CO;2-H
. I checked manually that
\href{http://dx.doi.org/10.1002/(SICI)1097-0037(199712)30:4<263::AID-NET4>3.0.CO;2-H}{doi:10.1002/(SICI)1097-0037(199712)30:4\textless263::AID-NET4\textgreater3.0.CO;2-H}
works, I just want a macro that produces that sequence from, say \mydoi{10.1002/(SICI)1097-0037(199712)30:4<263::AID-NET4>3.0.CO;2-H}
, or \mydoi[Title]{10.1002/(SICI)1097-0037(199712)30:4<263::AID-NET4>3.0.CO;2-H}
.