From: <jimarin@bayesinf.com>
Subject: RE: \setuplayout --- what do parameters mean?
Date: Thu, 4 Nov 2004 11:59:43 +0100 [thread overview]
Message-ID: <HCEEJMJIEMMCDOCOJCGLCELICAAA.jimarin@bayesinf.com> (raw)
In-Reply-To: <3.0.5.32.20041103184329.007fd9a0@mail.northcoast.com>
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: ntg-context-bounces@ntg.nl [mailto:ntg-context-bounces@ntg.nl]En
nombre de David Arnold
Enviado el: jueves, 04 de noviembre de 2004 3:43
Para: ntg-context@ntg.nl
Asunto: [NTG-context] \setuplayout --- what do parameters mean?
All,
When I see something like this:
\setuplayout
[topspace=10pt,
header=40pt,
headerdistance=20pt,
height=middle,
footerdistance=20pt,
footer=0pt,
bottomdistance=10pt,
bottom=20pt,
bottomspace=40pt,
backspace=30pt,
width=middle]
I have a hard time working out what it means. I know I can do \showframe,
but that doesn't indicate everything I need to see. Does anyone have a
macro that shows ALL of these parameters in a visual way, similar to that
on page 182 of the Latex User Guide, 2nd ed., Lamport?
_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
next prev parent reply other threads:[~2004-11-04 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-04 2:43 David Arnold
2004-11-04 10:59 ` jimarin [this message]
2004-11-04 18:01 ` Henning Hraban Ramm
2004-11-04 22:07 ` Patrick Gundlach
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=HCEEJMJIEMMCDOCOJCGLCELICAAA.jimarin@bayesinf.com \
--to=jimarin@bayesinf.com \
--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).