Re: [NTG-context] Layers in ConTeXt

2007-07-15 Thread Giuseppe Bilotta
Saturday, July 14, 2007 Aditya Mahajan wrote:

> On Fri, 13 Jul 2007, Giuseppe Bilotta wrote:

>> Hello all,

> Welcome back Giuseppe. I had benifitted a lot from your efforts of
> improving the math support in ConTeXt. Had it not been for the amsl
> module, I might have never switched to ConTeXt and would have missed a
> lot of fun.

Thanks :) I really hope I'll be able to get back at ConTeXt
development and/or other contributions to the TeX world.

> This is how I would do it. Not sure if this is the best way. Use
> tokens to keep track of the current information that should go to the
> layer, and repeat the layer on each page.

> \newtoks\testtoks

> \definelayer[test]
>  [ width=\paperwidth,
>   height=\paperheight,
>  ]

> \startsetups make:test
> \setlayer[test][x=5cm,y=3cm]{\framed[align=normal,width=5cm]{\the\testtoks}}
> \stopsetups

> \setupbackgrounds[page][setups=make:test,background=test]

An interesting approach. I really need to learn to use
setups.

In the end, as the layout specifications got defined more
accurately, it turns out the number and position of the
layer elements is much less flexible than I originally
thought, so I don't need this approach anymore, but I'll
keep it in mind for future needs.

One thing that I've noticed with repeating layers is that
they appear also on 'empty' pages (as in those left by
forcing an even or odd page). Is it possible to suppress
then in those cases? Do the blank pages left by these
commands have a particular setup that can be tweaked?

-- 
Giuseppe "Oblomov" Bilotta

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-14 Thread Aditya Mahajan
On Fri, 13 Jul 2007, Giuseppe Bilotta wrote:

> Hello all,

Welcome back Giuseppe. I had benifitted a lot from your efforts of 
improving the math support in ConTeXt. Had it not been for the amsl 
module, I might have never switched to ConTeXt and would have missed a 
lot of fun.

> I have a couple of questions concerning the use of layers in
> ConTeXt. I'm working with Luigi Scarso on a layout which is
> characterized by some fixed-position elements surrounding
> the actual main body of text.
>
> For the fixed-position elements, I'm using layers. However,
> my ConTeXt is a little rusty[*], so there are a couple of
> things which I need hints for.
>
> The first one is very simple: is there a way to 'fix' the
> layer's content "until they change"? I've currently set them
> as page backgrounds, but their content gets reset on each
> new page.
>
> The second question is slightly more complex: is there a way
> to add contents to a layer, rather than replacing the
> current layer content? Something like a macro
>
> \addtolayer[layername][hoffset=whatever(optional)]{additional content}

This is how I would do it. Not sure if this is the best way. Use 
tokens to keep track of the current information that should go to the 
layer, and repeat the layer on each page.

\newtoks\testtoks

\definelayer[test]
 [ width=\paperwidth,
  height=\paperheight,
 ]

\startsetups make:test
\setlayer[test][x=5cm,y=3cm]{\framed[align=normal,width=5cm]{\the\testtoks}}
\stopsetups

\setupbackgrounds[page][setups=make:test,background=test]

\starttext

\testtoks{This is a test}

Let's see

\page

Now add something to the layer

\input knuth

\appendtoks \endgraf \input tufte \to \testtoks

\page

Let's start all over again

\testtoks {Testing again}

\stoptext


HTH,
Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-13 Thread Giuseppe Bilotta
Friday, July 13, 2007 Peter Rolf wrote:

>>> Giuseppe Bilotta schrieb:
 The first one is very simple: is there a way to 'fix' the
 layer's content "until they change"? I've currently set them
 as page backgrounds, but their content gets reset on each
 new page.
>>> use a collector (Details, p.75) instead; I have no experience with them,
>>> but setup should be the same as for layer.
>> 
>>> % - - - - -
>>> \definecollector[foo][state=repeat]
>>
>> Excellent, thanks.
>> 
>> BTW, just to show how out of the loop I am, where can I get
>> the Details manual? :D
>> 
> http://www.pragma-ade.com/general/manuals/details.pdf

