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} Thanks in advance, -- Giuseppe "Oblomov" Bilotta P.S. To prove that it's really me, I'll signal two minor typos in the context source: core-tab.tex:88:%D {inintable, ifsplittables} (first should be ifintable), and page-lyr.tex:81: \c!x=\zeropoint,\c!y=\zeropoint,\c!position=\v!no, page-lyr.tex:87: \c!location=rb,\c!position=\v!no,\c!page=, position=no is set twice in the same setup. [*] I've been out of the loop for a couple of years, the University has sucked up most of my time. I was never too happy with it, and I'm planning on a comeback :D
"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
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
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
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
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
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
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
hello: iŽm using endnotes at the end of each chapter and I have 2 problems: 1. I want some space between a note and the next one. How can I do that? 2. When the last page of a chapter is half filled o more -or somethig like that- the endnotes jumps to a new page, but if the last page of a chapter is less than a half filled, then the endnotes keeps in the same page, as I want. Thankyou in advance. -------------------- Horacio Suarez Editotrial Antropofagia www.eantropofagia.com.ar _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
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
participants (5)
-
Aditya Mahajan
-
Giuseppe Bilotta
-
Horacio Suarez
-
luigi scarso
-
Peter Rolf