Difference between revisions of "Page Layout"

From Wiki
Jump to navigation Jump to search
m (todo tag)
(parameters table, enhanced layout area figure)
Line 1: Line 1:
 
< [[Visuals]] | [[Layers]] | [[Columns]] | [[Visual Debugging]] >
 
< [[Visuals]] | [[Layers]] | [[Columns]] | [[Visual Debugging]] >
 +
 +
== Location of Areas ==
  
 
You can use these design areas in your page:
 
You can use these design areas in your page:
Line 16: Line 18:
 
<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; topspace &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 24: Line 26:
 
<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;background:#DDDDDD;">header </td>
+
<td style="text-align:center;background:#DDDDDD;">HEADER<br />&uarr; headerheight &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 30: Line 32:
 
<tr style="background:#cccccc;">
 
<tr style="background:#cccccc;">
 
<td style="background:#ccccff;"> text </td>
 
<td style="background:#ccccff;"> text </td>
<td style="text-align:center;">. </td>
+
<td style="text-align:center;">&larr;leftedgewidth&rarr;</td>
<td style="text-align:center;background:#DDDDDD;">marginals </td>
+
<td style="text-align:center;background:#DDDDDD;">MARGINALS<br />&larr;leftmarginwidth&rarr;</td>
<td style="text-align:center;height:20em;background:#EEEEEE;">text </td>
+
<td style="text-align:center;height:20em;background:#EEEEEE;">TEXT<br />&larr;textwidth&rarr;<br />&times;<br />&uarr; textheight &darr;</td>
<td style="text-align:center;background:#DDDDDD;">marginals </td>
+
<td style="text-align:center;background:#DDDDDD;">MARGINALS<br />&larr;rightmarginwidth&rarr;</td>
<td style="text-align:center;">. </td>
+
<td style="text-align:center;">&larr;rightedgewidth&rarr;</td>
 
</tr>
 
</tr>
 
<tr style="background:#cccccc;">
 
<tr style="background:#cccccc;">
Line 40: Line 42:
 
<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;background:#DDDDDD;">footer </td>
+
<td style="text-align:center;background:#DDDDDD;">FOOTER<br />&uarr; footerheight &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 48: 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;">.</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 55: Line 57:
  
 
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>
 +
<tr style="background:#cccccc;vertical-align=top;"><th>Parameter</th><th>Variable</th><th>Remarks</th>
 +
</tr>
 +
<tr>
 +
<td>paperheight</td>
 +
<td><cmd>paperheight</cmd></td>
 +
<td>height of paper page</td>
 +
</tr>
 +
<tr>
 +
<td>paperwidth</td>
 +
<td><cmd>paperwidth</cmd></td>
 +
<td>width of paper page</td>
 +
</tr>
 +
<tr>
 +
<td>printpaperheight</td>
 +
<td><cmd>printpaperheight</cmd></td>
 +
<td>differs from paperheight when using [[Imposition]] (arranging)</td>
 +
</tr>
 +
<tr>
 +
<td>printpaperwidth</td>
 +
<td><cmd>printpaperwidth</cmd></td>
 +
<td>differs from paperwidth when using [[Imposition]] (arranging)</td>
 +
</tr>
 +
<tr>
 +
<td>topspace</td>
 +
<td><cmd>topspace</cmd></td>
 +
<td>above header: from top rim of paper to to top rim of header</td>
 +
</tr>
 +
<tr>
 +
<td>backspace</td>
 +
<td><cmd>backspace</cmd></td>
 +
<td>from left rim of paper to left rim of text area</td>
 +
</tr>
 +
<tr>
 +
<td>height</td>
 +
<td><cmd>makeupheight</cmd></td>
 +
<td>sum of heights of text area, header and footer (plus distances)</td>
 +
</tr>
 +
<tr>
 +
<td>width</td>
 +
<td><cmd>makeupwidth</cmd></td>
 +
<td>normally same as textwidth</td>
 +
</tr>
 +
<tr>
 +
<td>top</td>
 +
<td><cmd>topheight</cmd></td>
 +
<td>??</td>
 +
</tr>
 +
<tr>
 +
<td>topdistance</td>
 +
<td><cmd>topdistance</cmd></td>
 +
<td>?? between topspace and header ??</td>
 +
</tr>
 +