Oh yeah thanks. I'll be able to get a few more tricks from
that.

I've found that [state=repeat] works for layers too. I
wonder if there are any technical differences between them
...

-- 
Giuseppe "Oblomov" Bilotta

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-13 Thread Peter Rolf
Giuseppe Bilotta schrieb:
> Friday, July 13, 2007 Peter Rolf wrote:
> 
>> Hi Guiseppe,
> 
>> welcome back ;)
> 
> Thanks :) (btw, it's gIUseppe :D)
>
Sorry for that. Too much GUI (graphical user interface) stuff in my
work... :)

>> Giuseppe Bilotta schrieb:
>>> The first one is very simple: is there a way to 'fix' the
>>> layer's content "until they change"? I've currently set them
>>> as page backgrounds, but their content gets reset on each
>>> new page.
>> use a collector (Details, p.75) instead; I have no experience with them,
>> but setup should be the same as for layer.
> 
>> % - - - - -
>> \definecollector[foo][state=repeat]
> 
>> \starttext
>> \switchtobodyfont[32pt]
> 
>> \setcollector[foo]{\strut eat more...}
>> \flushcollector[foo]
> 
>> \page[yes]
> 
>> \setcollector[foo][hoffset=6cm]{\strut poppler}
>> \flushcollector[foo]
> 
>> \stoptext
>> % - - - - -
> 
> Excellent, thanks.
> 
> BTW, just to show how out of the loop I am, where can I get
> the Details manual? :D
> 
http://www.pragma-ade.com/general/manuals/details.pdf
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-13 Thread Giuseppe Bilotta
Friday, July 13, 2007 Peter Rolf wrote:

> Hi Guiseppe,

> welcome back ;)

Thanks :) (btw, it's gIUseppe :D)

> Giuseppe Bilotta schrieb:
>> The first one is very simple: is there a way to 'fix' the
>> layer's content "until they change"? I've currently set them
>> as page backgrounds, but their content gets reset on each
>> new page.
> use a collector (Details, p.75) instead; I have no experience with them,
> but setup should be the same as for layer.

> % - - - - -
> \definecollector[foo][state=repeat]

> \starttext
> \switchtobodyfont[32pt]

> \setcollector[foo]{\strut eat more...}
> \flushcollector[foo]

> \page[yes]

> \setcollector[foo][hoffset=6cm]{\strut poppler}
> \flushcollector[foo]

> \stoptext
> % - - - - -

Excellent, thanks.

BTW, just to show how out of the loop I am, where can I get
the Details manual? :D

-- 
Giuseppe "Oblomov" Bilotta

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-13 Thread Peter Rolf
Hi Guiseppe,

welcome back ;)

Giuseppe Bilotta schrieb:
> Hello all,
> 
> I have a couple of questions concerning the use of layers in
> ConTeXt. I'm working with Luigi Scarso on a layout which is
> characterized by some fixed-position elements surrounding
> the actual main body of text.
> 
> For the fixed-position elements, I'm using layers. However,
> my ConTeXt is a little rusty[*], so there are a couple of
> things which I need hints for.
>
> The first one is very simple: is there a way to 'fix' the
> layer's content "until they change"? I've currently set them
> as page backgrounds, but their content gets reset on each
> new page.
> 
> The second question is slightly more complex: is there a way
> to add contents to a layer, rather than replacing the
> current layer content? Something like a macro
> 
> \addtolayer[layername][hoffset=whatever(optional)]{additional content}
>

use a collector (Details, p.75) instead; I have no experience with them,
but setup should be the same as for layer.

% - - - - -
\definecollector[foo][state=repeat]

\starttext
\switchtobodyfont[32pt]

\setcollector[foo]{\strut eat more...}
\flushcollector[foo]

\page[yes]

\setcollector[foo][hoffset=6cm]{\strut poppler}
\flushcollector[foo]

\stoptext
% - - - - -

Greetings, Peter
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Layers in ConTeXt

2007-07-13 Thread luigi scarso
"It's allright ( oblamov's Coming Back)"

-- 
luigi

If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___