Changes

Jump to navigation Jump to search
1,666 bytes added ,  18:14, 6 February 2020
m
just proper code coloring
* Printing address labels on an A4 sheet, eight labels per sheet.
In general, imposition is accessed in ConTeXt using one{{cmd|setuparranging}}, or from the command line as follows (mkiv and mkii, respectively):
<pre>
context --pdfarrange=...
\setuparranging [XY]
</texcode>
 
Here’s an example for [[Labels]].
===Testing schemas===
Here's a convenient test file to help choose a schema or write a new one:
(Note that background=screen is deprecated in MKIV and should be replaced by something like background=color,backgroundcolor=lightgray.)
<context source=yes>
</texcode>
For proofing one sometimes wants to pick just some pages and when the original is A5, it is kind of handy to put them side-by-side for proofing. The command {{cmd|\filterpages}} allows you to define exactly what pages are needed. Be warned, though, that the page numbers refer to the pages in the pdf file, not the page numbers.
<texcode>
For more information, see the article on [[Including pages from PDF documents]].
=== Custom imposition schema===
 
You can create a new imposition schema to meet your needs. To do so, take a look at the imposition definitions stored in <code>page-imp.mkiv</code> and find the closest one to work with. You can access the file online:
 
https://source.contextgarden.net/?search=%5C%5Cdef%5C%5Csetuparranging
 
Let's say we want this page arrangement on one sheet (R = page upside down):
 
<pre>P4 P1
R3 R2</pre>
 
This is a mirrored/reversed version of {{cmd|setuparranging}}<code>[1*4]</code>, which gives:
 
<pre>R1 R4
P2 P3</pre>
 
<context source=yes>
% Adapted from page-imp.mkiv
 
\installpagearrangement 1*4*reversed
{\dosetuparrangement{2}{2}{4}{3}{3}% X,Y,Total,hcutmarks,vcutmarks
\pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED\poparrangedpagesTWO\relax}
\def\pusharrangedpageFOURSINGLESIDEDFOLDEDREVERSED#1%
{\advancearrangedpageN
\reportarrangedpage\arrangedpageN
\ifcase\arrangedpageN
\or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 rot,hskip,vskip
\or \handlearrangedpageXandY{#1}111\arrangedpageA % 2
\or \handlearrangedpageXandY{#1}101\arrangedpageA % 3
\or \handlearrangedpageXandY{#1}000\arrangedpageA % 4
\poparrangedpages
\fi}
 
\setuppapersize [A10][A8]
\setuparranging [1*4*reversed]
\setuplayout [margin=0pt, width=fit]
 
\showframe
 
\starttext
\dorecurse{4}{\vbox to \textheight{\vfill\midaligned{\tfd ABC}\vfill}\page}
\stoptext
</context>
== Cut marks ==
\stoptext
</texcode>
 
== Adding pages for imposition signature ==
 
With `\setuppagenumbering[alternative=doublesided`, there will always be an even number of pages. If you need to always have a multiple of four pages, use `\page[quadruple]` at the end of the document:
 
<texcode>
% Enable doublesided; there will always be an even number of pages
\setuppagenumbering[alternative=doublesided,location=right]
 
\starttext
\completecontent
\startchapter[title={A Chapter}]
Text of chapter 1
\stopchapter
\startchapter[title={Another Chapter}]
Text of chapter 2
\stopchapter
 
% Make sure there are a multiple of four pages in the document
\page[quadruple]
\stoptext
</texcode>
 
''Is there is a case where the complex solution in the next section would be necessary?''
== Imposition by signatures ==
[[Category:ConTeXt-Issues]]
minsignature do
pages = pages + 4
neededpages = 4 + neededpages
signature = find_signature(pages)
end
end
print("ImposerMessage:: Original pages: " .. originalpages .. "; " ..
"Signature is " .. signature .. ", " ..
neededpages .. " pages are needed, " ..
pages .. " of output")
-- let's do it
tex.print("\\dorecurse{" .. neededpages .. "}{\\page[empty]}")
 
end
function find_signature(number) assert(number ~= 0, "I can't find the signature for 0 pages") assert((number % 4) == 0, "I suppose something is wrong, not a n*4") local i = maxsignature while i>0 do if (number % i) == 0 then return i end i = i - 4 endendtt>crop{{Getting started navbox}}
139

edits

Navigation menu