From: Renaud AUBIN <aubin@nibua-r.org>
Subject: Fielstack and Layers for Presentation
Date: Thu, 12 Oct 2006 19:58:23 +0200 [thread overview]
Message-ID: <452E823F.6040503@nibua-r.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2337 bytes --]
Hi all,
I would use fieldstack with \getbuffer and overlays... Why the following
code doesn't work ? Is there another way to do that ?
TIA
Renaud
%%%%%%% stack.tex
\setupcolors[state=start]
\usemodule[pre-original]
\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][frame=off,background=FunnyFrame]
\def\StartFrame{\startFunnyText}
\def\StopFrame {\stopFunnyText }
\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut#1\hss}}}
\setMPtext{FunnyFrame}{} % initialize the text variable
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFrame}) ;
a := unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
o := BodyFontSize ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a randomized (o/2) ;
fill b withcolor .85white ; draw b ;
c := center p ;
c := b intersectionpoint (c shifted (0,-o)--c shifted(0,o)) ;
p := p shifted (c-center p) ;
b := (boundingbox p) randomized (o/8) ;
fill b withcolor .85white ; draw b ;
draw p withcolor black;
setbounds currentpicture to a ;
\stopuseMPgraphic
\definelayer[bglayer][position=yes]
\setupbackgrounds[text][background=bglayer]
\setuplayer[bglayer][position=no,corner=bottom,height=\paperheight]
\starttext
\startbuffer[first]
\setlayer[bglayer][x=.55\textwidth,y=.9\textheight,location=b]{
\FrameTitle{Knuth}
\StartFrame[width=.75\textwidth]
\input knuth
\StopFrame
}
\stopbuffer
\startbuffer[second]
\setlayer[bglayer][x=.625\textwidth,y=.8\textheight,location=b]{
\FrameTitle{Zapf}
\StartFrame[width=.75\textwidth]
\input zapf
\StopFrame
}
\stopbuffer
\startbuffer[third]
\setlayer[bglayer][x=.70\textwidth,y=.7\textheight,location=b]{
\FrameTitle{Tufte}
\StartFrame[width=.75\textwidth]
\input tufte
\StopFrame
}
\stopbuffer
\definesymbol[empty][]
\definesymbol[one][{\getbuffer[first]}]
\definesymbol[two][{\getbuffer[first,second]}]
\definesymbol[three][{\getbuffer[first,second,third]}]
\Topic{Stacks \& Layers}
{\setupbodyfont[12pt]
\definefieldstack[sequence]
[one,two,three]
[frame=off,
offset=none,
clickin=JS(Walk_Field{sequence})]
{\fieldstack[sequence]}
\goto{next}[JS(Walk_Field{sequence})]
}
\stoptext
[-- Attachment #1.2: Type: text/html, Size: 3317 bytes --]
[-- Attachment #2: Type: text/plain, Size: 139 bytes --]
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
next reply other threads:[~2006-10-12 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 17:58 Renaud AUBIN [this message]
2006-10-13 13:38 ` Peter Rolf
2006-10-13 21:54 ` Renaud AUBIN
2006-10-14 10:12 ` Peter Rolf
2006-10-15 20:14 ` Renaud AUBIN
2006-10-14 17:40 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=452E823F.6040503@nibua-r.org \
--to=aubin@nibua-r.org \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).