<tr>
 +
<td>header</td>
 +
<td><cmd>headerheight</cmd></td>
 +
<td>height of header area</td>
 +
</tr>
 +
<tr>
 +
<td>headerdistance</td>
 +
<td><cmd>headerdistance</cmd></td>
 +
<td>between header and text</td>
 +
</tr>
 +
<tr>
 +
<td>textheight</td>
 +
<td><cmd>textheight</cmd></td>
 +
<td>height of text area</td>
 +
</tr>
 +
<tr>
 +
<td>footerdistance</td>
 +
<td><cmd>footerdistance</cmd></td>
 +
<td>between text and footer</td>
 +
</tr>
 +
<tr>
 +
<td>footer</td>
 +
<td><cmd>footerheight</cmd></td>
 +
<td>height of footer area</td>
 +
</tr>
 +
<tr>
 +
<td>bottomdistance</td>
 +
<td><cmd>bottomdistance</cmd></td>
 +
<td>?? between footer and bottom ??</td>
 +
</tr>
 +
<tr>
 +
<td>bottom</td>
 +
<td><cmd>bottomheight</cmd></td>
 +
<td>space below footer (but isn't calculated automatically)</td>
 +
</tr>
 +
<tr>
 +
<td>leftedge</td>
 +
<td><cmd>leftedgewidth</cmd></td>
 +
<td>from left rim of paper to left rim of left margin</td>
 +
</tr>
 +
<tr>
 +
<td>leftedgedistance</td>
 +
<td><cmd>leftedgedistance</cmd></td>
 +
<td>?? between leftegde and left margin ??</td>
 +
</tr>
 +
<tr>
 +
<td>leftmargin</td>
 +
<td><cmd>leftmarginwidth</cmd></td>
 +
<td>width of left margin (marginals space)</td>
 +
</tr>
 +
<tr>
 +
<td>leftmargindistance</td>
 +
<td><cmd>leftmargindistance</cmd></td>
 +
<td>between left margin and text</td>
 +
</tr>
 +
<tr>
 +
<td>textwidth</td>
 +
<td><cmd>textwidth</cmd></td>
 +
<td>width of text area</td>
 +
</tr>
 +
<tr>
 +
<td>rightmargindistance</td>
 +
<td><cmd>rightmargindistance</cmd></td>
 +
<td>between text area and right margin</td>
 +
</tr>
 +
<tr>
 +
<td>rightmargin</td>
 +
<td><cmd>rightmarginwidth</cmd></td>
 +
<td>width of right margin (marginals area)</td>
 +
</tr>
 +
<tr>
 +
<td>rightedgedistance</td>
 +
<td><cmd>rightedgedistance</cmd></td>
 +
<td>?? between right margin and right edge ??</td>
 +
</tr>
 +
<tr>
 +
<td>rightedge</td>
 +
<td><cmd>rightedgewidth</cmd></td>
 +
<td>from right margin to right rim of paper</td>
 +
</tr>
 +
</table>
 +
 +
== Setup ==
 +
 +
You define always a right page; if you use a double page layout 'right' and 'left' values are mirrored on a left page.
  
 
<texcode>
 
<texcode>
Line 67: Line 210:
  
 
See <cmd>setuplayout</cmd> in the manual.
 
See <cmd>setuplayout</cmd> in the manual.
 +
 +
== Hints ==
  
 
By using [[Layers]], you can also place elements at specific places, as done in the [[BusinessCard]] example.
 
By using [[Layers]], you can also place elements at specific places, as done in the [[BusinessCard]] example.
Line 72: Line 217:
 
At [http://getfo.sourceforge.net/context_xml/index.html Paul Tremblay's] [[XML]] ConTeXt site, there's a lot about layout from a [[Formatting Objects|XML/FO]] perspective with some descriptive pictures.
 
At [http://getfo.sourceforge.net/context_xml/index.html Paul Tremblay's] [[XML]] ConTeXt site, there's a lot about layout from a [[Formatting Objects|XML/FO]] perspective with some descriptive pictures.
  
{{todo|Unfortunately it's not that easy to define a layout. We need documentation about which parameters define which length, what influences what else etc.}}
+
{{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.}}

Revision as of 16:16, 9 February 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 . . . . .

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.

\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 in the manual.

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)