[NTG-context] typearea

Peter Münster ntg-context@ntg.nl
Sun, 11 Jan 2004 22:02:47 +0100 (CET)

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

%%%%%% 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...
\edef\Top{\the\dimexpr((\paperheight - \Height) / 3 - \headerheight)}
  \Back=\dimexpr((\PageWidth - \Width) / 2)
  \Back=\dimexpr((\PageWidth - \Width) / 3)
\doifmode{BCOR}{\Back=\dimexpr(\Back + \BCOR)}
\Height=\dimexpr(\Height + \headerheight + \footerheight)


Film Search site: http://f-s.sf.net/