At 19:33 14/01/2004, you wrote:
On Sun, 11 Jan 2004, Peter Münster wrote:

> %%%%%% Here is the problem: dividing one length by another. %%%%%%

[code skipped]


Some days ago Willy Egger sent me a translation/summary of this koma page size adventure.

Since I opt for a more contexty solution i want to follow a stepwise approach in getting this done. As a start:

(1) the ratio: this is the most efficient and (on average) accurate solution that also handles large paper sizes:

%edef\layoutratio{\withoutpt{\the\dimexpr(8\paperheight/\dimexpr(\paperwidth/ 8192))}}
%edef\layoutratio{\withoutpt{\the\dimexpr(4\paperheight/\dimexpr(\paperwidth/16384))}}
%edef\layoutratio{\withoutpt{\the\dimexpr(2\paperheight/\dimexpr(\paperwidth/32768))}}
\edef\layoutratio{\withoutpt{\the\dimexpr(2\paperheight/(\paperwidth/32768))}}


(2) for the moment this way, will be handled slightly different (because in context we can mix layouts and layouts can be dynamic

\def\layoutwidth
  {10cm}

\unprotected \def\layouthfheight
  {\dimexpr(\layoutparameter\c!hoofd+\layoutparameter\c!hoofdafstand+
            \layoutparameter\c!voet +\layoutparameter\c!voetafstand )}

\def\layoutheight
  {\dimexpr(\layoutratio\dimexpr(\layoutwidth)+\layouthfheight)}

(3) this brings us:

\definelayout
[koma] % actually i want a better name since it's one of a set of calculations
[backspace=\dimexpr((\paperwidth-\layoutwidth)/2),
width=middle, % less rounding errors than \layoutwidth,
cutspace=\dimexpr((\paperwidth-\layoutwidth)/2),
header=2\lineheight,
headerdistance=\lineheight,
height=middle, % less rounding errors than \layoutheight
footerdistance=\lineheight,
footer=2\lineheight,
topspace=\dimexpr(1\dimexpr(\paperheight-(\layoutheight+\layouthfheight))/3),
bottomspace=\dimexpr(2\dimexpr(\paperheight-(\layoutheight+\layouthfheight))/3)]


\setuplayout
  [koma]

(4) the 'number of chars per line' .. i'll come back to that

Hans



_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to