Changes

Jump to navigation Jump to search
2,175 bytes added ,  16:12, 12 November 2019
no edit summary
|attributes=
}}
 
__TOC__
 
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>setuplayout</syntax>
== [[Help:Reference|Syntax]] ==
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:width|width]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] [[Reference/enCommand/value:fit|fit]] [[Reference/enCommand/value:middle|middle]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:height|height]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] [[Reference/enCommand/value:fit|fit]] [[Reference/enCommand/value:middle|middle]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:backspace|backspace]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:topspace|topspace]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:margin|margin]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:leftmargin|leftmargin]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:rightmargin|rightmargin]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:header|header]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:footer|footer]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:top|top]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:bottom|bottom]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:leftedge|leftedge]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:rightedge|rightedge]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:headerdistance|headerdistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:footerdistance|footerdistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:topdistance|topdistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:bottomdistance|bottomdistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:leftmargindistance|leftmargindistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:rightmargindistance|rightmargindistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:leftedgedistance|leftedgedistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:rightedgedistance|rightedgedistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:horoffset|horoffset]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:veroffset|veroffset]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:style|style]]</td> <td>[[Reference/enCommand/value:normal|normal]] [[Reference/enCommand/value:bold|bold]] [[Reference/enCommand/value:slanted|slanted]] [[Reference/enCommand/value:boldslanted|boldslanted]] [[Reference/enCommand/value:type|type]] [[Reference/enCommand/value:cap|cap]] [[Reference/enCommand/value:small...|small...]] [[Reference/enCommand/value:command|command]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:color|color]]</td> <td>[[Reference/enCommand/value:name|name]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:marking|marking]]</td> <td>[[Reference/enCommand/value:on|on]] [[Reference/enCommand/value:off|off]] [[Reference/enCommand/value:color|color]] [[Reference/enCommand/value:screen|screen]] [[Reference/enCommand/value:text|text]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:location|location]]</td> <td>[[Reference/enCommand/value:left|left]] [[Reference/enCommand/value:middle|middle]] [[Reference/enCommand/value:right|right]] [[Reference/enCommand/value:bottom|bottom]] [[Reference/enCommand/value:top|top]] [[Reference/enCommand/value:singlesided|singlesided]] [[Reference/enCommand/value:doublesided|doublesided]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:scale|scale]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:nx|nx]]</td> <td>[[Reference/enCommand/value:number|number]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:ny|ny]]</td> <td>[[Reference/enCommand/value:number|number]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:dx|dx]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:dy|dy]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:lines|lines]]</td> <td>[[Reference/enCommand/value:number|number]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:columns|columns]]</td> <td>[[Reference/enCommand/value:number|number]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:columndistance|columndistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:grid|grid]]</td> <td>[[Reference/enCommand/value:yes|yes]] [[Reference/enCommand/value:no|no]] more see below</td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:bottomspace|bottomspace]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:cutspace|cutspace]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:textdistance|textdistance]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:textwidth|textwidth]]</td> <td>[[Reference/enCommand/value:number|number]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:textmargin|textmargin]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:clipoffset|clipoffset]]</td> <td>[[Reference/enCommand/value:dimension|dimension]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:page|page]]</td> <td>[[Reference/enCommand/value:name|name]] </td>
</tr>
<tr valign="top" class="first">
<td class="cmd">[[Reference/enCommand/keyword:paper|paper]]</td> <td>[[Reference/enCommand/value:name|name]] </td>
</tr>
</table>
== Description ==
<pre>
Horizontal: (if singleside then outside is at right and inside is at left)
===========
width => width of text area
middle: automatic calculation consider A) params
fit: automatic calculation consider A)+B) params
dimension: cutspace should be 0 and is calculated according to backspace
A) params: (\paperwidth=\backspace+\makeupwidth+\cutspace)== Horizontal === If the document is singlesided, then the 'outside' is the right side and the 'inside' is the left side. backspace =The <code> width of inner margincutspace =</code> parameter sets <code>\makeupwidth</code> , the width of outer margin (if 0 then = backspace!)the text area.
B) params:leftmargin/rightmargin =* <code> width of leftmargin=middle</rightmargin areacode> solves the following equation to set the makeupwidth:margin paperwidth =\backspace + \makeupwidth+ \cutspace** <code> width of outer marginleftedgebackspace</rightedge =code> width is the distance from the inside edge of the paper to the edge of leftedge/rightedge the text area.*distance (like leftmargindistance) =* <code>cutspace</code> space separates * is the width from the outside edge of the text area from to the edge of the paper. If cutspace is set to 0, it is taken to be equal to the innerbackspace.
* if <code>width=fit</code>, then the calculation is like for <code>width=middle</code>, but with the following additions:** <code>leftmargin/rightmargin</code> => width of leftmargin/rightmargin area** <code>margin</code> => width of outer margin** <code>leftedge/rightedge</code> => width of leftedge/rightedge area** <code>*distance</code> (like leftmargindistance) => space separates * area from the inner** <code>horoffset =</code> is applied after the various width calculations to shift material towards everything bodily to the outside (not tought width calculation).
Vertical:=======Comment ==
Others:=======What is needed is a picture of a page with each of these layout parameters indicated. (see [[Layout]])
</pre>== comment ==You can use the {{cmd|showframe}} macro to see the results of your layout. Just put the command before the \starttext and lines will be drawn on your document showing the different areas.
What is needed is a picture of a page with each of these layout parameters indicated. == Grid Setups ==
In MkIV, at least, a number of presets for the <code>grid</code> parameter were defined using {{cmd|definegridsnapping}}; they can be invoked by e.g. <code>\setuplayout[grid=normal]</code>. The presets are all combinations of the following options:
You can {| class=wikitable|-| <code>none</code> || don't enlarge|-| <code>halfline</code> || enlarge by halfline/halfline|-| <code>line</code> || enlarge by line/line|-| <code>strut</code> || enlarge by ht/dp (default)|-| <code>first</code> || align to top line|-| <code>last</code> || align to bottom line|-| <code>mindepth</code> || round depth down|-| <code>maxdepth</code> || round depth up|-| <code>minheight</code> || round height down|-| <code>maxheight</code> || round height up|-| <code>local</code> || use the [[cmdlocal interline space|-| <code>shift:showframe-3tp</code> || vertical shift within box|\showframe]] macro to see the results of your layout. Just put the command before the \starttext and lines will be drawn on your document showing the different areas.-|}
These are the presets and their definitions.
{| class=wikitable
|-
| \definegridsnapping[normal] || [maxheight,maxdepth,strut]
|-
| \definegridsnapping[standard] || [maxheight,maxdepth,strut]
|-
| \definegridsnapping[yes] || [maxheight,maxdepth,strut]
|-
|
|-
| \definegridsnapping[strict] || [\v!maxdepth:0.8,maxheight:0.8,strut]
|-
| \definegridsnapping[tolerant] || [\v!maxdepth:1.2,maxheight:1.2,strut]
|-
|
|-
| \definegridsnapping[top] || [minheight,maxdepth,strut]
|-
| \definegridsnapping[bottom] || [maxheight,mindepth,strut]
|-
| \definegridsnapping[both] || [minheight,mindepth,strut]
|-
|
|-
| \definegridsnapping[broad] || [maxheight,maxdepth,strut,0.8]
|-
| \definegridsnapping[fit] || [maxheight,maxdepth,strut,1.2]
|-
|
|-
| \definegridsnapping[first] || [first]
|-
| \definegridsnapping[last] || [last]
|-
| \definegridsnapping[high] || [minheight,maxdepth,none]
|-
| \definegridsnapping[low] || [maxheight,mindepth,none]
|-
| \definegridsnapping[line] || [line]
|-
| \definegridsnapping[strut] || [strut]
|-
|
|-
| \definegridsnapping[max] || [maxdepth,maxheight,strut]
|-
| \definegridsnapping[min] || [mindepth,minheight,strut]
|-
|}
== Example ==
<texcodecontext source=yes>\setuppapersize[A10] 
%% This is an example for showing the effect of the vertical parameters
%% top, topdistance, bottom, bottomdistance and topspace.
%% Just play around with these parameters.
 
\showframe
%% Show the top and the bottom with blue color:
\setupcolors[state=start]\setupbackgrounds[topheader,bottomfooter][background=color,backgroundcolor=blue]
\def\MyLength{50pt10pt}
\setuplayout[
header=0pt,footer=0pt,headerdistance=0pt,footerdistance=0pt, top=\MyLength, topdistance=\MyLength, bottom=\MyLength, bottomdistance=\MyLength,
topspace=\dimexpr(\topheight + \topdistance),
height=fit]
\starttext
\dorecurse{7}{ \input tufte}\showsetupsthuan
\stoptext
 </texcodecontext
== See also ==
* [[Layout]]* {{cmd|setuppapersize}} to set the paper size* [[Paper sizes]] for a list of predefined paper sizes
<!== Help from ConTeXt-- something like [[cmdMailinglist/Forum ==All issues with:goto{{Forum|\goto]] -->{{SUBPAGENAME}}}}
[[Category:ReferenceCommand/enLayout|setuplayout]]

Navigation menu