pdflatex and url

3 views
Skip to first unread message

Ralph Menikoff

unread,
May 18, 2008, 2:21:24 PM5/18/08
to amrita...@groups.google.com
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.
Does this have to do with amrita widget macros
or is it a limitation of acroread ?
I am using Amrita version 3.00 (release 14-03-2006)
Test script that demonstrates the effect is attached.
latextest

James Quirk

unread,
May 18, 2008, 7:46:22 PM5/18/08
to Ralph Menikoff, amrita...@groups.google.com
Ralph,

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

Ralph Menikoff

unread,
May 18, 2008, 10:41:55 PM5/18/08
to amrita...@groups.google.com
OK, attached is revised script which does what I wanted.
By the way, how do I get attachment to show up
as link to click on rather than fully expanded text ?
latextest

James Quirk

unread,
May 19, 2008, 11:03:10 AM5/19/08
to Ralph Menikoff, amrita...@groups.google.com
On Sun, 18 May 2008, Ralph Menikoff wrote:

I'm not sure I follow what you want. Can you elaborate?

James

James Quirk

unread,
May 19, 2008, 2:48:22 PM5/19/08
to Ralph Menikoff, amrita...@groups.google.com
Ralph,

>
> 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

Reply all
Reply to author
Forward
0 new messages