On Sun, 18 May 2008, Ralph Menikoff wrote:
> I have been using pdflatex with amrita widget macros.
> The hyperref package (used for amrita widgets) has a macro \href
> which allows one to put link to url in pdf file.
> Then user can simply click on url and acroread
> should open web browser to that web page.
> This works fine when \href is used directly on a page
> but not from a widget.
If you want a widget to access a url then you should
add the following to the widget's handler:
<event>::url {url1, url2, ..., urln}
Thus to mimic href you would trigger off a mouse up event, as in:
fold::latex {
fold> token=handler
U::url {http://www.amrita-ebook.org}
}
&latex::widget(handler){Click me!}
The above is more cumbersome than using href, but there is
nothing to stop you from writing your own wrapper, such
that you can call:
\myhref{url}
and have it invoke a TeX macro created by latex::widget.
This will then allow you to access functionality that
goes well beyond that of hyperref.
Note that given the way pdflatex works PDF annotations cannot
be nested and so if you use \href in the appearance of
a latex::widget then the associated hyperref machinery is
switched off.
James
I'm not sure I follow what you want. Can you elaborate?
James
>
> On Sun, 18 May 2008, Ralph Menikoff wrote:
>
> > OK, attached is revised script which does what I wanted.
I was just going over you script and I notice you're
using:
fold::latex {
fold>file.=$amrita:latex::file`OpenAction
}
to write JavaScript to the OpenAction file maintained
by Latex2eHead. The preferred way to do this is actually:
fold::latex {
fold> stream.OpenAction
}
James