ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: typearea
Date: Thu, 15 Jan 2004 11:23:35 +0100	[thread overview]
Message-ID: <6.0.1.1.2.20040115110819.0331eec0@server-1> (raw)
In-Reply-To: <Pine.LNX.4.44.0401141928230.25316-100000@gaston.free.fr>

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

  reply	other threads:[~2004-01-15 10:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-04 18:24 typearea Peter Münster
2004-01-04 21:03 ` typearea Hans Hagen
2004-01-06  7:21   ` typearea Peter Münster
2004-01-06 14:13     ` typearea Henning Hraban Ramm
2004-01-11 21:02       ` typearea Peter Münster
2004-01-14 18:33         ` typearea Peter Münster
2004-01-15 10:23           ` Hans Hagen [this message]
2004-01-19 19:06             ` typearea Peter Münster
2004-01-20  9:12               ` typearea Hans Hagen
2004-01-15 12:23 typearea Hans Hagen
2004-01-15 13:45 ` typearea Willi Egger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6.0.1.1.2.20040115110819.0331eec0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).