Difference between revisions of "Command/setuppapersize"

From Wiki
Jump to navigation Jump to search
m (Text replace - "== Help from ConTeXt-Forum ==" to "== Help from ConTeXt-Forum == All issues with:")
m (describe startTEXpage and co.)
(5 intermediate revisions by 2 users not shown)
Line 22: Line 22:
 
== Description ==  
 
== Description ==  
  
As the name suggests, <cmd>setuppapersize</cmd> sets the paper size for typesetting (the first argument) as well as the paper size for printing (the second argument). The second argument is optional; if omitted, it defaults to the value of the first argument.
+
The first argument of {{cmd|setuppapersize}} is the dimension a page will have. The second argument is the size of the paper the pages will be printed on; see {{cmd|setuparranging}} for placing multiple pages on a sheet. If the second argument is omitted, the paper size is assumed to equal the page size.
  
 
For example:
 
For example:
 
<texcode>
 
<texcode>
\setuppapersize[letter]
+
\setuppapersize[letter,landscape][letter,landscape,oversized]
 
</texcode>
 
</texcode>
  
sets the paper size to <tt>letter</tt> paper, which is a pre-defined paper size. Other pre-defined paper sizes include:
+
sets the size of the pages to letter size (landscape), and the size of the paper (before cutting) to oversized letter size, which has edges that are 1.5 cm longer. <tt>letter</tt> is a pre-defined papersize; one can define one's own papersizes using {{cmd|definepapersize}}.
  
* <tt>letter</tt>, <tt>ledger</tt>, <tt>tabloid</tt>, <tt>legal</tt>, <tt>folio</tt>, and <tt>executive</tt> sizes from the North American paper standard;
+
There are several options one can use to modify a predefined paper size:
* sizes <tt>A0</tt> &ndash; <tt>A10</tt>, <tt>B0</tt> &ndash; <tt>B10</tt>, and <tt>C0</tt> &ndash; <tt>C10</tt> from the A, B, and C series of the ISO-216 standard;
+
* <tt>portrait</tt>: the default paper sizes are 'standing up', taller than they are wide.
* sizes <tt>RA0</tt> &ndash; <tt>RA4</tt> and <tt>SRA0</tt> &ndash; <tt>SRA4</tt> from the RA and SRA series of ISO-217 paper standard;
+
* <tt>landscape</tt>: turn the paper 90 degrees so it is lying down
* sizes <tt>C6/C5</tt>, <tt>DL</tt>, and <tt>E4</tt> from ISO-269 standard envelope sizes;
+
* <tt>samesized</tt>: same size as the first argument
* <tt>envelope 9</tt> &ndash; <tt>envelope 14</tt> sizes from the American postal standard;
+
* <tt>oversized</tt>: adds 1.5 cm to each edge
* sizes <tt>G5</tt> and <tt>E5</tt> from the Swedish SIS-014711 standard. These are used for Swedish theses;
+
* <tt>undersized</tt>: subtracts 1.5 cm from each edge
* size <tt>CD</tt> for CD covers;
+
* <tt>doublesized</tt>: doubles the width
* size <tt>S3</tt> &ndash; <tt>S6</tt>, <tt>S8</tt>, <tt>SM</tt>, and <tt>SW</tt> for screen sizes. These sizes are useful for presentations. <tt>S3</tt> &ndash; <tt>S6</tt> and <tt>S8</tt> have an aspect ratio of 4:3. <tt>S3</tt> is 300pt wide, <tt>S4</tt> is 400pt wide, and so on. <tt>S6</tt> is almost as wide as a <tt>A4</tt> paper. <tt>SM</tt> and <tt>SW</tt> are for medium and wide screens; they have the same height as <tt>S6</tt>;
+
* <tt>doubleoversized</tt>: doubles the width and adds 1.5 cm to each edge
* a few more paper sizes, which are not mention here. See <tt>page-lay.mki(i|v)</tt> for details.
 
  
To define your own paper size, see <cmd>definepapersize</cmd>.
+
There are quite a few pre-defined paper sizes:
  
