Hello there.

I deal very often with imposition, useful for zinesters and to create
home-made booklets. ConTeXt by itself seems not to manage signatures,
i.e., given a text long 200 pages, it should be imposed in smaller
booklets of 50 pages each. (Or at least I didn't find anything about it)

At the beginning I was using psbook. But this requires a slow
processing (pdf -> ps; psbook ; ps -> pdf). 

Then I found out that pdfpages does the same thing (and better), and
started using that. Now that I switched to ConTeXt, I found that I
cannot use pdfpages without a latex installation.

So I wrote a script and a module to do the same thing without having to
install texlive. It uses MkIV and lua.

The code is stored at 

http://gitorious.org/the-anarchist-library-tools/the-anarchist-library-tools/trees/master/context-imposition

A minimal example and (minimal) documentation is provided.

The code does basically 2 things:

1) the module, using the \alibraryflushpages commands, fills the output
pdf (not imposed) with white pages, until it reach a “good” number,
multiple of 4. The signature is calculated at runtime, so you can
specify a minimum or a maximum (depends on your staple, if you can trim
the paper, and so on).

E.g., if the original pages are 128, no problem, the signature is 64 (16
sheets) and you can impose it without problems.

But, if the original pages are 129, the optimal signature is 44, so the
module will add 3 pages during the PDF compiling.


2) the perl script (which uses only standard perl libraries) creates a
temporary context file, gets the number of signatures provided by the
module (or passed as option if only the imposition is required against a
pdf without tex sources), and does the actual imposing (the algorithm is
taken from the psbook sources (the same used by pdfpages), including the
pages in the right order.

I'm not a real programmer, so it's a piece of spaghetti code. But seems
to work.

I'm posting this here because it's aimed to people that use the Minimals
only, as TeXLive already ships pdfpages, psbook and pdfpages to do the
same thing. (Well, the signature is not calculated on the fly by these
tools).

*If* there are people interested, I'd like to clean it up, improve it,
document it a bit better and so on. If not, well, sorry for the noise.

Bests

-- 
Marco

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to