From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14492 Path: main.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Peter_M=FCnster?= Newsgroups: gmane.comp.tex.context Subject: Re: typearea Date: Sun, 11 Jan 2004 22:02:47 +0100 (CET) Sender: ntg-context-admin@ntg.nl Message-ID: References: <8CC16623-4052-11D8-987C-0030659899AA@fiee.net> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT X-Trace: sea.gmane.org 1073855088 21740 80.91.224.253 (11 Jan 2004 21:04:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Jan 2004 21:04:48 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Sun Jan 11 22:04:42 2004 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AfmlG-0000U8-00 for ; Sun, 11 Jan 2004 22:04:42 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 5896210B2E; Sun, 11 Jan 2004 22:03:55 +0100 (MET) Original-Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by ref.ntg.nl (Postfix) with ESMTP id 82CA510B28 for ; Sun, 11 Jan 2004 22:02:56 +0100 (MET) Original-Received: from gaston.free.fr (rennes-1-62-147-96-18.dial.proxad.net [62.147.96.18]) by postfix4-2.free.fr (Postfix) with ESMTP id B265B4CAA2 for ; Sun, 11 Jan 2004 22:03:31 +0100 (CET) Original-Received: by gaston.free.fr (Postfix on SuSE Linux, from userid 500) id 72AC31873A; Sun, 11 Jan 2004 22:02:47 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by gaston.free.fr (Postfix on SuSE Linux) with ESMTP id 5EDF81742A for ; Sun, 11 Jan 2004 22:02:47 +0100 (CET) X-X-Sender: peter@gaston.free.fr Original-To: ntg-context@ntg.nl In-Reply-To: <8CC16623-4052-11D8-987C-0030659899AA@fiee.net> Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk X-Reply-To: ntg-context@ntg.nl List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:14492 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14492 On Tue, 6 Jan 2004, Henning Hraban Ramm wrote: > Am Dienstag, 06.01.04, um 08:21 Uhr (Europe/Zurich) schrieb Peter > Münster: > > Ok, I'm going to try it, perhaps it'll be my first ConTeXt module ;) > > It shouldn't be a module, but an environment. All right. Here is my first try, where you can see, that I've still a problem to be solved, so I would be lucky about any help: % this environment works a little bit like \usepackage[DIVcalc]{typearea} % in LaTeX as explained in detail in scrguien.pdf (KOMA-Script documentation) \startenvironment e-test \def\BCOR{3mm}% eventual binding correction \setbox\scratchbox\hbox{\dorecurse{26}{\character\recurselevel}} \newdimen\PageWidth \PageWidth=\paperwidth \doifmode{BCOR}{\PageWidth=\dimexpr(\PageWidth-\BCOR)} %%%%%% Here is the problem: dividing one length by another. %%%%%% % the following is not working for 2 reasons: % * there is still the "pt" behind the numbers % * one cannot divide by a real number, only integer %\edef\Ratio{\the\numexpr(\the\paperheight / \the\PageWidth)} \edef\Ratio{1.5}% to make the rest work... \newdimen\Width \newdimen\Height \newdimen\Back \Width=\dimexpr(2.5\wd\scratchbox) \Height=\dimexpr(\Ratio\Width) \headerheight=2.75\baselineskip \edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - \headerheight)} \doifmodeelse{oneside}{% \Back=\dimexpr((\PageWidth - \Width) / 2) }{% \Back=\dimexpr((\PageWidth - \Width) / 3) \setuppagenumbering[alternative=doublesided]} \doifmode{BCOR}{\Back=\dimexpr(\Back + \BCOR)} \Height=\dimexpr(\Height + \headerheight + \footerheight) \setuplayout[header=\the\headerheight,height=\the\Height, width=\the\Width,topspace=\Top,backspace=\the\Back] \stopenvironment Peter -- http://pmrb.free.fr/contact/ ------------------------------------ Film Search site: http://f-s.sf.net/