Difference between revisions of "Command/definepapersize"

From Wiki
Jump to navigation Jump to search
m (Text replace - "== Help from ConTeXt-Forum ==" to "== Help from ConTeXt-Forum == All issues with:")
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>definepapersize</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 15: Line 18:
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[[Command/keyword:width|width]]</td>
 
     <td class="cmd">[[Command/keyword:width|width]]</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] : width of the new size</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[[Command/keyword:height|height]]</td>
 
     <td class="cmd">[[Command/keyword:height|height]]</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] : height of the new size</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[[Command/keyword:offset|offset]]</td>
 
     <td class="cmd">[[Command/keyword:offset|offset]]</td>
     <td>[[Command/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] : FIXME what is this?</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">[[Command/keyword:scale|scale]]</td>
 
     <td class="cmd">[[Command/keyword:scale|scale]]</td>
     <td>[[Command/value:number|number]] </td>
+
     <td>[[Command/value:number|number]] : scale width and height by this much</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 35: Line 38:
 
Using this command we can define a paper size.
 
Using this command we can define a paper size.
  
<texcode>
+
== Example ==
\definepapersize[main] [A4]          [A4]
+
 
\definepapersize[extra][A4,landscape][A4,landscape]
+
<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.
 +
\setuppaper[nx=2, ny=3, dx=0mm, dy=0mm] % must come before \setuparranging!
 +
\setuparranging[XY]
 +
 
 +
% Create two A9-derived paper sizes
 +
\definepapersize[standing][A9]          [sheet]
 +
\definepapersize[lying]   [A9,landscape][sheet]
 +
 
 +
\showframe
  
 
\starttext
 
\starttext
   \setuppapersize[main]
+
   \setuppapersize[standing]
   Page 1. \page
+
   Page 1: standing pages from here on. \page
 
   Page 2. \page
 
   Page 2. \page
   \setuppapersize[extra]
+
   \setuppapersize[lying]
  Page 2 \page
+
   Page 3: lying pages from here on. \page
  \setuppapersize[main]
 
   Page 3. \page
 
 
   Page 4. \page
 
   Page 4. \page
   \adaptpapersize[extra]
+
   \adaptpapersize[standing]
   Page 5. \page
+
   Page 5: adapted to standing \page
   Page 6. \page
+
   Page 6: automatically back to lying \page
 
\stoptext
 
\stoptext
</texcode>
+
</context>
 
 
  
== Example ==
 
<!-- Please fill in an example if you can -->
 
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
 
  
[[PaperSetup]]
+
* [[PaperSetup]]
 +
* {{cmd|setuppapersize}} to start using a defined paper size.
 +
* {{cmd|adaptpapersize}} to make a single page a different defined size
  
== Help from ConTeXt-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Commands|definepapersize]]
+
[[Category:Command/Layout|definepapersize]]

Latest revision as of 16:05, 12 November 2019

\definepapersize

Syntax (autogenerated)

\definepapersize[...][...=...,...]
[...]name
widthdimension
heightdimension
topcommand
bottomcommand
leftcommand
rightcommand
distancedimension
pagesee \setuppapersize
papersee \setuppapersize


\definepapersize[...][...,...][...,...]
[...]name
[...,...]inherits from \setuppapersize
[...,...]inherits from \setuppapersize


Syntax

\definepapersize[...][...,...=...,...]
[...] name
width dimension : width of the new size
height dimension : height of the new size
offset dimension : FIXME what is this?
scale number : scale width and height by this much


Description

Using this command we can define a paper size.

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.
\setuppaper[nx=2, ny=3, dx=0mm, dy=0mm] % must come before \setuparranging!
\setuparranging[XY]

% Create two A9-derived paper sizes
\definepapersize[standing][A9]          [sheet]
\definepapersize[lying]   [A9,landscape][sheet]

\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: