RE: [NTG-context] \setuplayout --- what do parameters mean?

2004-11-04 Thread jimarin
Hi David,

I use the following code...which I borrowed and adapted from someone else (I
think it was from Patrick Gundlach's http://levana.de/context/) to explore
graphically the meanings of the parameters of \setuplayout.

I used it when developing my own style for presentations...I am aware it may
not be perfect but I hope it does help you

Greetings

Jose Ignacio Marin

The code

(the unknown commands like \Location \Style etc... are for you to substitute
with values you want)


%
\setuplayout
  [
  location=\Location,
  style=\Style,
  marking=\Marking,
  scale=\Scale,
  nx=\Nx,
  ny=\Ny,
  dx=\Dx,
  dy=\Dy,
  lines=\Lines,
  grid=\Grid,
  bottomspace=\BottomSpace,
  cutspace=\CutSpace,
  horoffset=\HorOffset,
  veroffset=\VerOffset,
  backspace=\BackSpace,
  leftmargin=\LeftMargin,
  leftmargindistance=\LeftMarginDistance,
  width=\Width,
  rightmargin=\LeftMargin,
  rightmargindistance=\LeftMarginDistance,
  topspace=\TopSpace,
  header=\Header,
  headerdistance=\HeaderDistance,
  height=\Height,
  footerdistance=\FooterDistance,
  footer=\Footer,
  paperwidth=\PaperWidth,
  paperheight=\PaperHeight,
  leftedge=\LeftEdge,
  leftedgedistance=\LeftEdgeDistance,
  rightedge=\RightEdge,
  rightedgedistance=\RightEdgeDistance,
  top=\Top,
  topdistance=\TopDistance,
  bottom=\Bottom,
  bottomdistance=\BottomDistance
  ]

% PAGE TEST
\startreusableMPgraphic{TestPage}
  StartPage;
  path p;
  fill Page withcolor .95white;

  % backspace and topspace
  p:= ulcorner Page --
  llcorner Page --
  llcorner Page shifted (BackSpace,0) --
  ulcorner Page shifted (BackSpace,0) -- cycle;
  fill p withcolor transparent(1,0.5,green);

  p:= ulcorner Page --
  urcorner Page --
  urcorner Page shifted (0,-TopSpace) --
  ulcorner Page shifted (0,-TopSpace) -- cycle;
  fill p withcolor transparent(1,0.5,blue);

  % a red bottom...
  p:= (Hstep[LeftEdge], Vstep[Bottom]) --
  (Hstep[RightEdge],Vstep[Bottom]) --
  (Hstep[RightEdge],Vstep[Bottom]+Vsize[Bottom]) --
  (Hstep[LeftEdge], Vstep[Bottom]+Vsize[Bottom]) -- cycle;
  fill p withcolor transparent(1,0.5,red);

  % leftmargin and rightmargin
  p:= (Hstep[LeftMargin],Vstep[Text])--
  (Hstep[LeftMargin] + Hsize[LeftMargin],Vstep[Text]) --
  (Hstep[LeftMargin] + Hsize[LeftMargin],Vstep[Text]+Vsize[Text])--
  (Hstep[LeftMargin],Vstep[Text]+Vsize[Text])--
cycle;
  draw p withpen pencircle scaled .5mm withcolor blue dashed evenly;

  p:= (Hstep[RightMargin], Vstep[Text])--
  (Hstep[RightMargin] + Hsize[RightMargin],Vstep[Text]) --
  (Hstep[RightMargin] + Hsize[RightMargin],Vstep[Text]+Vsize[Text])--
  (Hstep[RightMargin], Vstep[Text]+Vsize[Text])--
cycle;
  draw p withpen pencircle scaled .5mm withcolor blue dashed evenly;

  % leftedge and rightedge
  p:= (Hstep[LeftEdge],Vstep[Text])--
  (Hstep[LeftEdge] + Hsize[LeftEdge],Vstep[Text]) --
  (Hstep[LeftEdge] + Hsize[LeftEdge],Vstep[Text]+Vsize[Text])--
  (Hstep[LeftEdge],Vstep[Text]+Vsize[Text])-- cycle;
  draw p withpen pencircle scaled .5mm withcolor red dashed evenly;

  p:= (Hstep[RightEdge], Vstep[Text])--
  (Hstep[RightEdge] + Hsize[RightEdge],Vstep[Text]) --
  (Hstep[RightEdge] + Hsize[RightEdge],Vstep[Text]+Vsize[Text])--
  (Hstep[RightEdge], Vstep[Text]+Vsize[Text])--
cycle;
  draw p withpen pencircle scaled .5mm withcolor red dashed evenly;

  % let's draw the header (notice that Vsize[Header] and HeaderHeight
  %are the same!)
  p:= (BackSpace, Vstep[Header]) --
  (BackSpace+MakeupWidth, Vstep[Header]) --
  (BackSpace+MakeupWidth, Vstep[Header]+Vsize[Header]) --
  (BackSpace, Vstep[Header]+HeaderHeight) -- cycle ;

  draw p withpen pencircle scaled .5mm withcolor blue dashed evenly;

  % and now for the footer
  p:= (BackSpace, Vstep[Footer]) --
  (BackSpace+MakeupWidth, Vstep[Footer]) --
  (BackSpace+MakeupWidth, Vstep[Footer]+FooterHeight) --
  (BackSpace, Vstep[Footer]+FooterHeight) -- cycle ;

  draw p withpen pencircle scaled .5mm withcolor blue dashed evenly;

  % And now for something completely different :)
  drawoptions (withcolor transparent (1,0.9,yellow) withpen pencircle scaled
.3mm);

  draw Field [Text][Top];
  draw Field [Text][Header];
  draw Field [Text][Text];
  draw Field [Text][Footer];
  % Field[][] = Area[][] shifted Location[][]
  draw Area [Text][Bottom] shifted Location [Text][Bottom];

  % needed, since LeftMargin+LeftMarginDistance  BackSpace
  setbounds currentpicture to boundingbox Page;
\stopreusableMPgraphic

\startbuffer[TestPage]
\reuseMPgraphic{TestPage}
\stopbuffer
\startMPpage
StartPage ;
\stopMPpage
%






-Mensaje original-
De: [EMAIL 

Re: [NTG-context] \setuplayout --- what do parameters mean?

2004-11-04 Thread Henning Hraban Ramm
Am 04.11.2004 um 03:43 schrieb David Arnold:
I have a hard time working out what it means. I know I can do 
\showframe,
Try \showlayout
Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context