From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/35455 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Symmetrical layer positioning? Date: Tue, 17 Jul 2007 08:57:08 +0200 Message-ID: <115224fb0707162357g2d2e858fs3e3943ba650fd703@mail.gmail.com> References: <1634043962.20070716172947@iol.it> <1569133368.20070716184120@iol.it> <11610458542.20070717033138@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 1184655447 20740 80.91.229.12 (17 Jul 2007 06:57:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2007 06:57:27 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Jul 17 08:57:24 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 1IAgzr-00024r-Kj for gctc-ntg-context-518@m.gmane.org; Tue, 17 Jul 2007 08:57:23 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1025D1FF3D; Tue, 17 Jul 2007 08:57:22 +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 01240-04; Tue, 17 Jul 2007 08:57:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1E6281FF45; Tue, 17 Jul 2007 08:57:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 37CE51FF45 for ; Tue, 17 Jul 2007 08:57:15 +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 01268-02-2 for ; Tue, 17 Jul 2007 08:57:10 +0200 (CEST) Original-Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by ronja.ntg.nl (Postfix) with ESMTP id D917C1FF3D for ; Tue, 17 Jul 2007 08:57:09 +0200 (CEST) Original-Received: by wx-out-0506.google.com with SMTP id i27so1575677wxd for ; Mon, 16 Jul 2007 23:57:08 -0700 (PDT) Original-Received: by 10.90.90.16 with SMTP id n16mr60667agb.1184655428379; Mon, 16 Jul 2007 23:57:08 -0700 (PDT) Original-Received: by 10.90.101.7 with HTTP; Mon, 16 Jul 2007 23:57:08 -0700 (PDT) In-Reply-To: <11610458542.20070717033138@iol.it> Content-Disposition: inline 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:35455 Archived-At: 2007/7/17, Giuseppe Bilotta : > Monday, July 16, 2007 Giuseppe Bilotta wrote: > > > Monday, July 16, 2007 Aditya Mahajan wrote: > > >> On Mon, 16 Jul 2007, Giuseppe Bilotta wrote: > > >>> Hello all, > >>> > >>> is there a "secret power switch" to tell ConTeXt that a > >>> particular layer has different positioning depending on > >>> wether it's on a left or right page? > > >> You can possible use setups and use \doifoddpageelse to set the > >> layers. See > > >> http://archive.contextgarden.net/thread/20061102.171506.2fa793e2.en.html > > > Thanks a lot. I don't know if using presets is actually > > going to reduce the coding, though. > > > In the mean time, I've found that layers have a doublesided > > option. This apparently allows you to override the > > left/right settings of a layer, so I tried > > > \definelayer[title][ > > x=\dimexpr\backspace+\wdall-\wdtit, > > y=\topspace, > > width=\wdtit, > > height=\httit, > > state=repeat, > > doublesided=true, > > ] > > > \setuplayer[lefttitle][ > > x=\backspace, > > ] > > > \definelayer[desc][ > > x=\backspace, > > y=\topspace, > > width=\wddesc, > > height=\htdesc, > > state=repeat, > > doublesided=true, > > ] > > > \setuplayer[leftdesc][ > > x=\dimexpr\backspace+\wdall-\wddesc, > > ] > > > \definelayer[figs][ > > x=\dimexpr\backspace+\wdall-\wdfig, > > y=\dimexpr\topspace+\makeupheight-\htfig, > > width=\wdfig, > > height=\htfig, > > ] > > > \setuplayer[leftfigs][ > > x=\backspace, > > ] > > > \setupbackgrounds[page][background={color,title,desc,figs},backgroundcolor=elux-ultralight] > > > > However, the 'main' setup is always used, the left one is > > never used. Am I doing something wrong? > > Apparently, I mistook what the doublesided option does for > layers. I've currently solved the problem in the following > way: \definelayer[test][doublesided=yes] \setlayer[test][odd][..,..=..,..]{content} \setlayer[test][even][..,..=..,..]{content} Wolfgang > \unexpanded\def\titlexpos{% > \ifodd\realpageno\dimexpr\wdinside+\wdall-\wdtit\else\wdinside\fi > } > > \definelayer[title][ > x=\titlexpos, > y=\topspace, > width=\wdtit, > height=\httit, > ] > > \unexpanded\def\descxpos{% > \ifodd\realpageno\wdinside\else\dimexpr\wdinside+\wdall-\wddesc\fi > } > > \definelayer[desc][ > x=\descxpos, > y=\topspace, > width=\wddesc, > height=\htdesc, > ] > > \unexpanded\def\figsxpos{% > \ifodd\realpageno\dimexpr\backspace+\wdall-\wdfig\else\wdinside\fi > } > > \definelayer[figs][ > x=\figsxpos, > y=\dimexpr\topspace+\makeupheight-\htfig, > width=\wdfig, > height=\htfig, > ] > > \setupbackgrounds[page][background={color,title,desc,figs},backgroundcolor=elux-ultralight] > > > However, this solution doesn't strike me as particularly > elegant. I've seen in page-lyr.tex that support for > left/right layers is currently in progress, but if I read > the code correctly it just creates three layers (name, > leftname, rightname) and they have to be filled > individually. It would be nice to have a simpler interface > to repeated layers with position recalculated on each page. > > -- > 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 > ___________________________________________________________________________________ > ___________________________________________________________________________________ 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 ___________________________________________________________________________________