[pdftex] Creating hyperlinks in plain pdftex.

Jim Diamond Jim.Diamond at acadiau.ca
Thu Mar 23 20:56:58 CET 2006

On Thu, Mar 23, 2006 at 14:51 (-0500), John R. Culleton wrote:

> The file example.tex describes a verbose way to create a
> hyperlink in a pdf file to an url on the web. pdfLaTeX has a simple 
> \html
> command. 

> Is there a simple way to create the link in plain pdftex?
> Has anyone built a macro that does this? 
> -- 

I use the following, which assumes that you have color support.
Getting color support (or removing it from this def) is left as an
exercise to the diligent student.

% URL support
% Turn off the special meaning of ~ inside \URL{}.
\def\URL@ #1{%
%       \pdfannotlink user{   pdftex pre 0.14 ??
        \pdfstartlink user{
            /Subtype /Link
            % w/o this you get an ugly box around the URL.
            /Border [ 0 0 0 ]   % radius, radius, line thickness
            /A << 
                /Type /Action 
                /S /URI
                /URI (#1) 
        {\color{\URLcolour}\tt #1}%
        % Should we have a special case for tth?
        {\tt #1}%
    \endgroup % Reset catcode of ~ and _



More information about the pdftex mailing list