Difference between revisions of "Imposition"

From Wiki
Jump to navigation Jump to search
(Added Wolfgangs example code to get to the back cover of a booklet.)
(New pagebreakmethod nextquadruple added.)
Line 132: Line 132:
 
This will run the document at first without page arrangment and impose the pages in a separate run after table of contents etc are created.
 
This will run the document at first without page arrangment and impose the pages in a separate run after table of contents etc are created.
  
== Getting to the Back Cover of a Booklet ==
+
== Getting the last page of a Booklet ==
  
When using imposition to print an a5 booklet (a4 folded in half) John Devereux wanted to specify content for the back cover, independently of the actual number of pages in the booklet. Here is a way that worked (thanks to Wolfgang Schuster on the mailing list). \page[beforequadruple] gets to the inside back cover. Another \page gets to the outside back cover.
+
When you use imposition to print a booklet you want to put something on the very last page, the <code>quadruple</code> pagebreak did not always fill the remaining pages untill you get a quadruple number of pages.
  
 
<texcode>
 
<texcode>
 +
\unprotect
 +
 +
\startvariables    all
 +
    nextquadruple: nextquadruple
 +
\stopvariables
 +
 +
\installpagebreakhandler \v!nextquadruple
 +
  {\ifdoublesided
 +
    \!!counta\realpageno
 +
    \!!countb\realpageno
 +
    \advance\!!counta 4
 +
    \divide\!!counta 4
 +
    \multiply\!!counta 4
 +
    \advance\!!countb 1
 +
    \advance\!!counta-\!!countb
 +
    \executepagebreakhandler\v!yes
 +
    \dorecurse\!!counta{\executepagebreakhandler\v!empty}%
 +
  \fi}
 +
 +
\protect
 +
 
\setuppapersize[A5][A4]
 
\setuppapersize[A5][A4]
 
\setuparranging[2UP,rotated,doublesided]
 
\setuparranging[2UP,rotated,doublesided]
 
\setuppagenumbering[alternative=doublesided]
 
\setuppagenumbering[alternative=doublesided]
  
 +
\starttext
 +
 +
\subject{Front Cover}
 +
 +
\dorecurse{10}{\input tufte \par}
 +
 +
\page[nextquadruple]
 +
 +
Back Cover
 +
 +
\stoptext
 +
</texcode>
 +
 +
== Getting to the Back Cover of a Booklet ==
 +
 +
When using imposition to print an a5 booklet (a4 folded in half) John Devereux wanted to specify content for the back cover, independently of the actual number of pages in the booklet. Here is a way that worked (thanks to Wolfgang Schuster on the mailing list). \page[beforequadruple] gets to the inside back cover. Another \page gets to the outside back cover.
 +
 +
<texcode>
 
\unprotect
 
\unprotect
  
\installpagebreakhandler {beforequadruple}%
+
\startvariables    all
{\ifdoublesided
+
  beforequadruple: beforequadruple
    \!!counta\realpageno
+
\stopvariables
    \!!countb\realpageno
+
 
    \advance\!!counta 5
+
\installpagebreakhandler \v!beforequadruple
    \divide\!!counta 4
+
  {\ifdoublesided
    \multiply\!!counta 4
+
    \!!counta\realpageno
    \advance\!!countb 2
+
    \!!countb\realpageno
    \advance\!!counta-\!!countb
+
    \advance\!!counta 5
    \executepagebreakhandler\v!yes
+
    \divide\!!counta 4
    \dorecurse\!!counta{\executepagebreakhandler\v!empty}%
+
    \multiply\!!counta 4
  \fi}
+
    \advance\!!countb 2
 +
    \advance\!!counta-\!!countb
 +
    \executepagebreakhandler\v!yes
 +
    \dorecurse\!!counta{\executepagebreakhandler\v!empty}%
 +
  \fi}
  
 
\protect
 
\protect
 +
 +
\setuppapersize[A5][A4]
 +
\setuparranging[2UP,rotated,doublesided]
 +
\setuppagenumbering[alternative=doublesided]
 +
 
\starttext
 
\starttext
\showframe
+
 
 
\subject Front Cover
 
\subject Front Cover
  

Revision as of 11:14, 9 June 2008

< Structurals | Visuals >

What is Imposition?

To impose means to order pages on a bigger sheet in a way, that you get a booklet (or something similar) with correct page order after folding. In the simplest case you impose four A5 pages on both sides of an A4 sheet.

In a print shop it could be that you've to place 64 inner pages of a book on one printing sheet. For private use you could want to zigzag-fold an A4 sheet as a brochure that fits nicely in a business envelope. You could make two pages with three columns each, or you could make six pages and impose them.

Another "style" of imposition is to place several identical templates on one sheet, e.g. labels.

What can ConTeXt do for me?

ConTeXt has some built-in imposition schemas (see "arranging pages" in the manual):

  • 2UP
  • 2DOWN
  • 2SIDE : 2 pages per form, side by side in pagination order (no real imposition, only paper saving)
  • 2*2 : 2 pages per form, for single sheets with front and back
  • 2**2 : 2 pages per form, for book ordering
  • 2*4 : 4 pages per form, 2x2 pages head to head
  • 2*8
  • 2*16
  • XY (not mentioned in the manual) : you can control the number with \setuppaper[nx=...,ny=...,dx=...,dy=...]

"form" means "one side of a sheet".

You can access this feature via


TODO: some graphical examples (See: To-Do List)


More

Hraban needed a "3SIDE" schema to fit three "filius" planner pages on one A4 sheet. Willi wrote it:

