Makebook: Documentation
A tutorial for using makebook is below; the man page is also below.
Introduction
Very briefly: binding a book isn't just taking its pages and gluing them together; quite the contrary. The pages need to be imposed, multiple pages to a sheet; those sheets then need to be properly folded, and possibly cut, so that they will fan out properly when bound. makebook will not help you actually bind a book, or tell you what kind of binding you should use. What it will do is impose the pages on sheets for you, according to your very precisely-controlled specifications, so that you can make those decisions yourself.
Definitions
To really understand what makebook is doing for you, you need to know a few terms.
- sheet
- A sheet of paper; for binding purposes, a sheet of paper with multiple pages imposed on it.
- impose
- To put multiple pages on a single sheet, properly oriented for folding into signatures.
- leaf
- One page as we'd normally think of it, printed front and back (though either side may be blank depending on the content of the book to be bound). A leaf, therefore, has two pages on it, one on each side.
- page
- One side of a leaf. So, for example, if you have a sheet with four pages on it, this will create two leaves of two pages each, for a total of fou. Typically, though not always (there is frontmatter, for example: title, half-title, etc.), each page will be marked with a page number, or folio (the latter of which has other meanings, which we'll get to in time).
- recto
- The “front” of a page; if you're reading a left-to-right language (like English), this will be the page on the right side of the book when opened. Traditionally, recto pages will have odd page numbers.
- verso
- The “back” of a page; if you're reading a left-to-right language (like English), this will be the page on the left side of the book when opened Traditionally, verso pages will have even page numbers.
- signature
- Among binders, this term is
sometimes a bit hard to pin down.
Traditionally, the name comes from the mark
on each sheet that the binder used when he
received them from the printer, telling
him in what order the sheets were to be
placed; gradually, this came to extend
from the mark indicating the signature to
the signature itself. makebook uses it in
this way: very simply to mean one sheet,
properly folded. There are many types of
signatures; their traditional names are
as follows:
- folio
- The most basic, and probably the one you, as a do-it-yourself printer, will use most frequently. A folio is simply a sheet with four pages on two leaves; the signature is produced by folding it a single time. Often abbreviated as “2o”, for the number of leaves it produces.
- quarto
- Like a folio, but the sheet has eight pages and four leaves; it is folded twice to produce a signature. Often abbreviated as “4to”.
- octavo
- This sheet contains sixteen pages on eight leaves, and is folded three times to produce a signature. Often abbreviated as “8vo”.
- sexto
- This, along with the duodecimo, is an oddball; it is essentially a quarto along with a folio printed on it, which has to be cut up and folded separately. Often abbreviated as “6to”.
- duodecimo
- Like the sexto, an oddball; it is essentially an octavo with an extra quarto printed on it, which has to be cut up and folded separately. Often abbreviated as ”12mo”.
- section
- Sections usually only apply to folios and quartos; however, makebook is also capable of imposing multiple sections in octavo, as well. (Sexto and duodecimo cannot be printed in multi-signature sections, at least by makebook.) These are often also referred to as gatherings. Usually just with folios, the signatures are sometimes perceived to be too thin for the abuse of actual use, as well as for the sewing that is necessary for traditional binding. Therefore, we take multiple folio signatures (two, three, four, whatever), inserting them into each other, to create a section or gathering. Too many signatures in a section will make pressing and sewing too difficult, which is why it is usually only the thinner signatures (folio and, rarely, quarto) that are imposed in this way. If the book is very short (say, thirty-two pages or less), it may make sense to print the entirety of it in a single section, leaving only one joint to bind; normally this is more pages than one would want in a section, but in this special case it works. makebook will impose folio, quarto, or octavo signatures in sections as you command: say, quarto in sections of two signatures would give you quarto signatures, every two of which is folded together to make up a section.
- delta
- When you're impressing your pages, makebook can't always know exactly what will look best with your particular binding method; delta is additional distance added between imposed pages on the final sheet, to help account for this. This is how you'd add the “binding correction” (additional distance between pages to account for the margin space that the binding process will absorb). Can be vertical or horizontal, and positive or negative.
- offset
- Extra distance added before placing a page on the sheet; this essentially effects the placement of the upper left corner of the page. Can be vertical or horizontal, positive or negative. Particularly when imposing pages in a way not suited to their natural size (say, putting letter-size pages in folio on letter-size sheets, where they would be much too large and thus need scaling), offset can dramatically improve the appearance and utility of the sheet. Still, it is always better, if possible, to plan for the size of the imposed page when setting and printing the book. Offset is a way to improve otherwise poor imposition; it does not, and cannot, fix all the problems which scaling creates.
Dependencies
Now you know what the words mean; how can makebook help you do what you need to do? That is, how can makebook take your pdf and impose its pages onto a sheet suitable for folding and, eventually, binding?
First, you need to have the right programs installed. Makebook is written in POSIX-compliant shell, so it should run just about anywhere (except Windows; but Windows takes delight in not running things, so that's not really something I can fix). You will also need the following to be installed:
- od
- This is a great program that (among other things) produces random hexadecimal strings. makebook uses this to ensure that there can't be race conditions for the temporary files it creates. If you don't know what this means, just know that it's a good thing that protects your security.
- dc / bc
- These two programs are simple command-line calculators that makebook uses for a variety of purposes. You probably already have one or both of them installed.
- pdfinfo
- This little program, from the poppler bundle, gives information about a pdf file, specifically its dimensions. makebook uses this to figure out how big the sheet should be if you don't tell it.
- pdflatex
- If you don't know this program, you're probably not doing any page imposition anyway, but suffice to say that makebook uses this to do the actual imposition on the sheet.
- qpdf
- makebook uses qpdf to rotate and rearrange the pages of the pdf as appropriate before it is handed over to pdflatex for imposition. (Prior to v3.0, we used pdftk; not only is qpdf licensed better, but qpdf works much faster.)
Don't worry too much about this, though; if you try to run makebook without any of these programs, it will complain, tell you what it's missing, and quit.
Running makebook
makebook is a well-behaved Unix program; unless you tell it otherwise, it will expect its input to come from standard input. On the other hand, it will not output to standard output unless you tell it to do so explicitly. Both of these use cases seem quite unlikely to me, so we won't talk about them here; if you want to know more, check the manual. I bring it up because running makebook without naming an input file will result in absolutely nothing happening, while makebook waits for standard input to give it something to work with:
$> makebook
And nothing happens! Instead, tell makebook what file you want to work with, using the -i flag:
$> makebook -i myfile.pdf
makebook can sometimes take a while to do its work, so you may want to tell it not to be so darned taciturn by giving it the -v flag, as well:
$> makebook -v -i myfile.pdf
makebook will not obligingly spit out updates every time it does something interesting. By default, makebook will send your imposed sheets (the fold-ready document) to a file with a name identical to your input file name but with sigs_ prefixed to it; in this case, sigs_myfile.pdf. If you're happy with that, great; if not, tell makebook what you want it to name the final file with the -o flag:
$> makebook -v -i myfile.pdf -o outfile.pdf
By default, makebook assumes that you want folio signatures, in one-signature sections, with zero offset and delta, and on a sheet exactly twice the size of your input page size. This requires it to do as little guesswork as possible. If you want to be more specific, though, you can give it more flags.
To tell it the signature type you'd like, use the -t flag; this has a number of options:
Full | Short |
---|---|
folio | 2o |
quarto | 4to |
octavo | 8vo |
sexto | 6to |
duodecimo | 12mo |
You can give makebook either the full or short version, and it will understand. It will also automatically resize the output sheet to match the signature type you've request, unless you tell it explicitly to use a different size sheet, about which more in a moment.
You can also tell makebook to use sections of more than one signature by using the -n flag. To combine this with the previously explained flag:
$> makebook -v -i myfile.pdf -t 4to -n2 -o outfile.pdf
This tells makebook to take myfile.pdf (-i myfile.pdf) and impress it in quarto (-t 4to), with two signatures per section (-n2), to output the result to the file outfile.pdf (-o outfile.pdf), and to tell us all about what it's doing while it's doing it (-v).
We've already got a pretty powerful tool here. However, makebook is still just multipllying the input page dimensions to calculate the output page dimensions, which may or may not be what you want. Fortunately, makebook offers the ability to tell it exactly what output page dimensions you're looking for, which we'll talk about in the next section.
Page Dimensions, Scaling, Deltas, and Offsets
We'll start with page dimensions. Naturally, dimensions need to be given in some kind of unit; and just as naturally, makebook can't be expected to understand all dimensions. Here, then, are the ones that it knows about:
Unit | Abbrev. | Explan. |
---|---|---|
inch | in | Standard Anglo-American inches; one-twelfth of a foot |
centimeter | cm | Standard metric centimeters; one-hundredth of a meter |
millimeter | mm | Standard metric millimeters; one-thousandth of a meter |
point | pt | A traditional Anglo-American printer's point; that is, 1/72.27 of an inch. There are twelve of these in a pica. |
pica | pc | A traditional Anglo-American pica, equal to twelve printer's points. Not equal to twelve Postscript points. |
Postscript points | bp | Postscript or “big” points; equal to 1/72 of an inch. makebook does not know any corresponding Postscript pica. |
makebook knows these and only these units, and it knows these and only these abbreviations for the units; it doesn't even know the full names. So you need to give makebook exactly the abbreviation you see above, or you will confuse it.
To tell makebook what size you'd like the output sheet to be, use the -H option for the height of the page and the -w option for its width. Any of the above units will be fine. So, for example, to ensure that makebook will put your pages on a sheet of letter-size paper, try this:
$> makebook -v -i myfile.pdf -t quarto -o outfile.pdf -H 11in -w 8.5in
Remember that makebook will not scale your pages, so they may be even comically mismatched on the output sheet. If you need to scale your pages to make them fit right, try using the -s option. For example, if your book is designed for A4 paper, but you need to impose it in folio also on A4 paper, the following is at least worth a try:
$> makebook -v -i myfile.pdf -t folio -o outfile.pdf -s0.8 -H 21cm -w29.7cm
Notice that the -s option works on a scale of one; that is, factors less than 1 will scale it down, while factors higher than one will scale it up. So -s 2 will double the page's size, while -s 0.5 will halve its size.
Lastly, to change the delta (the distance between the impressed pages), use the -d and -D for horizontal and vertical distance respectively. A negative value will bring them closer together; a positive will push them further apart. Similarly, for the offset (where the upper left corner of the imposed page will be placed), use -m and the -M for the horizontal and vertical distances respectively. A negative value will push that upper left corner of the page closer to the upper left corner of the sheet; a positive one will push it farther away.
Note that negative distances will need to be enclosed in quotation marks! Otherwise the shell will think that the negative sign is starting another option, which will confuse it mightily. So it should look something like this: -d "-1.1in".
Examples
A few examples may be helpful. We have already seen that A4 books imposed in folio on A4 paes will require some scaling, and suggested the following command line to handle this situation:
$> makebook -v -i myfile.pdf -t folio -o outfile.pdf -s0.8 -H8.5in -w11im
LaTeX pages have a more or less standard size; to impose those onto letter-size paper in folio, try the following:
$> makebook -v -i myfile.pdf -t folio -d "-1.1in" -o outfile.pdf -s0.83 -H8.5in -w11in
This gives the output page corectly (remember that, when the pages are imposed in folio, the page is “landscape”; meaning that the 11-inch length is the width, and the 8.5-inch length is the height); scales it minimally to allow it to fit; and adjusts the horizontal delta to bring the pages closer together. You'll likely have to do some tweaking, but this will get you about where you need to be.
Warning
If you're using a duplex printer, you may not realize it, but the printer has to decide which way to flip the paper, along the long edge or the short edge. Often this won't make any different to you; but if you flip the wrong signature type on the wrong edge, the pages won't line up correct.
So for folio and octavo signatures, flip on the short edge; for the others, flip on the long edge. If your duplex printer doesn't give you this option, you may have to print one-sided odds and then feed the pages again to print the evens; however, your humble author hasn't encountered a duplex printer that didn't give this option in a very long time.