Am 13.12.2011 um 16:26 schrieb Andreas Harder:

> Hi all,
> 
> would someone please enlighten me. What is the correct usage of \definelayout?
> 
> \definelayout[default][width=middle,height=middle,header=0pt,footer=0pt]
> % \setuplayout[default] % needed?
> \definelayout[first]  [default][header=2cm]
> \definelayout[unknown][default]%[reset]
> % \definelayout[2]      [default]%[reset]
> \definelayout[last]   [default][footer=2cm]
> 
> \starttext  \showframe % \checkcurrentlayout
>  %% Variant A: fails with \default[unknown]
>  first\page unknown=(2)\page \page unknown=(3)\page last
> 
>  %% Variant B: fails with \definelayout[2]
>  % first\page unknown=(2)=last
> \stoptext
> 
> By the way the output differs with the latest beta in comparison with the 
> latest experimental.

Hans changed part of the \setuplayout code in the last betas (there are more 
than you can see in the ctx suite).

When context checks the layout (happens with \starttext and when it starts a 
new page) it test for the following defined layouts:

• “<pagenumber>”
• “-<pagenumber>”
• “last” (is only used for the last page of the document)
• “first” (is only used for the first page of the document)
• “unknown”
• “current”
• “odd” and “even” (used for left and right pages)

All entries in this list are reserved names but you can also define your own 
layout but in this case
you have to enable it with \setuplayout[<name>].

One of the new features in MkIV is that layout parameters can be inherited, 
e.g. when
you define a layout with the name “one” {\definelayout[one][..,..=..,..]) and 
another one with
the name two (\definelayout[two][one][..,..=..,..]) this will take the values 
from one of there
are nothing set for a value from one and when there is also nothing set for one 
the global
values are used (\setuplayout[..,..=..,..]).

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to