On 24 Nov 2024, at 14:45, vm
On 24/11/2024 12:46, Bruce Horrocks wrote:
Q3: I don’t know of a way to change the number of pages but how would bundles of 5 work since it is not a multiple of 4?
You'd combine a number of A4 sheets (each with 4 pages) into stacks.
The source for the imposition is a pdf containing A5 pages.
The [2*2*4] scheme generates multiple katernen (stacks) of 4 sheets. Each sheet containing 4 pages per A4. The katern contains 4*4 pages.
Instead of stacks of 4 (4*4=16 pages per stack) where then katernen will number from 1..16, 17.32, ...
I'd like to combine 5 (5*4=20) pages per stack) 1..20, 21..40, ... or 6 (6*4=24) etc
I see. The following will give you 20 pages per stack. To get 24 you’ll need to create \arrangedpageK and add it in following the same pattern as A-J. %D Section of 40 pages: 5 sheets, 2 pages front and backside %D Coding: [2*2*5] \newbox\arrangedpageI \newbox\arrangedpageJ \installpagearrangement 2*2*5 {\dosetuparrangement{2}{1}{20}{0}{0}% X,Y,Total,hcutmarks,vcutmarks \pusharrangedpageTWOTWOFIVE\poparrangedpagesAtoJ/pop\relax} \permanent\protected\def\pusharrangedpageTWOTWOFIVE#1% {\advancearrangedpageN \reportarrangedpage\arrangedpageN \ifcase\arrangedpageN \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 rot,hskip,vskip \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3 \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4 \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5 \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6 \or \handlearrangedpageXandY{#1}010\arrangedpageG % 7 \or \handlearrangedpageXandY{#1}000\arrangedpageH % 8 \or \handlearrangedpageXandY{#1}010\arrangedpageI % 9 \or \handlearrangedpageXandY{#1}000\arrangedpageJ % 10 \or \handlearrangedpageXandY{#1}010\arrangedpageJ % 11 \or \handlearrangedpageXandY{#1}000\arrangedpageI % 12 \or \handlearrangedpageXandY{#1}010\arrangedpageH % 13 \or \handlearrangedpageXandY{#1}000\arrangedpageG % 14 \or \handlearrangedpageXandY{#1}010\arrangedpageF % 15 \or \handlearrangedpageXandY{#1}000\arrangedpageE % 16 \or \handlearrangedpageXandY{#1}010\arrangedpageD % 17 \or \handlearrangedpageXandY{#1}000\arrangedpageC % 18 \or \handlearrangedpageXandY{#1}010\arrangedpageB % 19 \or \handlearrangedpageXandY{#1}000\arrangedpageA % 20 \poparrangedpages \fi} \permanent\protected\def\poparrangedpagesAtoJ {\ifnum\arrangedpageN>\zerocount \paperwidth\arrangedpageX\paperwidth \paperheight\arrangedpageY\paperheight \outputarrangedbox\arrangedpageA \outputarrangedbox\arrangedpageB \outputarrangedbox\arrangedpageC \outputarrangedbox\arrangedpageD \outputarrangedbox\arrangedpageE \outputarrangedbox\arrangedpageF \outputarrangedbox\arrangedpageG \outputarrangedbox\arrangedpageH \outputarrangedbox\arrangedpageI \outputarrangedbox\arrangedpageJ \global\arrangedpageN\zerocount \fi} \def\Schema{2*2*5} \setuppapersize[A5][A4,landscape] % the schema being tested \setuparranging [\Schema] % Visuals \setupbodyfont[ss,14pt] \setuplayout [margin=0pt, width=fit, header=2.8ex, footer=2.8ex] \setupalign[middle,hilo] \setuppagenumbering [alternative=doublesided,location=footer] \setupheadertexts[\CONTEXT\ imposition test] %\showframe \setupbackgrounds [text][text][background=color,backgroundcolor=lightgray] \setuplayout [location=middle,marking=off] \startbuffer[Fakepage] \strut \blank \bold{[\Schema]} \vfill This is page \recurselevel \vfill \stopbuffer \starttext \dorecurse{40}{\getbuffer[Fakepage]\page} \stoptext — Bruce Horrocks Hampshire, UK