Another widget question

2 views
Skip to first unread message

Ralph Menikoff

unread,
Nov 3, 2008, 7:07:13 PM11/3/08
to amrita...@groups.google.com
I am trying to use amrita to generate pdf file with popup widget
that can toggle another widget with yet another widget for a url.
The attached mailit generates the attached urltoggle.pdf
with amrita v3.03.
The widget all popup, but the url does not come out in the intended place.
Is there a limit on the number of embeded widgets or do I need to involk
another amrita command ?
urltoggle.mailit
urltoggle.pdf

James Quirk

unread,
Nov 3, 2008, 8:06:27 PM11/3/08
to Ralph Menikoff, amrita...@groups.google.com
Ralph,

The immediate problem you face is that the URL widget
has the position:

inline

where it should be:

inline relative amru2popup

With the plain inline that you have, you are effectively requesting:

inline relative amru1

where amu1 is the outermost widget, rather than than the
next widget up in the nesting, which here is amru2popup.

Now you could argue that latex::widget should be smart enough to keep
track of the inner parent, but I'm afraid that was an oversight
when I constructed the machinery, or at least it was too difficult
for me to program in TeX. Note that pdflatex does not allow widgets
to be nested and the way that latex::widget achieves the nesting
is quite horrific in terms of the hoops it has to jump through.

I also note that your script is misusing the macros:

\amrBeginWidgets
\amrEndWidgets

These macros are not intended to be nested. They were
intended to be used as a one-off around a set of widgets
so that no footprint would be left on TeX's current page.
Given the way the macros work, I'm not really sure
what happens when they are nested.

On balance, I can't help but feel that your approach
to building Popup notes is becoming cumbersome and
fraught with hidden dangers. I know that I put you
on this path a number of years ago, but that was
to meet a particular need you had at the time
and I would argue that you've now outgrown the approach.

If I were programming your slides, I would
make direct use of AMRITA's tree structure
in conjunction with fold::markup.

James

ralph

unread,
Nov 3, 2008, 10:32:17 PM11/3/08
to amrita-ebook
>
> If I were programming your slides, I would
> make direct use of AMRITA's tree structure
> in conjunction with fold::markup.
>

James,

What is fold:markup ?
I tried looking for it with amrhelp but it was not listed.

Ralph

James Quirk

unread,
Nov 3, 2008, 11:00:29 PM11/3/08
to ralph, amrita-ebook
Ralph,

The orginal fold::markup is described at:

http://www.amrita-ebook.org/doc/fold::markup

it has evolved a bit since the document was written.
The essential idea, however, is that fold::markup
provides a high-level wrapper to latex::widget
for annotating a document. Here you can view your
talk as annotating a blank document. When I get
a moment I'll ship you an example that shows
how it can be used to produce the example you sent me.

James

>
> Ralph
>

Ralph Menikoff

unread,
Nov 4, 2008, 7:40:32 PM11/4/08
to amrita...@groups.google.com
James,

With the attached mailit, which modified the procedure lib/url.amr,
I got the previous example to work.
Then I added a second AddPoint with a url and I get
amrpdf warning: duplicated widget amru2url!
and it doesn't work.
This can be seen by running
amrita -sys second urltoggle
I then fixed this by adding directive to url handler
id &latex::wid(id)
This can be seen by running
amrita -sys second -sys id urltoggle
But I thought without directive id that latex::widget would
assign new id, so I don't see why it is needed ?
Also, in lib/PopupBox.amr there is extra pair
\amrBeginWidgets
\amrEndWidgets
But without this misuse, there are extraneous blank lines in the popup box
before and after the url.
Am I doing something else wrong ?

Ralph

urltoogle.mailit

James Quirk

unread,
Nov 4, 2008, 9:50:49 PM11/4/08
to Ralph Menikoff, amrita...@groups.google.com
Ralph,

On Tue, 4 Nov 2008, Ralph Menikoff wrote:

> James,
>
> With the attached mailit, which modified the procedure lib/url.amr,
> I got the previous example to work.
> Then I added a second AddPoint with a url and I get
> amrpdf warning: duplicated widget amru2url!
> and it doesn't work.

This indicates that two widgets have the same id
which PDF does not allow.

> This can be seen by running
> amrita -sys second urltoggle
> I then fixed this by adding directive to url handler
> id &latex::wid(id)

You would be better to use:

wid -> token


> This can be seen by running
> amrita -sys second -sys id urltoggle
> But I thought without directive id that latex::widget would
> assign new id, so I don't see why it is needed ?

It does, but there's a chicken-and-egg glitch that
I haven't sorted out yet.

> Also, in lib/PopupBox.amr there is extra pair
> \amrBeginWidgets
> \amrEndWidgets
> But without this misuse, there are extraneous blank lines in the popup box
> before and after the url.
> Am I doing something else wrong ?

Yes. But I would need to go through the generated TeX output
to determine exactly what it is. I'll take a look this evening
and get back to you.

James


>
> Ralph
>
>
> >
>

Reply all
Reply to author
Forward
0 new messages