Changes

Jump to navigation Jump to search
12 bytes added ,  21:22, 24 November 2012
m
Added links to commands
= Basic setup =
== Setting paper size ({{cmd|setuppapersize}}) ==
Plain TeX and LaTeX were primarily developed in the US. So, they default to letter paper, which is the standard paper size in the US. ConTeXt was developed in the Netherlands. So, it defaults to A4 paper, which is the standard paper size in Europe (and almost everywhere else in the world).
* a few more paper sizes, which I will not mention here. See <tt>page-lay.mki(i|v)</tt> for details.
== Defining new paper sizes ({{cmd|definepapersize}})==
The predefined paper sizes in ConTeXt cannot fit all needs. To define a new paper size, use
<texcode>\definepapersize[exotic]
[width=50mm, height=100mm]</texcode>
which defines a paper that is 50mm wide and 100mm high; the name of this paper is ''exotic'' (we could have used any other word). All predefined paper sizes are defined using <{{cmd>|definepapersize</cmd>}}. For example, <tt>A4</tt> paper is defined as:
<texcode>\definepapersize [A4] [width=210mm,height=297mm]</texcode>
<texcode>\definepapersize[main] [A4]
\definepapersize[extra][A4,landscape]</texcode>
One way to change document size is to permanently change the paper size using <{{cmd>|setuppapersize</cmd> }} and then revert back using <{{cmd>|setuppapersize</cmd>}}.
<texcode>% Set the default paper size
\stoptext</texcode>
The <{{cmd>|page</cmd> }} before <{{cmd>|setuppapersize</cmd> }} is necessary as <{{cmd>|setuppapersize</cmd> }} changes the size of the current page.
Often times, a different paper size is needed only for one page. Rather than manually switching the paper size back and forth using <{{cmd>|setuppapersize</cmd>}}, a convenient alternative is to use <{{cmd>|adaptpapersize</cmd>}}, which automatically reverts back to the existing paper size after ''one'' page. This is illustrated by the following example.
<texcode>\setuppapersize[main]
Page 4. Portrait \page
\stoptext</texcode>
As with <{{cmd>|setuppapersize</cmd>}}, always use an explicit <{{cmd>|page</cmd> }} before <{{cmd>|adaptpapersize</cmd>}}.
= Setting print size =
Occasionally you may want to print on a larger paper than the actual page size. This could be because you want to print to the edge of the page&mdash;so you print on a large paper and crop later&mdash;or because the page size that you are using is not standard. For example, suppose you want to print an <tt>A5</tt> page on a <tt>A4</tt> paper (and crop later). For that, you need to specify that the paper size is <tt>A5</tt> but the ''print paper'' size is <tt>A4</tt>. This information is specified using the two argument version of the <{{cmd>|setuppapersize</cmd>}}:
<texcode>\setuppapersize[A5][A4]</texcode>
== Defining page and print size combinations ==
It is convenient to define paper-size/print-paper-size combination for later reuse. These are also defined using <{{cmd>|definepapersize</cmd>}}. For example, suppose you want to define two paper-size/print-paper-size combinations: <tt>A4</tt> paper on <tt>A4</tt> print paper for normal work flow, and <tt>A4</tt> paper on <tt>A3</tt> print paper for the final proofs. For that, use the following:
<texcode>\definepapersize[regular][A4][A4]

Navigation menu