ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \definelayout
@ 2011-12-13 15:26 Andreas Harder
  2011-12-13 15:44 ` \definelayout Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Harder @ 2011-12-13 15:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.


Regards
	Andreas
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \definelayout
  2011-12-13 15:26 \definelayout Andreas Harder
@ 2011-12-13 15:44 ` Wolfgang Schuster
  2011-12-13 18:20   ` \definelayout Andreas Harder
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2011-12-13 15:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \definelayout
  2011-12-13 15:44 ` \definelayout Wolfgang Schuster
@ 2011-12-13 18:20   ` Andreas Harder
  2011-12-28  4:19     ` \definelayout Peter Park Nelson
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Harder @ 2011-12-13 18:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 13.12.2011, at 16:44, Wolfgang Schuster wrote:

> 
> 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[..,..=..,..]).

Hi Wolfgang,

I modified the example (hopefully in a meaningful manner). I get the desired output with the old beta, but it still fails with todays beta.

\setuplayout [width=middle,height=middle,header=0pt,footer=0pt]
\definelayout[first]  [header=2cm]
\definelayout[last]   [footer=2cm]
\definelayout[current]

\starttext  \showframe % \checkcurrentlayout
  % \dorecurse{2}{test\page} % last is wrong
  \dorecurse{5}{test\page} % page 2 and „last“ are wrong
\stoptext


Andreas
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \definelayout
  2011-12-13 18:20   ` \definelayout Andreas Harder
@ 2011-12-28  4:19     ` Peter Park Nelson
  2011-12-28 18:25       ` \definelayout Peter Park Nelson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Park Nelson @ 2011-12-28  4:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

The example is not working correctly for me with the 23 Dec. beta. If
I set a larger footer size for the first page, that larger size is
carried over to all the rest of the document.

Here's my code:

\setuplayout[%
  width=middle,
  backspace=15mm,
  topspace=10mm,
  height=254mm,
  header=5mm,
  headerdistance=5mm,
  footer=5mm, % Normal footer size
  footerdistance=5mm,
  grid=tolerant]

\definelayout[first][% Larger footer on first page
  footer=15mm,
  footerdistance=5mm]


On Tue, Dec 13, 2011 at 12:20 PM, Andreas Harder <aharder@uni-koblenz.de> wrote:
>
> On 13.12.2011, at 16:44, Wolfgang Schuster wrote:
>
>>
>> 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[..,..=..,..]).
>
> Hi Wolfgang,
>
> I modified the example (hopefully in a meaningful manner). I get the desired output with the old beta, but it still fails with todays beta.
>
> \setuplayout [width=middle,height=middle,header=0pt,footer=0pt]
> \definelayout[first]  [header=2cm]
> \definelayout[last]   [footer=2cm]
> \definelayout[current]
>
> \starttext  \showframe % \checkcurrentlayout
>  % \dorecurse{2}{test\page} % last is wrong
>  \dorecurse{5}{test\page} % page 2 and „last“ are wrong
> \stoptext
>
>
> Andreas
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________



-- 
Peter Park Nelson
peter.park.nelson@gmail.com
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: \definelayout
  2011-12-28  4:19     ` \definelayout Peter Park Nelson
@ 2011-12-28 18:25       ` Peter Park Nelson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Park Nelson @ 2011-12-28 18:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Update with a minimal working example.

If a layout is specified for the first page
(\definelayout[first][...=...], that specification is carried on
through all subsequent pages; the layout does not return to the
default specified with \setuplayout[...=...] on the second page.

If a layout is specified for a single later page
(\definelayout[3][...=...]), that specification is carried on too. In
the case of header/footer size, the body text overruns the footer area
on subsequent pages. In the case of backspace (text width), the first
paragraph on the page with the new layout is the default layout width
but the rest are OK. (I have seen this width issue mentioned before
and it may not be possible to change this behavior, but the
header/footer size is a problem for me.)

Thanks.

%%-----------------snip-------------------------------------%%

\setuppapersize[letter][letter]
\setupindenting[yes, medium]

\setuplayout[% Default page layout
  width=middle,
  backspace=20mm,
  topspace=10mm,
  header=5mm,
  headerdistance=5mm,
  footer=5mm,
  footerdistance=5mm,
  grid=tolerant]

%% First page layout does not return to default on page 2
\definelayout[first][%
  footer=25mm,
  header=25mm]

%% Text after page 3 runs over footer area:
% \definelayout[3][% Layout for page 3
%   footer=25mm,
%   header=25mm]

%% Testing a change in text width:
%\definelayout[3][%
% backspace=50mm]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% HEADERS AND FOOTERS:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setuppagenumbering
  [alternative=doublesided,
   location=]

\setupheader[text]
  [state=empty,
   style=\ss]


\setupheadertexts
  [Header]
  [pagenumber]
  [pagenumber]
  [Header]

\setupfooter[text]
  [state=empty,style=bold]

\setupfootertexts
  [footer]
  [footer]
  [footer]
  [footer]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% TEXT STARTS HERE:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\showframe

\starttext

\title{Title}

\dorecurse{30}{\input tufte\par}

\stoptext

%%---------------------snip-----------------------------%%

On Tue, Dec 27, 2011 at 10:19 PM, Peter Park Nelson
<peter.park.nelson@gmail.com> wrote:
> The example is not working correctly for me with the 23 Dec. beta. If
> I set a larger footer size for the first page, that larger size is
> carried over to all the rest of the document.
>
> Here's my code:
>
> \setuplayout[%
>  width=middle,
>  backspace=15mm,
>  topspace=10mm,
>  height=254mm,
>  header=5mm,
>  headerdistance=5mm,
>  footer=5mm, % Normal footer size
>  footerdistance=5mm,
>  grid=tolerant]
>
> \definelayout[first][% Larger footer on first page
>  footer=15mm,
>  footerdistance=5mm]
>
>
> On Tue, Dec 13, 2011 at 12:20 PM, Andreas Harder <aharder@uni-koblenz.de> wrote:
>>
>> On 13.12.2011, at 16:44, Wolfgang Schuster wrote:
>>
>>>
>>> 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[..,..=..,..]).
>>
>> Hi Wolfgang,
>>
>> I modified the example (hopefully in a meaningful manner). I get the desired output with the old beta, but it still fails with todays beta.
>>
>> \setuplayout [width=middle,height=middle,header=0pt,footer=0pt]
>> \definelayout[first]  [header=2cm]
>> \definelayout[last]   [footer=2cm]
>> \definelayout[current]
>>
>> \starttext  \showframe % \checkcurrentlayout
>>  % \dorecurse{2}{test\page} % last is wrong
>>  \dorecurse{5}{test\page} % page 2 and „last“ are wrong
>> \stoptext
>>
>>
>> Andreas
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>
>
>
> --
> Peter Park Nelson
> peter.park.nelson@gmail.com



-- 
Peter Park Nelson
peter.park.nelson@gmail.com
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-28 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 15:26 \definelayout Andreas Harder
2011-12-13 15:44 ` \definelayout Wolfgang Schuster
2011-12-13 18:20   ` \definelayout Andreas Harder
2011-12-28  4:19     ` \definelayout Peter Park Nelson
2011-12-28 18:25       ` \definelayout Peter Park Nelson

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).