By
Clemens Lode
,
January 21, 2022
Woman typing on a laptop (source: pexels)

Polishing a Book for Print

While using LaTeX can save you a lot of time by automatically formatting each page, it has its limits. For example, you might end up finishing a section or chapter with one line that ends up alone on a page. This is ugly but it is not something LaTeX can do anything about. The program’s hands are tied because it cannot rewrite the text for you. It will display every line—even if the final line in a chapter is “orphaned.”

This is an excerpt from Better Books with LaTeX, the Agile Way.

Let us now look at a checklist you should go through before releasing the book (and after you have completed all the writing, indexes, bibliography, etc.).

Clean up Empty Space

Skimming through a book and seeing large unused white spaces is a telltale sign of an unpolished book. Do not be tempted to add a photo of your cat or some meaningless diagram just to fill the empty spaces. It is literally a waste of space and ultimately of book pages (affecting printing costs, weight, shipping costs, etc.). Depending on your contents, it is possible to save a dozen pages by cleverly arranging your text.

While LaTeX provides some functionality by automatically arranging images, you do not want to end up in a situation where the image is far from the position in the text where it is referenced. Most of the time, you want the image to show up exactly where it should be (the default setting of the template). Likewise, forcing page breaks and having sections starting on the right side can lead to a number of blank pages.

Let us examine several items to keep in mind:

  • Combining paragraphs. If you need to save space, you can combine two closely related paragraphs into one large paragraph. While this might come at the cost of some readability, it is easy to implement.
  • Breaking paragraphs. On the other hand, if you need to fill white space, be more generous with starting new paragraphs. This reexamination of your text might improve readability by splitting it into smaller parts.
  • Shortening sentences. If your paragraph spans to the next page due to just a few words, edit the paragraph.
  • Rearranging images. You can play around with moving an image before or after a paragraph and check if this solves the problem. For example, if you have a paragraph followed by white space followed by a picture on the next page, you could simply switch the picture with the paragraph, ending up with half of the paragraph on the first page and half on the second page, eliminating unused white space.
  • Shrinking images. Besides simply rearranging images, you can also limit their size by either changing the limits of the \adjustbox{} command or by making the image itself smaller. Be advised that using \adjustbox{} should be the last resort. While scaling photographic images is no problem, any image containing fonts, lines, tables, etc. will end up not looking good. If you want to scale such vector graphics down, the better option is to make changes to the actual graphic, for example by reducing the distance between elements in a diagram, making the overall image more compact while keeping the original font and line sizes.
  • New page. Sometimes you want to add a blank page or have the next section start on a new page. For example, you have a section starting at the lower right page, with just half a paragraph fitting on that part of the page. Here, it is best to move the whole section to the next page and fill the blank space as discussed above. You can do that by simply adding \newpage (or \blankpage if you want to finish the current page and add a blank page). This does not affect the e-book version of your book.

As each change will possibly affect subsequent pages, you have to check the results page by page from front to back. When moving things around, take special care to have images near their references in the text—and to have a reference for every single image! The best experience for the reader with respect to images is if he or she does not need to browse back and forth to connect what you write about a particular image and the image itself.

If you encounter any “orphaned lines” (single lines that are put on the next page although they could fit on the current one), try adding a \newpage command at the end of the paragraph. This is an issue that sometimes occurs with the LaTeX compiler.

Left Hand / Right Hand Pages

When you have cleaned up your empty white spaces, you should again preview your entire PDF file. For this, you can either use Amazon’s online previewer or a prepared PDF file in your PDF reader. For the latter, I use Adobe Acrobat Reader DC (https://get.adobe.com/reader/), load the generated PDF file, select File / Print…, select Microsoft Print to PDF, and select pages ii – (your last page). By moving the second page to the first page, we can now open the new file and switch to View / Page View / Two Page View and look at the pages exactly as they would appear in the printed book, with the even page numbers on the left and the odd page numbers on the right. The formal terms for these are “verso” for the left-side page of a book and “recto” for the right-side page. By book publishing convention, the first page of a book (and in the template, of each chapter) is a recto page.

Now, go through the entire book again to double-check whether the chapters and sections start on the correct side of the book.

Clean Up Graphics

To understand graphics in the book production process, you have to understand file formats. In principle, there are three types of image files:

  • Vector graphics. Vector graphic files like EPS or PDF contain code to actually draw the picture in question. This code is understood even by the printer itself, which can help to improve the print quality tremendously. Use these file formats whenever possible. TikZ graphics produce vector graphics, and stock image sites like shutterstock.com offer many files both as regular image files and vector graphics. Both EPS and PDF files will work, although PDF files are the preferred format because they do not need to be converted but can be embedded by LaTeX directly into the final PDF.
  • Lossless PNG images. PNG images undergo a compression algorithm, but the type of compression used does not cause any loss of quality—the resulting PNG image has the same exact image information as the original picture. If you do not have vector graphics available, use PNG files.
  • Lossy JPG images. The limiting factor of e-books is the total file size; the limiting factor for printed books is the number of pages. JPG images are optimized for size, so if possible, do not use JPG files for any graphic in your printed book. As image size is not an issue in print, it is better to use lossless PNG images if you have them available.

With this in mind, examine the images you are using now and maybe try to find better versions of those images or replace them with vector graphics. For lossless and lossy images, choose a resolution of 600 dots per inch (dpi), as printers usually use this resolution for black on white printing.

A comparison of graphic formats and their application:

  • Lossy JPG: 300-600 dpi for e-books (photos)
  • Lossless PNG: 600 dpi for PDFs (photos, diagrams)
  • Vector graphics: for e-books and PDFs (graphs, diagrams)
Gimp ⋅  Gimp is a free graphics editor (https://www.gimp.org) with which you can create, scale, or convert images.

Gimp can show you the resolution, but you can easily calculate it yourself. Simply take the width of your picture in pixels (e.g., 1,245) and divide it by the width of your page in inches (e.g., 4.15”, which would result in 300 dots per inch). Please note that when scaling JPG and PNG files in Gimp, you can also scale the DPI resolution. For example, a 1,245-pixel-wide image with 300 dpi will appear smaller than a 1,245-pixel-wide image with 100 dpi.

To calculate the whole width of a page in your book, take a look at your settings in lib/bookformat.tex:

\usepackage[paperwidth=5.25in, paperheight=8in, inner=0.80in, outer=0.3in, top=0.7in, bottom=0.5in]{geometry}

The space where you can actually put text is paperwidthinnerouter. In this case, 5.25 in – 0.8 in – 0.3 in = 4.15 in. With a desired resolution of 600 dots per inch, you need an image with a width of 4.15 in * 600 = 2,490 pixels.

Lightshot ⋅  Lightshot is a free screenshot utility (see https://app.prntscr.com) that saves the entire screen or parts of it into an image file at the press of a button.

One problem I faced with the screenshots in this book is that (at least with Lightshot) images are saved at 120 dpi. If I include them directly into the book, they will look pixelated and way too large. Opening the image in Gimp, selecting Image / Scale Image, and changing the X/Y resolution from 119.990 dpi to 300 dpi does the trick.

Related Books and Services

Recommended Further Reading

Reading a Kindle e-book while drinking coffee.
January 21, 2022

Polishing for E-book Release

Preparing an E-books is mostly about adapting the images. Here, I will explain what to look for when converting your LaTeX project to an e-book format.

About the Author

Clemens Lode

Hello! My name is Clemens and I am based in Düsseldorf, Germany. I’m an author of books on philosophy, science, and project management, and coach people to publish their books and improve their approach to leadership.

I like visiting the gym, learning to sing, observing animals, and creating videos on science and philosophy. I enjoy learning from nature and love the idea of optimizing systems.

In my youth, I was an active chess player reaching the national championship in Germany, and an active pen&paper player leading groups of adventurers on mental journeys. These activities align with my calm approach to moderating meetings, leading meetups, and focusing on details. My personality type in socionics is IEE/ENFp.

Read more...
Clemens Lode

Related Blog Posts

Related Topics

Book Publishing

Book Publishing

Book publishing has evolved with POD (print-on-demand) services. While it's never too late to write the next great novel or an award-winning nonfiction book, many people see book publishing as a marketing tool. No matter what your approach to your book, the challenge is finding and writing for the right audience.

Read more...
LaTeX

LaTeX

LaTeX, a document processing system, creates a typeset finished product. The system works more like a compiler than a word processor. While initially complicated to learn, LaTeX allows better management of larger projects like theses or books by splitting the document into text, style, and references. Leslie Lamport created laTeX in the 1980s; his goal was to separate content from styling.

Read more...

Do you have a question about our services?

Reach out, we'd love to hear from you! Schedule a video chat or message us by e-mail or WhatsApp!

Send us an e-mail (mail@lode.de), we will reply as soon as possible!

Reach out to us via a chat on WhatsApp!

Let's talk! Set up a free call with Clemens. Use Calendly to schedule the call.

Or send us your question or comment here and we'll get back to you ASAP:

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Rate us at Trustpilot