From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/14536 Path: main.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Peter_M=FCnster?= Newsgroups: gmane.comp.tex.context Subject: Re: typearea Date: Wed, 14 Jan 2004 19:33:51 +0100 (CET) Sender: ntg-context-admin@ntg.nl Message-ID: References: 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 1074105381 15529 80.91.224.253 (14 Jan 2004 18:36:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Jan 2004 18:36:21 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Wed Jan 14 19:36:18 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 1AgpsI-00043Q-00 for ; Wed, 14 Jan 2004 19:36:18 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id C637F10B32; Wed, 14 Jan 2004 19:35:28 +0100 (MET) Original-Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by ref.ntg.nl (Postfix) with ESMTP id EDB0110B21 for ; Wed, 14 Jan 2004 19:34:14 +0100 (MET) Original-Received: from gaston.free.fr (rennes-1-62-147-96-206.dial.proxad.net [62.147.96.206]) by postfix4-1.free.fr (Postfix) with ESMTP id 46A086C1EF for ; Wed, 14 Jan 2004 19:34:55 +0100 (CET) Original-Received: by gaston.free.fr (Postfix on SuSE Linux, from userid 500) id C5DFE1873B; Wed, 14 Jan 2004 19:33:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by gaston.free.fr (Postfix on SuSE Linux) with ESMTP id A0EEE1751C for ; Wed, 14 Jan 2004 19:33:51 +0100 (CET) X-X-Sender: peter@gaston.free.fr Original-To: ntg-context@ntg.nl In-Reply-To: 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:14536 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:14536 On Sun, 11 Jan 2004, Peter Münster wrote: > %%%%%% Here is the problem: dividing one length by another. %%%%%% Hello, I've found a solution. Here is now the full environment: % 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)} \unprotect \begingroup \catcode`P=12 \catcode`T=12 \lowercase{\def\x@x{% \def\rem@pt##1.##2PT{##1.##2}% \def\rem@@pt##1.##2PT{##1}}} \expandafter\endgroup\x@x \def\strip@Pt{\expandafter\rem@pt\the} \def\strip@PT{\expandafter\rem@@pt\the} \edef\Ratio{\strip@Pt\dimexpr(10\paperheight/\strip@PT\dimexpr(10\PageWidth))} \protect \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 Cheers, Peter -- http://pmrb.free.fr/contact/ ------------------------------------ Film Search site: http://f-s.sf.net/