In addition to paper sizes, the second argument takes some special options:
+
{| class="wikitable"
* <tt>samesized      </tt>: same size as the first argument
+
|- valign="top"
* <tt>oversized      </tt>: adds 1,5cm to each side
+
! style="width: 200px" | '''Size'''
* <tt>undersized    </tt>: subtracts 1.5cm from each side
+
!  '''Remarks'''
* <tt>doublesized    </tt>: doubles the width
+
|- valign="top"
* <tt>doubleoversized</tt>: doubles the width and adds 1,5 cm to each side
+
| <tt>letter</tt>, <tt>ledger</tt>, <tt>tabloid</tt>, <tt>legal</tt>, <tt>folio</tt>, <tt>executive</tt>
 +
| Sizes from the North American paper standard.
 +
|- valign="top"
 +
| <tt>A0</tt> &ndash; <tt>A10</tt>, <tt>B0</tt> &ndash; <tt>B10</tt>, <tt>C0</tt> &ndash; <tt>C10</tt>
 +
| From the A, B, and C series of the ISO-216 standard.
 +
|- valign="top"
 +
| <tt>RA0</tt> &ndash; <tt>RA4</tt>, <tt>SRA0</tt> &ndash; <tt>SRA4</tt>
 +
| From the RA and SRA series of ISO-217 paper standard.
 +
|- valign="top"
 +
| <tt>C6/C5</tt>, <tt>DL</tt>, <tt>E4</tt>
 +
| From the ISO-269 standard envelope sizes.
 +
|- valign="top"
 +
| <tt>envelope 9</tt> &ndash; <tt>envelope 14</tt>
 +
| Sizes from the American postal standard.
 +
|- valign="top"
 +
| <tt>G5</tt> and <tt>E5</tt>
 +
| From the Swedish SIS-014711 standard. These are used for Swedish theses.
 +
|- valign="top"
 +
| <tt>CD</tt> (12x12cm)
 +
| for CD covers.
 +
|- valign="top"
 +
| <tt>S3</tt> &ndash; <tt>S6</tt>, <tt>S8</tt>, <tt>SM</tt>, <tt>SW</tt>
 +
| For screen sizes. These sizes are useful for presentations. <tt>S3</tt> &ndash; <tt>S6</tt> and <tt>S8</tt> have an aspect ratio of 4:3. <tt>S3</tt> is 300pt wide, <tt>S4</tt> is 400pt wide, and so on. <tt>S6</tt> is almost as wide as a <tt>A4</tt> paper. <tt>SM</tt> and <tt>SW</tt> are for medium and wide screens; they have the same height as <tt>S6</tt>.
 +
|-
 +
|
 +
[http://source.contextgarden.net/tex/context/base/page-lay.mkiv <tt>page-lay.mkii</tt>] <br />
 +
[http://source.contextgarden.net/tex/context/base/page-lay.mkiv <tt>page-lay.mkiv</tt>]
 +
| A few more paper sizes, which are not mention here. (Scroll down to the end.)
 +
|-
 +
|}
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
<context source=yes>
 +
% Create a paper that can accomodate 2x4 squares of 52x52mm
 +
% (A9 is 37x52mm, and we're placing it both portrait and landscape)
 +
\definepapersize[sheet][width=104mm,height=156mm]
 +
 
 +
% We want 2x3 pages on a sheet. \setuppaper must come *before* \setuparranging!
 +
\setuppaper[nx=2, ny=3, dx=0mm, dy=0mm]
 +
\setuparranging[XY]
 +
 
 +
% Define two papersizes in terms of A9 and sheet
 +
\definepapersize[standing][A9]          [sheet]
 +
\definepapersize[lying]  [A9,landscape][sheet]
 +
 
 +
% Show the pages.
 +
\showframe
 +
 
 +
\starttext
 +
  \setuppapersize[standing]
 +
  Page 1: standing pages from here on. \page
 +
  Page 2. \page
 +
  \setuppapersize[lying]
 +
  Page 3: lying pages from here on. \page
 +
  Page 4. \page
 +
  \adaptpapersize[standing]
 +
  Page 5: adapted to standing \page
 +
  Page 6: automatically back to lying \page
 +
\stoptext
 +
</context>
 +
 
 +
 
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* [[PaperSetup]]
 
+
* {{cmd|definepapersize}} to define a new paper size for use with {{cmd|setuppapersize}}
[[PaperSetup]]
+
* {{cmd|adaptpapersize}} to change the paper size for one page only.
 +
* {{cmd|setuparranging}} to place multiple pages on a sheet.
 +
* {{cmd|startTEXpage}} — a page just large enough to fit its TeX contents
 +
* {{cmd|startpagefigure}} — a page just large enough to fit its figure, possibly with some text underneath
 +
* {{cmd|startMPpage}} — a page just large enough to fit its MetaPost contents
  
== Help from ConTeXt-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Commands|setuppapersize]]
+
[[Category:Command/Layout|setuppapersize]]

Revision as of 11:46, 14 September 2017

\setuppapersize

Syntax

\setuppapersize[...,...,...][...,...,...]
[...,...,...] A3 A4 A5 A6 letter ... CD name landscape mirrored rotated 90 180 270
[...,...,...] A3 A4 A5 A6 letter ... name landscape mirrored rotated negative 90 180 270


Description

The first argument of \setuppapersize is the dimension a page will have. The second argument is the size of the paper the pages will be printed on; see \setuparranging for placing multiple pages on a sheet. If the second argument is omitted, the paper size is assumed to equal the page size.

For example:

\setuppapersize[letter,landscape][letter,landscape,oversized]

sets the size of the pages to letter size (landscape), and the size of the paper (before cutting) to oversized letter size, which has edges that are 1.5 cm longer. letter is a pre-defined papersize; one can define one's own papersizes using \definepapersize.

There are several options one can use to modify a predefined paper size:

  • portrait: the default paper sizes are 'standing up', taller than they are wide.
  • landscape: turn the paper 90 degrees so it is lying down
  • samesized: same size as the first argument
  • oversized: adds 1.5 cm to each edge
  • undersized: subtracts 1.5 cm from each edge
  • doublesized: doubles the width
  • doubleoversized: doubles the width and adds 1.5 cm to each edge

There are quite a few pre-defined paper sizes:

Size Remarks
letter, ledger, tabloid, legal, folio, executive Sizes from the North American paper standard.
A0A10, B0B10, C0C10 From the A, B, and C series of the ISO-216 standard.
RA0RA4, SRA0SRA4 From the RA and SRA series of ISO-217 paper standard.
C6/C5, DL, E4 From the ISO-269 standard envelope sizes.
envelope 9envelope 14 Sizes from the American postal standard.
G5 and E5 From the Swedish SIS-014711 standard. These are used for Swedish theses.
CD (12x12cm) for CD covers.
S3S6, S8, SM, SW For screen sizes. These sizes are useful for presentations. S3S6 and S8 have an aspect ratio of 4:3. S3 is 300pt wide, S4 is 400pt wide, and so on. S6 is almost as wide as a A4 paper. SM and SW are for medium and wide screens; they have the same height as S6.

page-lay.mkii
page-lay.mkiv

A few more paper sizes, which are not mention here. (Scroll down to the end.)

Example

% Create a paper that can accomodate 2x4 squares of 52x52mm
% (A9 is 37x52mm, and we're placing it both portrait and landscape)
\definepapersize[sheet][width=104mm,height=156mm]

% We want 2x3 pages on a sheet. \setuppaper must come *before* \setuparranging!
\setuppaper[nx=2, ny=3, dx=0mm, dy=0mm]
\setuparranging[XY]

% Define two papersizes in terms of A9 and sheet
\definepapersize[standing][A9]          [sheet]
\definepapersize[lying]   [A9,landscape][sheet]

% Show the pages.
\showframe

\starttext
  \setuppapersize[standing]
  Page 1: standing pages from here on. \page
  Page 2. \page
  \setuppapersize[lying]
  Page 3: lying pages from here on. \page
  Page 4. \page
  \adaptpapersize[standing]
  Page 5: adapted to standing \page
  Page 6: automatically back to lying \page
\stoptext


See also

Help from ConTeXt-Mailinglist/Forum

All issues with: