[NTG-context] hyperlinks in PDF

Hans Hagen ntg-context@ntg.nl
Mon, 23 Feb 2004 00:06:57 +0100


At 14:21 21/02/2004, you wrote:
>Using the \setupinteraction and \useURL commands, I can  now generate=20
>active blue email links my PDFs=97which is very cool. The downside is that=
=20
>my footnote numbers (both in the text and below) are now blue too.
>
>I can go two ways with this. One way would be to set the footnote links to=
=20
>toggle between the footnote call in the text and the footnote itself. The=
=20
>other would be to prevent ConTeXt from treating the footnote numbers as=20
>links. I have no idea about how to do either and would be grateful for=20
>suggestions for either strategy, though my preference would be for the=20
>first (assuming that it is possible).
>
>As it is now, clicking on the footnote call in the text changes the=20
>magnification so that the whole page fits on the screen, which is not all=
=20
>that desirable under the present circumstances.

since i'm in the middle of implementing some new nice interactive trickery=
=20
i cannot upload a new version now, so you have to patch:

% in cont-new.tex: (asumes a recent version with multiple footnote types=20
support)

\unprotect

\def\dostartnote% nog gobble als in pagebody
   {\bgroup
    \settrue\processingnote
   %\restorecatcodes % to be tested first
    \ifinregels % otherwise problems with \type <crlf> {xxx}
      \ignorelines % makes footnotes work in \startlines ... \stoplines
    \fi
    \ifnotesymbol
      \dolastnotesymbol
    \else
      \unskip\unskip
      \globallet\lastnotesymbol\dolastnotesymbol
    \fi
    \ignorespaces
    \localnoteinsert\currentnoteins\bgroup
      \penalty\notepenalty
      \forgetall
      \setnotebodyfont
      \redoconvertfont % to undo \undo calls in in headings etc
      \splittopskip\strutht  % not actually needed here
      \splitmaxdepth\strutdp % not actually needed here
      \iffixedlayoutdimensions % ugly hack, will change
        \linkermargeafstand\noteparameter\c!margeafstand
        \rechtermargeafstand\linkermargeafstand
      \else
        \def\linkermargeafstand{\noteparameter\c!margeafstand}%
        \let\rechtermargeafstand\linkermargeafstand
      \fi
      \ifcase\noteparameter\c!n\relax % new 31-07-99 ; always ?
       =
 \doifnotinset{\noteparameter\c!breedte}{\v!passend,\v!ruim}\setnotehsize
      \fi
      \startpushnote
        {\ifx\lastnotenumber\empty \else
          =
 \preparethenumber{\??vn\currentnote}\lastnotenumber\preparednumber
           \doifelse{\noteparameter\c!interactie}\v!nee
             {\noteparameter\c!nummercommando
               =
 {\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}}%
             {\naarbox{\noteparameter\c!commando % was \c!nummercommando,=20
but compatible
               =
 {\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}}%
                [\s!fnt:f:\internalfootreference]}%
         \fi
         \doifelse{\noteparameter\c!interactie}\v!nee
           {\ifconditional\pagewisenotes
              \rawreference\s!fnt{\s!fnt:t:\internalfootreference}{}%
            \fi}}%
           {\rawreference\s!fnt{\s!fnt:t:\internalfootreference}{}}%
      \bgroup
      \postponenotes
      \aftergroup\dostopnote
      \begstrut
      \let\next}

\def\dolastnotesymbol
   {\unskip\unskip
    \ifdim\lastkern=3D\notesignal
      \dodonotesymbol{\kern\noteparameter\c!afstand}% gets the font right,=
=20
hack !
    \fi
    \nobreak
    \doifelse{\noteparameter\c!interactie}\v!nee
     =
 {\dodonotesymbol{\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagin=
a}%
       \ifconditional\pagewisenotes
         \rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}%
       \fi}
      {\naarbox
        =
 {\dodonotesymbol{\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagin=
a}}%
         [\s!fnt:t:\internalfootreference]%
       \rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}}%
    \globallet\lastnotesymbol\relax}

\protect

% test file

\setupinteraction[state=3Dstart]

\setupcolors[state=3Dstart]

\setupfootnotes[interaction=3Dno] % new

\starttext

test \footnote {test}

\stoptext