[OS X TeX] Hyperlink failure with TeXShop and Preview
Bruno Voisin
bvoisin at mac.com
Sat Feb 10 08:43:27 CET 2007
I've been trying to put, in a LaTeX document, hyperlinks pointing to
the web pages of journal articles, based on the DOI (Document Object
Identifier) of these articles. Using the hyperref package, the following
\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{DOI:#1}}
works, it writes the text "DOI:" followed by the DOI given as an
argument, and makes the total a hyperlink to the URL of the document
on the DOI proxy, namely "http://dx.doi.org/" followed by the DOI.
This works in general, using either pdfLaTeX or XeLaTeX (with both
xdv2pdf and xdvipdfmx). For example, \doi{10.1007/s10665-006-9043-4}
creates a hyperlink to
http://dx.doi.org/10.1007/s10665-006-9043-4
and the destination of the link can be verified by letting the mouse
hover on it in the PDF output.
However, \doi{10.1002/1099-095X(200102)12:1<57::AID-ENV446>3.0.CO;
2-1} doesn't work in all cases: when viewing the PDF output in Adobe
Reader, the corresponding text is indeed a hyperlink to
http://dx.doi.org/10.1002/1099-095X(200102)12:1<57::AID-ENV446>3.0.CO;
2-1
which is a valid URL, but in both Preview.app and in TeXShop's
Preview window the hyperlink appears to have no destination.
My interpretation is that Apple's implementation of hyperlinks in the
PDF-related Cocoa classes doesn't allow either of ()<>; in
hyperlinks. Does anybody know whether this is correct, and whether
something can be done about it?
From a quick test I've done in Pages, it seems that Apple Cocoa
classes are confused by < and > within hyperlinks: if I try to create
in Pages a hyperlink to
http://dx.doi.org/10.1002/1099-095X(200102)12:1<57::AID-ENV446>3.0.CO;
2-1
the link will actually point to
http://dx.doi.org/10.1002/1099-095X(200102)12:1
namely it will stop at the first <. I imagine this is connected with
the fact < and > are generally taken as hyperlink delimiters (and, of
course, are indeed tag delimiters in HTML).
Does anybody know whether something can be done about this? Is this
an Apple bug? Or are < and > proscribed in theory in URLs? Is there a
special way of inputting < and > in hyperlink destinations with
hyperref that would avoid the above problem?
To solve my specific problem I'll use the actual URL <http://
www3.interscience.wiley.com/cgi-bin/abstract/76505114/ABSTRACT>
instead of the equivalent URL based on the DOI proxy, but I'm curious
whether something cleaner can be done.
Bruno Voisin
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/
More information about the macostex-archives
mailing list