ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Rolf <indiego@gmx.net>
Subject: Re: Fielstack and Layers for Presentation
Date: Fri, 13 Oct 2006 15:38:42 +0200	[thread overview]
Message-ID: <452F96E2.5050306@gmx.net> (raw)
In-Reply-To: <452E823F.6040503@nibua-r.org>

Hi Renaud,

Renaud AUBIN wrote:
> Hi all,
> 
> I would use fieldstack with \getbuffer and overlays... Why the following
> code doesn't work ? Is there another way to do that ?
>
\setlayer is breaking the fields here, so that they become normal,
inactive content (dunno why). If you remove it, the fields appear... but
the positioning is now the problem. For testing I defined the symbols
only to be equal to one buffer at a time (not a combination of them).
Without this restriction you get really funny positions for them.

HTH, Peter

> 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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2006-10-13 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-12 17:58 Renaud AUBIN
2006-10-13 13:38 ` Peter Rolf [this message]
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=452F96E2.5050306@gmx.net \
    --to=indiego@gmx.net \
    --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).