# Getting Your Book to Print

As I explained yesterday, making a custom text from the OLP source using LaTeX is relatively easy.  But, I’d also like to get an attractively printed version with covers and everything.  So I’m trying out two print-on-demand services: lulu.com and blurb.com.  The challenge is now to (a) format the book so that the can print it and (b) to find a way to produce a cover.  Both Lulu and Blurb let you upload PDFs for this, and they give you the specs to format your books for print.  All the files are on GitHub (this version, most current version), but I’ll walk you through the process.

First, we have to choose a size. I went with Royal for Lulu (that’s the size, e.g., your standard OUP book comes in. It’s slightly larger than US Trade, which is 6″ by 9″).  Blurb doesn’t offer Royal, so there I’m using US Trade.

First, let’s go through the Lulu process. After you pick your binding (perfect-bound paperback), size (Royal), and color (B&W on White paper), and clicking “make this book,” Lulu will tell you what the page dimensions of the PDF should be: 15.593cm x 23.389cm.  Setting up the book design can be a long process, but for now I’m just interested in the print quality, speed of delivery, and pricing.  Since I use the memoir class, setting up the design is relatively easy. [Update: A. Mani pointed out that you can also use the bookcover LaTeX class, and for more involved covers, esp. dust jackets for hardbound copies, this is probably the way to go.]

First, we set the stock size, i.e., the size of the paper the thing will be printed on, and the trim size, i.e., the area on the stock that will remain after the pages are trimmed. For a Lulu PDF, you ignore the trim. So:

\setstocksize{23.389cm}{15.593cm} \settrimmedsize{\stockheight}{\stockwidth}{*} \settrims{0pt}{0pt}

Since this is a non-standard size, we’ll also have to tell memoir where to put the text on that page.  For this, we’ll first have to determine the size of the typeblock, the are that will hold the running text.  That of course depends on the stock size, but also on the typeface and the type size.  For optimal readability, the typeblock should be dimensioned so that a line of text contains not more than 70 characters.  So you have to determine how long a line with, say, 65 characters in your typeface/type size is, and that’ll give you the width of the typeblock.  That would be a pain to find out, but memoir has a macro for it: \setlxvchars will set the length \lxvchars to that length.  Then we can set the size of the typeblock to be that width, and whatever height makes the ratio of height to width the golden ratio.

\setlxvchars \settypeblocksize{*}{\lxvchars}{1.618}

The next step is to determine the margins and the positioning of the header and footer.  You can set these by hand, and it’ll depend on, e.g., if you want to have space in the margin for notes, etc. For now, let’s keep it simple: Make everything in the golden ratio too, and start the typeblock 60pt from the top edge.

\setlrmargins{*}{*}{1.618} \setulmargins{60pt}{*}{*} \setheaderspaces{*}{*}{1.618}

Now you tell memoir to fix the layout to these specifications using \checkandfixthelayout. This will also make some slight adjustments, e.g., guaranteeing that the height of the type block is an even multiple of the line height.

That’s it. Run it through LaTeX and you have a PDF for the book interior to upload to Lulu.

For Blurb, the procedure is almost the same, except that they want you to include the trim.  In the book size calculator on their site, you select the options (trade book, 6″ by 9″). Now the stock size is 6.125″ x 9.25″ with 0.125″ trim, so:

\setstocksize{9.25in}{6.125in} \settrimmedsize{9in}{6in}{*} \settrims{.125in}{.125in}

Everything else stays the same.

After you upload the PDF to Lulu, you’ll click “make print-ready PDF”. Lulu might now warn you about type that’s too small to print clearly (e.g., subscripts).  I haven’t worried about it and will wait for the printed copy to check if that’s a problem.  Then you get to design a cover. There’s a cover “wizard” that lets you do that, but we’re nerds and want to make our own PDF using LaTeX. So click on “one piece cover creator” to go to the PDF upload page. Here it’ll tell you what your cover PDF should look like.  (Blurb tells you up front in the book size calculator, but you need to know the number of pages in the book, since the width of the spine depends on that).

I made a separate LaTeX file for the cover, also using memoir.  Now the stock size is larger (same height, but twice the width + the width of the spine).  Lulu gives these dimensions in “PostScript points” which correspond to the LaTeX measure “bp”.  Lulu says:

Spine width: 23.351 Postscript points wide (0.824 cm) (97 px)
Spine begins 451 Postscript points (15.908 cm) (1879 px) from the left
Total cover width: 925.351 X 681 Postscript points (32.640 cm X 24.021 cm) (3856px X 2838px)

My file will do some calculations for you, so you just have to put those measurements in. You can also do it by hand, of course using \setstocksize etc.

\setlength{\coverheight}{681bp} \setlength{\coverwidth}{925.351bp} \setlength{\spinewidth}{23.351bp} \setlength{\spinepos}{451bp}

Now we have to place the front cover, back cover, and spine text into the right place.  Absolute positioning is not something LaTeX is designed to do, but there is the textpos package that lets you do it. After you load it:

\usepackage[absolute,overlay]{textpos}

you can place stuff onto the page with absolute positioning. For instance, our spine will be a box of width 23.351bp positioned at 451bp from the left margin:

\begin{textblock*}{23.351bp}(451bp,0bp) ... \end{textblock*}

Of course, the text on the spine should go along the spine, so we have to use the \rotatebox macro from the rotating package. This code in my file centers the text on the spine, horizontally and vertically:

\begin{textblock*}{\spinewidth}(\spinepos,0bp)% \noindent\hfil\rotatebox{-90}{% \hbox to \coverheight{\hfil Text that goes on the spine \hfil}\hfil \end{textblock*}

You’ll probably want the text to be styled properly (e.g., larger size, etc).

The front and back cover are handled similarly. The width of the front and back cover is the same as the spine position, and the front cover begins at \spinepos + \spinewidth.

This will make a boring black & white cover, but of course you can play around with colors and/or put images on the cover.  To keep things simple, I just set the background color to Ice Blue and the text and logos in Reflex Blue (the colors of the OLP logo). You do this using the xcolor package, define the colors and set the page background and text color in the preamble:

\usepackage{xcolor} \definecolor{OLPiceblue}{RGB}{179,199,227} \definecolor{OLPreflexblue}{RGB}{12,28,140} \color{OLPreflexblue} \pagecolor{OLPiceblue}

For Blurb, the procedure is the same.  In my test, I tried something a bit different with the colors: invert the colors on the spine and add a 1cm edge on the front and back (textpos lets you set the background color on each positioned textblock using \textblockcolor).  Blurb also automatically adds a (free) ISBN to the back cover, so you’ll have to take that into account.  Lulu also gives you a fee ISBN, but it’s required only if you want to sell the book through retail services (Amazon, Barnes & Noble, and the Ingram network).

That’s it. Upload the cover PDF and enter whatever Lulu and Blur want in terms of metadata, license info, etc., and then order the book.  For this 143-page test, Lulu charged $6.77 and Blurb$3.89 (Canadian).  However, Blurb’s cheapest shipping option was $5 more than Lulu’s regular mail option. In the end, I paid Lulu$13.40 and Blurb \$14.61 for a single copy, but if you order a bunch (e.g., for your class), Blurb will be cheaper.  I’ll let you know how delivery speed and quality of the finished product compare.

[Update: See this post for how it turned out in the end!]