Difference between revisions of "Layout"

From ConTeXt wiki
m (paper sizes)
(Location of Areas)
Line 50: Line 50:
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
<td style="text-align:center;">.</td>
+
<td style="text-align:center;">&uarr; bottomspace &darr;</td>
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
 
<td style="text-align:center;">. </td>
Line 56: Line 56:
 
</table>
 
</table>
  
There's also a "distance" between each of the areas, e.g. <tt>leftedgedistance</tt>, <tt>leftmargindistance</tt> (from the named area to the inner).  
+
There's also a "distance" between each of the areas, e.g. <tt>leftedgedistance</tt>, <tt>leftmargindistance</tt> (from the named area to the inner).
  
 
== Table of Parameters ==
 
== Table of Parameters ==

Revision as of 18:09, 1 September 2006

< Visuals | Layers | Columns | Visual Debugging >

Location of Areas

You can use these design areas in your page:

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

There's also a "distance" between each of the areas, e.g. leftedgedistance, leftmargindistance (from the named area to the inner).

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 text area
height \makeupheight sum of heights of text area, header and footer (plus distances)
width \makeupwidth normally same as textwidth
top \topheight ??
topdistance \topdistance ?? between topspace 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)
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
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.

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)