Re: [NTG-context] Irregularity in a topspace a bottomspace?

2010-06-11 Thread Wolfgang Schuster

Am 11.06.10 07:45, schrieb Jaroslav Hajtmar:

Hi all.
I was surprised that when I set up (in the MKII and MKIV too) topspace 
parameter to a nonzero value and the value of the bottomspace 
parameter to zero value, then the size of bottomspace is the same as 
topspace size.
On the other side, if I set topspace to zero value and the bottomspace 
to nonzero value, ConTeXt behaves as I expected.

Is this a normal behavior ConTeXt?
Ie. when bottomspace is zero, then  the paper has only the tops and 
not bottoms?


When you set 'width=fit' or 'width=middle' context looks at the 
bottomspace value and if the bottomspace height is 0pt it assign to the 
bottomspace the height of the topspace. The only thing you can do it to 
assign a domension ti height, e.g. 'height=15cm'.


@Hans: How about a 'height=auto' key which calculates the textheight 
like 'height=middle' but doen't change the bottomspace value even if the 
value is 0pt?


Wolgang

___
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
___


Re: [NTG-context] Irregularity in a topspace a bottomspace?

2010-06-11 Thread Wolfgang Schuster

Am 11.06.10 07:45, schrieb Jaroslav Hajtmar:

Hi all.
I was surprised that when I set up (in the MKII and MKIV too) topspace
parameter to a nonzero value and the value of the bottomspace parameter
to zero value, then the size of bottomspace is the same as topspace size.
On the other side, if I set topspace to zero value and the bottomspace
to nonzero value, ConTeXt behaves as I expected.
Is this a normal behavior ConTeXt?
Ie. when bottomspace is zero, then the paper has only the tops and not
bottoms?



As told in my other mail that's not possible with a calculated text 
height but here is a patch:


