Difference between revisions of "Layout"

From ConTeXt wiki
(Location of Areas: attempt to clarify table)
(Table of Parameters: attempt to clarify table)
Line 95: Line 95:
 
<td>backspace</td>
 
<td>backspace</td>
 
<td><cmd>backspace</cmd></td>
 
<td><cmd>backspace</cmd></td>
<td>from left rim of paper to left rim of text area</td>
+
<td>from left rim of paper to left rim of main text area</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 105: Line 105:
 
<td>width</td>
 
<td>width</td>
 
<td><cmd>makeupwidth</cmd></td>
 
<td><cmd>makeupwidth</cmd></td>
<td>normally same as textwidth</td>
+
<td>width of the main text area. <cmd>makeupwidth</cmd> is normally same as <cmd>textwidth</cmd>, but it can be different, for example in columns</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>top</td>
 
<td>top</td>
 
<td><cmd>topheight</cmd></td>
 
<td><cmd>topheight</cmd></td>
<td>??</td>
+
<td>height of the top area</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
 
<td>topdistance</td>
 
<td>topdistance</td>
 
<td><cmd>topdistance</cmd></td>
 
<td><cmd>topdistance</cmd></td>
<td>?? between topspace and header ??</td>
+
<td>between top and header</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 145: Line 145:
 
<td>bottomdistance</td>
 
<td>bottomdistance</td>
 
<td><cmd>bottomdistance</cmd></td>
 
<td><cmd>bottomdistance</cmd></td>
<td>?? between footer and bottom ??</td>
+
<td>between footer and bottom</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 156: Line 156:
 
<td><cmd>bottomspace</cmd></td>
 
<td><cmd>bottomspace</cmd></td>
 
<td>space from bottom footer to bottom rim of paper</td>
 
<td>space from bottom footer to bottom rim of paper</td>
 +
</tr>
 +
<tr>
 +
<td>cutspace</td>
 +
<td><cmd>cutspace</cmd></td>
 +
<td>from right rim of paper to right rim of main text area</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 165: Line 170:
 
<td>leftedgedistance</td>
 
<td>leftedgedistance</td>
 
<td><cmd>leftedgedistance</cmd></td>
 
<td><cmd>leftedgedistance</cmd></td>
<td>?? between leftegde and left margin ??</td>
+
<td>between leftegde and left margin</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 180: Line 185:
 
<td>textwidth</td>
 
<td>textwidth</td>
 
<td><cmd>textwidth</cmd></td>
 
<td><cmd>textwidth</cmd></td>
<td>width of text area</td>
+
<td>width of text area. when columns are used, the value of <cmd>textwidth</cmd> can differ from <cmd>makeupwidth</cmd></td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>
Line 195: Line 200:
 
<td>rightedgedistance</td>
 
<td>rightedgedistance</td>
 
<td><cmd>rightedgedistance</cmd></td>
 
<td><cmd>rightedgedistance</cmd></td>
<td>?? between right margin and right edge ??</td>
+
<td>between right margin and right edge</td>
 
</tr>
 
</tr>
 
<tr>
 
<tr>

Revision as of 16:47, 27 August 2008

< Visuals | Layers | Columns | Visual Debugging >

Location of Areas

You can use these design areas in your page:

leftedge leftmargin width rightmargin rightedge
top . . ↑ topspace ↓ . .
header . . HEADER
↑ headerheight ↓
. .
textheight ←leftedgewidth→ MARGINALS
←leftmarginwidth→
TEXT
←textwidth→
×
↑ textheight ↓
MARGINALS
←rightmarginwidth→
←rightedgewidth→
footer . . FOOTER
↑ footerheight ↓
. .
bottom . . ↑ bottomspace ↓ . .


The names in the column and row headers are the keywords for \setuplayout, the words inside of the table are given to clarify ConTeXT terminology. There are also keywords suffixed by "distance" to set the distance between each of the areas, e.g. leftedgedistance, leftmargindistance (from the named area to the inner).

height is normally used instead of textheight, it is the sum of footer + footerdistance + textheight + headerdistance + header

Table of Parameters

ParameterVariableRemarks
paperheight \paperheight height of paper page
paperwidth \paperwidth width of paper page
printpaperheight \printpaperheight differs from paperheight when using Imposition (arranging)
printpaperwidth \printpaperwidth differs from paperwidth when using Imposition (arranging)
topspace \topspace above header: from top rim of paper to to top rim of header
backspace \backspace from left rim of paper to left rim of main text area
height \makeupheight sum of heights of text area, header and footer (plus distances)
width \makeupwidth width of the main text area. \makeupwidth is normally same as \textwidth, but it can be different, for example in columns
top \topheight height of the top area
topdistance \topdistance between top and header
header \headerheight height of header area
headerdistance \headerdistance between header and text
textheight \textheight height of text area
footerdistance \footerdistance between text and footer
footer \footerheight height of footer area
bottomdistance \bottomdistance between footer and bottom
bottom \bottomheight space below footer (but isn't calculated automatically)
bottomspace \bottomspace space from bottom footer to bottom rim of paper
cutspace \cutspace from right rim of paper to right rim of main text area
leftedge \leftedgewidth from left rim of paper to left rim of left margin
leftedgedistance \leftedgedistance between leftegde and left margin
leftmargin \leftmarginwidth width of left margin (marginals space)
leftmargindistance \leftmargindistance between left margin and text
textwidth \textwidth width of text area. when columns are used, the value of \textwidth can differ from \makeupwidth
rightmargindistance \rightmargindistance between text area and right margin
rightmargin \rightmarginwidth width of right margin (marginals area)
rightedgedistance \rightedgedistance between right margin and right edge
rightedge \rightedgewidth from right margin to right rim of paper

Setup

You define always a right page; if you use a double page layout 'right' and 'left' values are mirrored on a left page.

\setuppapersize[A4][A4] % this is default and may be omitted
\setuplayout[backspace=20mm,
	width=160mm,
	topspace=20mm, top=0mm,
	header=0mm, footer=0mm,
	height=250mm]

You can make all the geometry information visible with \showlayout and the related commands.

See \setuplayout and \setuppapersize in the manual.

If you need an unusual paper size, use \definepapersize and have a look at our list of paper sizes.

Keep

If you have a certain run of text that you want to keep together, you can test for the number of lines available on the current page with \testpage[n] where n is the number of lines required. If there are not n lines available, a page break will be inserted at the location of the testpage command.

Hints

By using Layers, you can also place elements at specific places, as done in the BusinessCard example.

At Paul Tremblay's XML ConTeXt site, there's a lot about layout from a XML/FO perspective with some descriptive pictures.


TODO: Unfortunately it's not that easy to define a layout. We need more documentation about which parameters define which length, what influences what else etc. (See: To-Do List)