From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/35429 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Layers in ConTeXt Date: Sat, 14 Jul 2007 10:51:56 -0400 (EDT) Message-ID: References: <1235056452.20070713113127@iol.it> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184424743 5461 80.91.229.12 (14 Jul 2007 14:52:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2007 14:52:23 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Jul 14 16:52:21 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1I9iyr-0001Cj-74 for gctc-ntg-context-518@m.gmane.org; Sat, 14 Jul 2007 16:52:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7A057200C2; Sat, 14 Jul 2007 16:52:19 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07334-02-4; Sat, 14 Jul 2007 16:52:08 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0689B20088; Sat, 14 Jul 2007 16:52:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D374820088 for ; Sat, 14 Jul 2007 16:52:03 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 07334-02-3 for ; Sat, 14 Jul 2007 16:51:59 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by ronja.ntg.nl (Postfix) with ESMTP id 5408020078 for ; Sat, 14 Jul 2007 16:51:58 +0200 (CEST) Original-Received: FROM aditya.hsd1.il.comcast.net. (c-24-13-160-16.hsd1.il.comcast.net [24.13.160.16]) BY tombraider.mr.itd.umich.edu ID 4698E30C.11A84.17637 ; 14 Jul 2007 10:51:56 -0400 In-Reply-To: <1235056452.20070713113127@iol.it> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:35429 Archived-At: 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 ___________________________________________________________________________________