\unprotected\def\dorecalculatelayout
  {%\the\everybeforelayout
   \setups[\layoutparameter\c!preset]%
   \global\leftmarginwidth \layoutparameter\c!leftmargin
   \global\rightmarginwidth\layoutparameter\c!rightmargin
   \global\leftedgewidth   \layoutparameter\c!leftedge
   \global\rightedgewidth  \layoutparameter\c!rightedge
   \global\headerheight\layoutparameter\c!header
   \global\footerheight\layoutparameter\c!footer
   \global\bottomheight\layoutparameter\c!bottom
   \global\topheight   \layoutparameter\c!top
   \global\backspace   \layoutparameter\c!backspace
   \global\topspace\layoutparameter\c!topspace
   \setlayoutdimensions % the rest of the `dimensions'
   \docheckgridsnapping
   \doprocesslocalsetups{\layoutparameter\c!setups}% depends on 
gridsnapping !

   \simplesetupwhitespace
   \simplesetupblank
   \setupinterlinespace[\v!reset]% \synchronizegloballinespecs
   \global\cutspace\layoutparameter\c!cutspace
   \relax
   \doifelse{\layoutparameter\c!width}\v!middle
 {\ifdim\cutspace=\zeropoint
\global\cutspace\backspace
  \fi
  \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}
 {\doifelse{\layoutparameter\c!width}\v!auto
{\global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}
{\doifelse{\layoutparameter\c!width}\v!fit
   {\ifdim\cutspace=\zeropoint
  \global\cutspace\backspace
\fi
\global\makeupwidth\dimexpr\paperwidth-\cutspace\relax
\scratchdimen\dimexpr\backspace
  -\leftedgewidth  -\leftedgedistance
  -\leftmarginwidth-\leftmargindistance\relax
\ifdim\scratchdimen\zeropoint
  \scratchdimen\zeropoint
\fi
\global\advance\makeupwidth\dimexpr
  -\rightmargindistance-\rightmarginwidth
  -\rightedgedistance  -\rightedgewidth
  -\scratchdimen\relax}
   {\global\makeupwidth\layoutparameter\c!width\relax
\ifdim\cutspace=\zeropoint

\global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax
   % \else
   % A kind of inconsistent specification, but used
   % in for instance s-pre-19.tex; the cutspace is
   % used only for determining some kind of right
   % margin; don't use this in doublesided mode
\fi}}}%
   \scratchdimen\layoutparameter\c!bottomspace\relax
  %\ifdim\scratchdimen=\zeropoint
  %  \scratchdimen\topspace
  %\fi
   \global\bottomspace\layoutparameter\c!bottomspace\relax
   \global\layoutlines0\number\layoutparameter\c!lines\relax % may be empty
   \ifcase\layoutlines
 \doifelse{\layoutparameter\c!height}\v!middle
   {\ifdim\bottomspace=\zeropoint
  \global\bottomspace\topspace
\fi

\global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
   {\doifelse{\layoutparameter\c!height}\v!auto

{\global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
  {\doifelse{\layoutparameter\c!height}\v!fit
 {\ifdim\bottomspace=\zeropoint
\global\bottomspace\topspace
  \fi
  \global\makeupheight\dimexpr\paperheight-\bottomspace\relax
  \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax
  \ifdim\scratchdimen\zeropoint
\scratchdimen\zeropoint
  \fi

\global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax}
 {\global\makeupheight\layoutparameter\c!height\relax
  \ifdim\bottomspace=\zeropoint

\global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax
  \else
% inconsistent specification
  \fi}}}%
   \else
 % beware, when the bodyfont changes (switched) this will change as 
well; implementing
 % a global lineheight is tricky: should we take the bodyfont 
interlinespace or the one set
 % independent of the bodyfont (before or after a layout spec); way 
too fuzzy, so we
 % stick to the current method (after a night of experimenting 
...2003/10/13)

 \global\makeupheight\dimexpr
\layoutparameter\c!lines\lineheight-\strutheight+\topskip+
\headerdistance+\headerheight+\footerdistance+\footerheight\relax
   \fi
   

Re: [NTG-context] Irregularity in a topspace a bottomspace?

2010-06-11 Thread Jaroslav Hajtmar

Ok. Thanx.
I see that you are due my ignorance revealed a problem that I did not 
report :-)


Jaroslav


Dne 11.6.2010 11:50, Wolfgang Schuster napsal(a):

Am 11.06.10 07:45, schrieb Jaroslav Hajtmar:

Hi all.
I was surprised that when I set up (in the MKII and MKIV too) topspace
parameter to a nonzero value and the value of the bottomspace parameter
to zero value, then the size of bottomspace is the same as topspace 
size.

On the other side, if I set topspace to zero value and the bottomspace
to nonzero value, ConTeXt behaves as I expected.
Is this a normal behavior ConTeXt?
Ie. when bottomspace is zero, then the paper has only the tops and not
bottoms?



As told in my other mail that's not possible with a calculated text 
height but here is a patch:


\unprotected\def\dorecalculatelayout
  {%\the\everybeforelayout
   \setups[\layoutparameter\c!preset]%
   \global\leftmarginwidth \layoutparameter\c!leftmargin
   \global\rightmarginwidth\layoutparameter\c!rightmargin
   \global\leftedgewidth   \layoutparameter\c!leftedge
   \global\rightedgewidth  \layoutparameter\c!rightedge
   \global\headerheight\layoutparameter\c!header
   \global\footerheight\layoutparameter\c!footer
   \global\bottomheight\layoutparameter\c!bottom
   \global\topheight   \layoutparameter\c!top
   \global\backspace   \layoutparameter\c!backspace
   \global\topspace\layoutparameter\c!topspace
   \setlayoutdimensions % the rest of the `dimensions'
   \docheckgridsnapping
   \doprocesslocalsetups{\layoutparameter\c!setups}% depends on 
gridsnapping !

   \simplesetupwhitespace
   \simplesetupblank
   \setupinterlinespace[\v!reset]% \synchronizegloballinespecs
   \global\cutspace\layoutparameter\c!cutspace
   \relax
   \doifelse{\layoutparameter\c!width}\v!middle
 {\ifdim\cutspace=\zeropoint
\global\cutspace\backspace
  \fi
  \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}
 {\doifelse{\layoutparameter\c!width}\v!auto

{\global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}

{\doifelse{\layoutparameter\c!width}\v!fit
   {\ifdim\cutspace=\zeropoint
  \global\cutspace\backspace
\fi
\global\makeupwidth\dimexpr\paperwidth-\cutspace\relax
\scratchdimen\dimexpr\backspace
  -\leftedgewidth  -\leftedgedistance
  -\leftmarginwidth-\leftmargindistance\relax
\ifdim\scratchdimen\zeropoint
  \scratchdimen\zeropoint
\fi
\global\advance\makeupwidth\dimexpr
  -\rightmargindistance-\rightmarginwidth
  -\rightedgedistance  -\rightedgewidth
  -\scratchdimen\relax}
   {\global\makeupwidth\layoutparameter\c!width\relax
\ifdim\cutspace=\zeropoint

\global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax
   % \else
   % A kind of inconsistent specification, but used
   % in for instance s-pre-19.tex; the cutspace is
   % used only for determining some kind of right
   % margin; don't use this in doublesided mode
\fi}}}%
   \scratchdimen\layoutparameter\c!bottomspace\relax
  %\ifdim\scratchdimen=\zeropoint
  %  \scratchdimen\topspace
  %\fi
   \global\bottomspace\layoutparameter\c!bottomspace\relax
   \global\layoutlines0\number\layoutparameter\c!lines\relax % may be 
empty

   \ifcase\layoutlines
 \doifelse{\layoutparameter\c!height}\v!middle
   {\ifdim\bottomspace=\zeropoint
  \global\bottomspace\topspace
\fi

\global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
   {\doifelse{\layoutparameter\c!height}\v!auto

{\global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
  {\doifelse{\layoutparameter\c!height}\v!fit
 {\ifdim\bottomspace=\zeropoint
\global\bottomspace\topspace
  \fi
  \global\makeupheight\dimexpr\paperheight-\bottomspace\relax
  
\scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax

  \ifdim\scratchdimen\zeropoint
\scratchdimen\zeropoint
  \fi

\global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax} 


 {\global\makeupheight\layoutparameter\c!height\relax
  \ifdim\bottomspace=\zeropoint

\global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax
  \else
% inconsistent specification
  \fi}}}%
   \else
 % beware, when the bodyfont changes (switched) this will change 
as well; implementing
 % a global lineheight is tricky: should we take the bodyfont 
interlinespace or the one set
 % independent of the bodyfont (before or after a layout spec); 
way too fuzzy, so we
 % stick to the current method (after a night of experimenting 
...2003/10/13)

 \global\makeupheight\dimexpr

[NTG-context] Irregularity in a topspace a bottomspace?

2010-06-10 Thread Jaroslav Hajtmar

Hi all.
I was surprised that when I set up (in the MKII and MKIV too) topspace 
parameter to a nonzero value and the value of the bottomspace parameter 
to zero value, then the size of bottomspace is the same as topspace size.
On the other side, if I set topspace to zero value and the bottomspace 
to nonzero value, ConTeXt behaves as I expected.

Is this a normal behavior ConTeXt?
Ie. when bottomspace is zero, then  the paper has only the tops and not 
bottoms?


Thanx

Jaroslav

My minimal example (watch showlayout):

1. topspace is nonzero, bottomspace is zero value:

\setuplayout[
backspace=0cm,
leftmargin=0cm,
width=fit,
rightmargin=0cm,
cutspace=0cm,
topspace=2cm,
headerdistance=0cm,
header=0cm,
height=fit,
footerdistance=0cm,
footer=0cm,
bottomspace=0cm
]


\starttext
\showlayout
\input tufte
\stoptext


2. topspace is nonzero, bottomspace is nonzero value too:

\setuplayout[
backspace=0cm,
leftmargin=0cm,
width=fit,
rightmargin=0cm,
cutspace=0cm,
topspace=2cm,
headerdistance=0cm,
header=0cm,
height=fit,
footerdistance=0cm,
footer=0cm,
bottomspace=1cm
]


\starttext
\showlayout
\input tufte
\stoptext


3. topspace is zero, bottomspace is nonzero value:
\setuplayout[
backspace=0cm,
leftmargin=0cm,
width=fit,
rightmargin=0cm,
cutspace=0cm,
topspace=0cm,
headerdistance=0cm,
header=0cm,
height=fit,
footerdistance=0cm,
footer=0cm,
bottomspace=1cm
]


\starttext
\showlayout
\input tufte
\stoptext

___
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
___