\unprotect
% New page imposition scheme 3SIDE by Willi Egger 2003-07-21

\installpagearrangement 3SIDE
   {\dosetuparrangement{3}{1}{6}{4}{2}%
        \pusharrangedpageTHREESIDE\poparrangedpagesAB\relax}

\def\pusharrangedpageTHREESIDE#1% Willi's approach
  {\doglobal\increment\arrangedpageN
   \reportarrangedpage\arrangedpageN
   \ifcase\arrangedpageN
   \or \handlearrangedpageXandY{#1}000\arrangedpageA %  1
   \or \handlearrangedpageXandY{#1}010\arrangedpageA %  2
   \or \handlearrangedpageXandY{#1}020\arrangedpageA %  3
   \or \handlearrangedpageXandY{#1}000\arrangedpageB %  4
   \or \handlearrangedpageXandY{#1}010\arrangedpageB %  5
   \or \handlearrangedpageXandY{#1}020\arrangedpageB %  6
        \poparrangedpages
   \fi}

\protect

You can use this code simply in your environment file. The other schemas are in page-imp.tex.

Use it like this:

\definepapersize	[filius][width=92mm, height=172mm]
\setuppapersize		[filius][A4,landscape]
\setuparranging		[3SIDE]
\setuplayout		[location=middle,
			alternative=singlesided,
			grid=no, marking=on,
			leftmargin=10mm, leftmargindistance=0mm,
			topspace=2mm, header=4mm, footer=0mm,
			width=77mm, height=166mm]


ConTeXt is also handy when you need to rearrange an existing pdf into a booklet. This is a trial-and-error solution by Mari for rearranging an A4 pdf file into 2*8 spreads on A3 sheet (-> A6 pages when printed and cut). The texexec.tex file that was created by the first tries with texexec --pdfarrange (which didn't seem to have enough options) was a great help while working towards this solution. Not sure about the margins on the final A6 pages (the original has equal left and right margins, some extra inside margin might be a good thing), but at least otherwise this seems to do the trick:

\setuppapersize[A6][A3] %individual page A6 size, print size A3
\setuparranging[2*8,rotated] %makes an 8 page gathering when folded (duplex printing!)
\setupoutput[pdf]
\setuplayout
  [backspace=0pt,
    topspace=0pt,
       width=middle,
      height=middle,
    location=middle,
      header=0pt,
      footer=0pt]
\setuppagenumbering[alternative=doublesided]

\starttext

\insertpages
  [original_file.pdf][width=0pt]

\stoptext

Cut marks

ConTeXt also allows to place cut marks. This can be controlled using the marking option of \setuplayout; possible values are:

  • on show cut marks and page number
  • screen ditto, but also print a grey-scale colour bar
  • colour ditto, but also print a colour bar
  • text print a text, defaults to empty

The default settings are

\def\pagecutmarksymbol    {\the\realpageno}
\def\pagecutmarklength    {.5cm}
\let\pagecutmarktoptext    \empty
\let\pagecutmarkbottomtext \empty

To obtain register marks (or also called registration marks) you can use the small crop module which was posted to the mailing list.

Caveat: common troubles

Note that some features (e.g. table of content, internal references) are always disabled in imposition mode. So, they will not be included in the pdf if you ask for imposition. To get rid of this you can use the "arrange" key for texexec.

texexec --arrange yourFilename

This will run the document at first without page arrangment and impose the pages in a separate run after table of contents etc are created.

Getting the last page of a Booklet

When you use imposition to print a booklet you want to put something on the very last page, the quadruple pagebreak did not always fill the remaining pages untill you get a quadruple number of pages.

\unprotect

\startvariables    all
    nextquadruple: nextquadruple
\stopvariables

\installpagebreakhandler \v!nextquadruple
  {\ifdoublesided
     \!!counta\realpageno
     \!!countb\realpageno
     \advance\!!counta 4
     \divide\!!counta 4
     \multiply\!!counta 4
     \advance\!!countb 1
     \advance\!!counta-\!!countb
     \executepagebreakhandler\v!yes
     \dorecurse\!!counta{\executepagebreakhandler\v!empty}%
   \fi}

\protect

\setuppapersize[A5][A4]
\setuparranging[2UP,rotated,doublesided]
\setuppagenumbering[alternative=doublesided]

\starttext

\subject{Front Cover}

\dorecurse{10}{\input tufte \par}

\page[nextquadruple]

Back Cover

\stoptext

Getting to the Back Cover of a Booklet

When using imposition to print an a5 booklet (a4 folded in half) John Devereux wanted to specify content for the back cover, independently of the actual number of pages in the booklet. Here is a way that worked (thanks to Wolfgang Schuster on the mailing list). \page[beforequadruple] gets to the inside back cover. Another \page gets to the outside back cover.

\unprotect

\startvariables    all
  beforequadruple: beforequadruple
\stopvariables

\installpagebreakhandler \v!beforequadruple
  {\ifdoublesided
     \!!counta\realpageno
     \!!countb\realpageno
     \advance\!!counta 5
     \divide\!!counta 4
     \multiply\!!counta 4
     \advance\!!countb 2
     \advance\!!counta-\!!countb
     \executepagebreakhandler\v!yes
     \dorecurse\!!counta{\executepagebreakhandler\v!empty}%
   \fi}

\protect

\setuppapersize[A5][A4]
\setuparranging[2UP,rotated,doublesided]
\setuppagenumbering[alternative=doublesided]

\starttext

\subject Front Cover

\dorecurse{10}{\input tufte \par}

\page[beforequadruple]

Imprint

\page

Back Cover

\stoptext