Difference between revisions of "Command/setuplayout"
(Grid parameters) |
(remove manual syntax table, add pseudo columns) |
||
(19 intermediate revisions by 8 users not shown) | |||
Line 4: | Line 4: | ||
}} | }} | ||
− | + | __TOC__ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | == [[Help:Reference|Syntax]] (autogenerated) == | ||
+ | <syntax>setuplayout</syntax> | ||
== Description == | == Description == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Horizontal === | |
− | |||
− | |||
− | + | If the document is singlesided, then the 'outside' is the right side and the 'inside' is the left side. | |
− | |||
− | |||
− | |||
− | |||
− | + | The <code>width</code> parameter sets <code>\makeupwidth</code>, the width of the text area. | |
− | + | * <code>width=middle</code> solves the following equation to set the makeupwidth: | |
− | = | + | paperwidth = \backspace + \makeupwidth + \cutspace |
+ | ** <code>backspace</code> is the distance from the inside edge of the paper to the edge of the text area. | ||
+ | ** <code>cutspace</code> is the width from the outside edge of the text area to the edge of the paper. If cutspace is set to 0, it is taken to be equal to the backspace. | ||
− | + | * 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 everything bodily to the outside. | ||
− | + | == Comment == | |
− | == | ||
− | + | A picture of a page with each of these layout parameters indicated is shown in [[Layout]]. | |
+ | 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. | ||
− | + | == 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: |
− | + | {| 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 local interline space | ||
+ | |- | ||
+ | | <code>shift:-3tp</code> || vertical shift within box | ||
+ | |- | ||
+ | |} | ||
− | + | These are the presets and their definitions. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | \definegridsnapping[normal] [maxheight,maxdepth,strut] | + | {| class=wikitable |
− | \definegridsnapping[standard] [maxheight,maxdepth,strut] | + | |- |
− | \definegridsnapping[yes] [maxheight,maxdepth,strut] | + | | \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] | ||
+ | |- | ||
+ | |} | ||
− | + | == Pseudo columns == | |
− | |||
− | + | With the <code>columns</code> and <code>columndistance</code> parameters you can set up a design grid that is usually not visible and not related to real columns, but you can use it for placements on [[Layers]]. See the [[manual:details.pdf|Details]] manual. | |
− | |||
− | |||
− | + | == Example == | |
− | |||
− | + | <context source=yes> | |
− | + | \setuppapersize[A10] | |
− | |||
− | |||
− | \ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
%% This is an example for showing the effect of the vertical parameters | %% This is an example for showing the effect of the vertical parameters | ||
%% top, topdistance, bottom, bottomdistance and topspace. | %% top, topdistance, bottom, bottomdistance and topspace. | ||
%% Just play around with these parameters. | %% Just play around with these parameters. | ||
+ | |||
+ | \showframe | ||
%% Show the top and the bottom with blue color: | %% Show the top and the bottom with blue color: | ||
− | + | \setupbackgrounds[header, footer][background=color, backgroundcolor=blue] | |
− | \setupbackgrounds[ | ||
− | \def\MyLength{ | + | \def\MyLength{10pt} |
\setuplayout[ | \setuplayout[ | ||
− | + | top=\MyLength, | |
− | top=\MyLength,topdistance=\MyLength, | + | topdistance=\MyLength, |
− | bottom=\MyLength,bottomdistance=\MyLength, | + | bottom=\MyLength, |
+ | bottomdistance=\MyLength, | ||
topspace=\dimexpr(\topheight + \topdistance), | topspace=\dimexpr(\topheight + \topdistance), | ||
height=fit] | height=fit] | ||
\starttext | \starttext | ||
− | + | \input thuan | |
− | |||
\stoptext | \stoptext | ||
− | + | </context> | |
− | </ | ||
− | |||
== See also == | == See also == | ||
− | [[Layout]] | + | * [[Layout]] |
+ | * {{cmd|adaptlayout}} to locally adapt the page layout | ||
+ | * {{cmd|setuppapersize}} to set the paper size | ||
+ | * [[PaperSetup#Predefined_Paper_Sizes|Paper setup section]] for the predefined paper sizes and [[Paper sizes]] for theirs actuals dimensions in mm. | ||
− | + | == Help from ConTeXt-Mailinglist/Forum == | |
+ | All issues with: | ||
+ | {{Forum|{{SUBPAGENAME}}}} | ||
− | [[Category: | + | [[Category:Command/Layout|setuplayout]] |
+ | [[Category:Layout]] |
Latest revision as of 11:57, 30 July 2023
\setuplayout
Contents
Syntax (autogenerated)
\setuplayout[...][...=...,...] | |
[...] | name |
state | start stop normal repeat |
margin | dimension |
edge | dimension |
margindistance | dimension |
edgedistance | dimension |
leftedgedistance | dimension |
rightedgedistance | dimension |
leftmargindistance | dimension |
rightmargindistance | dimension |
topdistance | dimension |
headerdistance | dimension |
footerdistance | dimension |
bottomdistance | dimension |
preset | name |
leftmargin | dimension |
rightmargin | dimension |
leftedge | dimension |
rightedge | dimension |
header | dimension |
footer | dimension |
top | dimension |
bottom | dimension |
backspace | dimension |
topspace | dimension |
setups | name |
cutspace | dimension |
width | dimension middle fit |
bottomspace | dimension |
lines | number |
height | dimension middle fit |
horoffset | dimension |
veroffset | dimension |
columns | number |
columndistance | dimension |
method | default normal name |
location | left middle right top bottom singlesided doublesided |
textwidth | dimension |
textheight | dimension |
nx | number |
ny | number |
dx | dimension |
dy | dimension |
scale | number |
sx | number |
sy | number |
marking | on off page empty color one two four |
grid | yes no off |
textdistance | dimension |
alternative | default normal makeup name |
clipoffset | dimension |
cropoffset | dimension auto |
trimoffset | dimension |
bleedoffset | dimension |
artoffset | dimension |
direction | normal reverse |
\setuplayout[...] | |
[...] | reset name |
Description
Horizontal
If the document is singlesided, then the 'outside' is the right side and the 'inside' is the left side.
The width
parameter sets \makeupwidth
, the width of the text area.
width=middle
solves the following equation to set the makeupwidth:
paperwidth = \backspace + \makeupwidth + \cutspace
backspace
is the distance from the inside edge of the paper to the edge of the text area.cutspace
is the width from the outside edge of the text area to the edge of the paper. If cutspace is set to 0, it is taken to be equal to the backspace.
- if
width=fit
, then the calculation is like forwidth=middle
, but with the following additions:leftmargin/rightmargin
=> width of leftmargin/rightmargin areamargin
=> width of outer marginleftedge/rightedge
=> width of leftedge/rightedge area*distance
(like leftmargindistance) => space separates * area from the innerhoroffset
is applied after the various width calculations to shift everything bodily to the outside.
Comment
A picture of a page with each of these layout parameters indicated is shown in Layout.
You can use the \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.
Grid Setups
In MkIV, at least, a number of presets for the grid
parameter were defined using \definegridsnapping; they can be invoked by e.g. \setuplayout[grid=normal]
. The presets are all combinations of the following options:
none |
don't enlarge |
halfline |
enlarge by halfline/halfline |
line |
enlarge by line/line |
strut |
enlarge by ht/dp (default) |
first |
align to top line |
last |
align to bottom line |
mindepth |
round depth down |
maxdepth |
round depth up |
minheight |
round height down |
maxheight |
round height up |
local |
use local interline space |
shift:-3tp |
vertical shift within box |
These are the presets and their definitions.
\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] |
Pseudo columns
With the columns
and columndistance
parameters you can set up a design grid that is usually not visible and not related to real columns, but you can use it for placements on Layers. See the Details manual.
Example
\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: \setupbackgrounds[header, footer][background=color, backgroundcolor=blue] \def\MyLength{10pt} \setuplayout[ top=\MyLength, topdistance=\MyLength, bottom=\MyLength, bottomdistance=\MyLength, topspace=\dimexpr(\topheight + \topdistance), height=fit] \starttext \input thuan \stoptext
See also
- Layout
- \adaptlayout to locally adapt the page layout
- \setuppapersize to set the paper size
- Paper setup section for the predefined paper sizes and Paper sizes for theirs actuals dimensions in mm.
Help from ConTeXt-Mailinglist/Forum
All issues with: