Self-publishing 101: Using LaTeX to create a beautiful book

January 15, 2015 at 1:32 pm

Last week, skywriter published an excellent piece recommending indy publishers consider both CreateSpace and IngramSpark. It’s a great read and the follow-up discussion was also extremely valuable.

In a poll at the end, skywriter asked about the hardest part of self-publishing and two themes emerged: writing the book and marketing the book.

We’ll be getting to the marketing aspect, it’s the hardest part for me as well. First though, I wanted to talk about a realization that helped me get past a few of my writing hurdles.

This realization was that writing and design are not two separate things. They influence each other. You want the layout to complement the text and the text to work with the design. You want something aesthetically beautiful, whatever beautiful means for the work that you’re creating.

pyles_book_of_pirates_550

Once thinking about the writing became thinking about the design, the writing became much easier – it was just another aspect of the design.

Layout and typesetting are other critical components. This is why I’d highly recommend using a professional layout program. Or, as I’m going to recommend, LaTeX.

Here’s a few of the reasons why you want to use a layout program:

  • Look and readability of text. Word and other text editors are not designed for advanced typesetting features like kerning, ligatures, and justification and hyphenation algorithms.
  • Word isn’t a page layout program. If you have any graphics you want to include, you will struggle integrating them using Microsoft Word.
  • You want the layout to complement the content. You want elements such as headers, sub-headers, lists, tables, sidebars, and footnotes that complement the work without your readers being distracted. With a program designed for layout, you have tools at your disposal for communicating that you simply don’t have or don’t have in the same way with text editors like Microsoft Word.

So I started with Adobe InDesign.

After a couple weeks I became frustrated because I found myself not being able to do what I wanted with it and I was focusing more on learning InDesign than making progress. I asked a couple friends who have done professional magazine layout if I could pay them to do a book design. None of them had ever done a book before and they wouldn’t bite. And they knew InDesign!

At this point I realized I was doing the right thing looking for help. If people who know InDesign didn’t want to try it, how would I likely fare? I thought I was going to have to find a designer online with experience in books.

I decided to sleep on it for a few days.

 photo LaTeX_logo_zps46fd839e.png

A couple days after I thought I’d reached this fork in the road, I remembered a typesetting program I once used for an academic paper called LaTeX. It’s pronounced “lay tech,” short for Lamport TeX after it’s founder Leslie Lamport, and is a based on the TeX typesetting system designed by Donald Knuth.

LaTeX was certainly powerful. Would it work for a full-length book?

What is LaTeX?

One of the best questions I ever saw posted to the TeX forum was: How can I explain the meaning of LaTeX to my grandma?

The responses are perfect:

LaTeX is to a book what a set of blueprints is to a building.

Or:

It does this but it uses a computer and so requires less manual labour.

gutenberg press_300

I like to describe LaTeX as a markup language for print or a way to describe how to typeset a document.

Sidenote: Leslie Lamport (developer of LaTeX) and Donald Knuth (creator of TeX) are two of the absolute giants in the field of computer science. Knuth, while working on a book about compilers, decided he couldn’t do it without first developing a fundamental theory for computer programming. His The Art of Computer Programming laid the foundation for much of the field of computer science and the study of algorithms. Knuth became so frustrated with the state of electronic publishing that he created a typesetting language called TeX in 1978. Think of TeX as a mark-up language for typesetting that preceded HTML by some 12 years. Leslie Lamport’s research in the field of distributed systems is legendary and his paper “Time, Clocks, and the Ordering of Events in a Distributed System” is seminal. Typesetting was also a hobby.

I love the idea of both of these computer scientists as interested in aesthetics and writing as they are in computer science.

This sounds hard

Ok, maybe I shouldn’t have mentioned computer science. Here’s the trick. If you get HTML, LaTeX is easy to understand.

Text simply is “marked up” to tell a program how to typeset it.

Italic text in HTML looks like this: This sentence is in italics. The tags tell a browser how to display the information.

In LaTeX, the tags just look a little different: {\it This sentence is in italics. } These different tags tell a program how to typeset the document.

Both have a beginning marker, a piece of code to indicate italics, and an end marker. Did I mention that Leslie Lamport wrote this in 1980?

Not to diminish the invention of hypertext but … well, it kind of diminishes the invention of hypertext once you realize it’s just LaTeX for the screen. But I digress.

Basically, to use LaTeX, you have to tag your text according to:

  • Title
  • Author
  • Headings
  • Subheading
  • Any special formatting
  • Citations
  • Graphics

LaTeX then typesets it for you according to how you specify the style.

This was my first LaTeX “book”:

\documentclass[12pt,openany]{memoir}
\usepackage{graphicx}

\title{The Little Book of Revolution}
\author{David Akadjian}

\begin{document}
\maketitle

\begin{quote}
Multivariate analysis indicates that economic elites and organized groups representing business interests have substantial independent impacts on U.S. government policy, while average citizens and mass-based interest groups have little or no independent influence. – Martin Gilens and Benjamin I. Page
\end{quote}

Recently, a study by Martin Gilens and Benjamin Page at Princeton University concluded what everyone already knew: the United States is not a democracy, it’s an oligarchy responsive mainly to a
powerful elite.

More text, etc, etc.

\end{document}

I used the memoir class, a style for typesetting fiction, poetry, and non-fiction. I tagged the title and myself as author and added in some text to see what it would look like and it generated something that looked like the following.

I figured this out in roughly 15 minutes based on a sample I found. Here’s the output:

little_book_sample_550

The format isn’t anything novel, but it’s clean and professional. I also found it easier than InDesign. And it’s free.

Taking it up a notch

While poking around to see if anyone else had ever done this, I discovered a free Tufte style LaTeX book template.

tufte_sample_550

Edward Tufte is the author of The Visual Display of Quantitative Information and is widely known for creating beautiful books. The LaTeX template was a creation of the Tufte-LaTeX developers.

Instead of using the memoir class, you could typeset your book in a manner similar to Tufte. You just have to download the appropriate files and change your document class to tufte-style-book.

\documentclass{tufte-style-book}

All of your other tags stay the same.

There’s a little more to it than that, but not much.

Lessons learned

Here are a few things I learned along the way

  1. A long book takes some time to tag. I would suggest writing and editing it in a word processor before doing the tagging. In other words, you want to have completed text before you typeset it.
  2. There is no spell-checker in the TeXShop program. See point number 1.
  3. Making any changes is more tedious than in a word-processing program. See point number 1.
  4. At the same time you want to know what your book is going to look like so use some of your text to create a small version of your book that contains all the elements – chapters, sub-chapters, images, references, citations, etc. This way you can test and play around with your design separately from your book. When the text is done, it’s simply a matter of plugging it in and tagging it.
  5. The TeX stack exchange forum is really nice. I can’t think of a question I had that I wasn’t able to find an answer to on this forum. Much better than the Adobe forum I might add. A strong support community is tremendously helpful.
  6. The reference citations looked a little dated because citation styles have changed significantly since the days of LaTeX. I know this because two reviewers commented on the citation style. I could live with it though. Self-publishing and DIY is sometimes about trade offs. The overall clean look and ease of use I found far outweigh a nit about a newer MLA citation style.

citations_550

I rationalized the old reference and citation style of LaTeX by calling it “vintage”. Vintage 1981.

TeXShop

Just like HTML needs a browser, LaTeX needs a program capable of compiling the script.

On the Macintosh, there’s a wonderful program called TeXShop. It includes an editor and a previewer and standard packages like BibTeX for generating bibliographies. It will also generate a PDF file from your LaTeX code.

TeXShop is tremendously easy to learn and use. I had created a small file within minutes that I could preview. The TeXShop editor on the Mac looks like this:

TeXShop_editor_550

On the PC, you can download the proTeXt system. This includes the frontend TeXStudio program that looks similar to TeXShop. I have no experience with LaTeX on the PC so if anyone knows of something better, please post in the comments.

Close

I’m not a designer. Using LaTeX and LaTeX templates, however, I found I was able to design in a manner where I was thinking not just about what I wanted to say, but how I wanted it to look. And this, strangely enough, helped me write.

I was able to do this using completely free software developed by a couple of computer science geniuses during the 1970s and early ‘80s (I also learned some history along the way).

I’m also finding that the experience is helping me out creating an ebook because the e-pub format is basically just a version of HTML. In other words, you have to markup your book for onscreen display in an e-reader (Nook, Apple iPad, Adobe Digital Editions, etc).

What was your experience like? Are you an Adobe guru or did you find another way?

 photo little_book_sm_zps7eb5e66a.jpg David Akadjian is the author of The Little Book of Revolution:
A Distributive Strategy for Democracy
.