The Very First Thing

A couple of quick reminders before we begin!

Before you do anything else, make sure you have good back up strategy!!! This is the only time I’m going to say this. But we are going to be monkeying around with something that you have spent years creating. There are lots of cheap (and free) backup solutions available nowadays. There is no excuse. Cloud services like SpiderOak can keep constant backups in the background. They’re free (with a few gigabytes of storage) and are an excellent addition to the rest of your backup strategy. Ok, that’s all I’m going to say on the subject. If you don’t backup properly and loose all your work, don’t come crying to me. (If you don’t already have a proper backup strategy, you might want to check out my blog for turning a Raspberry Pi into a cheap NAS (network attached storage) box for backing up onto.)

What We Are Going To Do

A description of what this series of blog posts intends to cover.

Right, though it is a little counter-intuitive, I’m going to start by telling you how this is going to end. This is going to necessitate I tell you a few things before I have defined or clarified them, so don’t worry if you don’t fully understand something. I’ll explain everything in more detail as we progress.

So, after you’ve worked through this tutorial, you are going to have (drum roll) a master copy of your novel formatted in LibreOffice in such a way that you can create versions in various different formats (print and electronic) by going to export and simply selecting what you want. Exciting or what?!

Explicitly these formats will support publishing on the kindle via a custom export plugin that you’ve tailored to the exact needs of your novel (though if your novel is formatted similarly to my example, you might not need to customize it), publishing in print using the industry standard PDF format and a whole smorgasbord of smaller platforms (including the iPad) using Smashwords.

Just in case you have been living under a rock, kindles are the e-readers sold by Amazon and will account for most of your sales, and the iPad is an overpriced tablet pc made by Apple, but seeing as only people with money to burn own one, depending on the demographic of your intended audience, it might well be an important market for you. There are also a whole host of less popular devices, some of which use EPUB and some which use their own format. If you think one of these devices is likely to be an important market for you, you might want to create a custom plugin for them too so you can ensure the quality of your end product. However, for most of you, this won’t be the case and allowing Smashwords to take care of them for you is fine. I’ll talk a bit more about what exactly Smashwords is in a bit, but for now, all you need to know is that it takes a specially formatted DOC file (Microsoft’s truly awful, binary document format) and spits out versions of your novel formatted for lots of different devices.

Now, for the print version of your book, I’m going to explicitly show you how to format it to be used with Createspace, which is Amazon’s print-on-demand service, but the steps are pretty much the same for any publisher, print-on-demand or traditional, as they will almost certainly all require from you your novel in the industry standard PDF file format (and I would be very concerned about any that didn’t).

As well as having the documents ready to publish, by the time we’re done, you’ll also understand the ins and out of document formatting, meaning you can cope with any peculiarities your particular novel throws up and will ensure that you create a professional product on all platforms. And best of all, this should all take just one evenings worth of your time!

It is worth noting that there are various other ways to achieve the same thing, and I’m not going to pretend that the LibreOffice way is perfect, but it does have some very big advantages, which will become apparent as we progress. However, I will mention the main disadvantage now, which you may have picked up on during this introduction if you haven’t been asleep: this is going to take a bit of setting up, not much, but at the time of writing this, there is no magic bullet piece of software that can accept your manuscript, however you’ve formatted it, and spit out good quality versions for the different devices.

The closet thing that exists at the moment is Smashwords, which takes a specially formatted Microsoft Office file and, from that, creates different versions. However, setting up LibreOffice to create the specially formatted DOC file alone isn’t really any less work than setting up LibreOffice properly. Plus, the files Smashwords creates for the various devices are not always the best quality.

Why We Going To Do This

Where I tell you cautionary tale that highlights why formatting your novel with LibreOffice is a good idea.

Just in case you still need a bit of a push to accept that your novel needs to be reformatted into an intermediate format in LibreOffice rather just exporting what you have and tweaking, let me tell you a cautionary tale.

Once there was this boy who had written the most perfect novel. So great was the wave of anticipated glory that accompanied his great achievement that he couldn’t help but get carried away by it. He’d been working for years towards this moment; nothing was going to delay him publishing. So he exported it, and knowing something about document formatting, he crafted it by hand. It didn’t take long, certainly not as long as fixing his original and writing a plug-in. Then he moved onto the next format and so on, essentially ending up with one master document per format.

He soon realised that, though it had been quicker to do the first formatted document, as more and more formats were added, this clearly wasn’t the case any more, but the real horror began when he realised that his perfect novel wasn’t quite as perfect as he had first thought and needed a few small changes. “No biggie,” he thought. “It won’t take long to go back and add the changes required to all the documents.” But halfway through he spotted another error then another, so he had to go back and correct those he had already corrected. By this time, our poor hero was starting to lose track of which documents had had which corrections made to them. Then he got a call from a journalist wanting a copy in format X to review.

Of course, as sod’s law dictates, format X was one of those that currently hadn’t had any of the changes added to it, so he stopped what he was doing and added the changes to version X, noticing, as he did, another couple of small changes, which he corrected in format X. With relief he sent off a copy of format X, only to have his relief turn to despair as he realised that he no longer had any idea which of the remaining documents had had which changes applied to them and which ones hadn’t!

In desperation, he tried to work it out from the documents’ modification dates, but he’d been tweaking the formatting of the documents as he’d been going along, too, so he didn’t know if a file had had its content or formatting changed. At this point he broke down in floods of tears, and wished he’d heeded my advice because, to this very day, all the versions of his book for the different formats have slightly different content!!!

No matter how perfect you think your book is, proof reading the different formats will reveal errors that you won’t believe you have constantly missed. Having one master document where you make all the changes to the content and where formatting tweaks are handled in plug-ins is the way to go, believe me.

You & Me

A brief introduction to myself and a quick look at who I think you are.

Ok, now we know what we are going to do together, it is probably a good idea if we get to know each other. Firstly, let me just clarify who I think you are. This guide is primarily aimed at people who are publishing a book for the first time, and as a result, it goes into a lot of depth about the technicalities of formatting in a (hopefully!) easy to understand manner. I firmly believe that having an understanding of why you are doing the things you are doing will save you time in the long run and help you produce a higher quality product. If, however, you are already familiar with formatting and are, perhaps, just interested in how LibreOffice differs from some other program you have used before and want to get up and running fast, you can just install my plug-in for LibreOffice and read the quick how to, which will show you how to create your document using the supplied template and export it using the supplied style sheet.

If you’ve no idea what a plug-in is, let alone a template or style, or you are doing something complex and want to be able to customize the plug-in/template I’ve created, then read on for a detailed explanation of how to set up LibreOffice manually for novel publishing and how to write a custom export plug-in. Neither of these things are that tricky, but they will take a bit of explaining.

Now, I guess I’d better introduce myself. Hi, I’m Rob, nice to meet you. I’m a writer. I self published my first book, Equilateral, in 2012, and am about to release my second and third. I have also written various screenplays, plays and murder mystery plots, but most importantly, I am also a keen coder and have written various bits of software, from device drivers to php scripts for websites. I also hate talking about myself, so that is about all you’re going to get.

What You Are Going To Be Doing It To

Where I talk about the assumptions I’m going to make about your book.

Throughout this series of blog posts, I’m going to assume your novel is “finished”. Which is to say that it is probably filled with mistakes and will need a lot rewriting, but that you are blissfully unaware of this at the moment. However, there is no reason why you need to wait till your novel is “finished” to set up LibreOffice. You can do things the other way round i.e set up LibreOffice as I describe and then create your novel. This has the advantage that if, for example, you want to read through the first half of your book on, say, your kindle, you can easily do it with a couple of clicks of your mouse. It does, however, mean you need to be thinking about format whilst writing, but this might not bother you or might be outweighed by the advantage of being able to publish the second your novel is finished.

Seeing as I keep talking about novels, I should clarify, in respect to this guide, what I am considering a novel to be so you don’t read all this and find out it isn’t relevant to you or turn away when it would’ve helped. For the most part, you can consider ‘novel’ to refer to whatever type of book it is that you are preparing to publish, though some types throw up additional challenges that aren’t covered here. Specifically, these tend to be formats that rely heavily on graphics, such as comic books and children’s story books. Academic books that require lots of diagrams are also problematic. This guide also doesn’t cover referencing, bibliographies and other such things that are common in academic work (though these things are quite easily achievable and reading this guide should arm you with what you need to deal with them). Basically, if your book is mostly standard text, bar perhaps the odd logo and picture, be it fiction, non-fiction or whatever, you are good to go, but the more pictures/diagrams/oddly formated text your book has, the harder it is going to be to use this guide.

In the main text I’ll cover formatting prose and dialogue. How to deal with the trickier bits of formatting that you might need, such as if your novel contains poetry, footnotes or letters that need to be formatted as such, I’ll leave to the appendixes at the end.

Why I Think You’re Doing This

Next, whilst we’re defining things, I guess I’d better clarify why I think you’re going to all this trouble. Though this is a guide for self-publishing, self-publishing encompasses everything from multi-million pound endeavours to one off products for birthday presents and the like. What I’m going to assume is that you are aiming for something in the middle: that you’re undertaking a commercial endeavour, but that it has a very limited budget. As a result of this (or perhaps because of your megalomania!), you, the author, are going to be doing as much of the work (or, more accurately, setting up your computer to do as much of the work) as possible and that, therefore, in order to maximise your sales, you want to make your book available in print form and electronic. But – and this important – that the quality of product you want to create is on par (or better) with those created by the major publishers. Or to put it another way, I am creating the sort guide I wished I had been able to read whilst preparing my first novel.

CreateSpace and a brief Print-On-Demand vs. Traditional Printing

I’ve mentioned fairly often that we are going to create a PDF file for the print version of your book and that, specifically, this will be formatted for CreateSpace, which is Amazon’s print-on-demand service. Print-on-demand is a relatively new method for printing books, so you may not be one hundred percent clear on what it is and whether it is for you, so lets take a quick look at printing.

Now, with both traditional printing and print-on-demand methods, you print a copy of your book and someone (possibly you, through your own website, or a traditional book store, from their shelf, or Amazon, through their website, or someone else entirely) sells it, and you and the person who sells it split the profit based on some pre-existing arrangement. Now, with traditional publishing, you print thousands of books because printing in such large numbers means the cost of each individual book is minuscule. However, the initial outlay to print all these books is substantial. With print-on-demand, a book is only printed once it has been sold. The cost of printing individual books is much higher than with the traditional method. However, importantly, you have practically zero setup costs, you don’t have to spend money storing thousands of books whilst you wait for them to sell and you can be a bit more flexible with making corrections after you have gone to press.

The decision about whether to use print-on-demand or not comes down to simply how many units you (realistically!) think you’re going shift in the first few months. It should be quite obvious (i.e. if your marketing budget is tens of thousands of pounds, go traditional. If, on the other hand, it is essentially zero, go print-on-demand.) If you can’t decide, there is very little to be lost from starting off print-on-demand and, if the sales warrant it, moving to mass produce copies of your book. As to whether to go with Amazon’s CreateSpace or another provider is a somewhat trickier decision. On the one hand, it means that your book will easily integrate into the rest of the Amazon store and is instantly available around the world; on the other, Amazon are certainly not the world’s most ethical company and you may not be happy helping them in their evil ways. However, which ever way you go, they are almost certainly going to want you to use the industry standard PDF file, as CreateSpace does. The only difference you might find is whether they want the colours to be RGB or CMYK.

The two standards exist because (as printers use reflective light and monitors emitted light) printers are able print colours that monitors can’t display and visa versa. RGB colours are the sort displayed on a monitor. CMYK colours are the sort printed on a printer. Converting between the two is pretty simple for most people, as, in the majority of cases, the differences in converted colours are very minor and won’t be noticed. It certainly isn’t as great as the variances in colour caused by things you can’t control (especially if you haven’t calibrated your monitor!). The only time it is likely to matter is if you’re writing a book for a corporate client and need to use “exactly” the colours that are used in their logo etc. or if you are planing on using a special ink on your cover, such as metallic gold.

CreateSpace expects colours to be RGB, so if you are using them, you don’t need to do anything (though spending some time calibrating your monitor would be a good idea). If you are using a different company that expects the colours to be CMYK, read the appropriate appendix on how to convert the colours before submitting the file.

If I’m Self-Publishing, Why Am I Getting Paid Royalties?

Before we go any further, it is worth noting that, as of writing this, these new technologies have thrown up some confusion about who exactly is publishing your book from a legal point of view. Sometimes you will be considered the publisher, and the company selling your book a distributor; at other times, the seller will be treated as a publisher who is paying you royalties. This may be important because, often, royalty payments are treated differently for tax purposes. The ins and outs of taxation are way out of the scope of this guide, so go seek professional advise, especially if your book sells well, as you could end up owing or being owed a large sum of money! It is also worth mentioning that, in all the excitement of publishing your book, it can be easy to forget to tell the tax man. He will not take kindly to this, so make sure you get some business advice about the best way to do this, but for most people, it will mean registering as self employed and filling in a self assessment form.

The Tools We Are Going To Be Using

You’ll be pleased to know that this preamble is coming to end, but before we begin you had better make sure you have the tools to hand that we are going to use. As this guide is about LibreOffice (and/or OpenOffice), you are clearly going to need it. I will deal slightly later with why it is a good tool for formatting your novel, you’ll just have to trust me for now, as the explanation requires understanding a few technical details that we haven’t covered yet. But in case you’re reading this without knowing what LibreOffice is (‽), for now, all you need to know is that LibreOffice is a free, easy to use, feature packed office suite that knocks spots off of Microsoft Office. It is based on OpenOffice, which is another free office suite, which, a few years ago, was owned by SUN Microsystems, a large software company. When, slightly later, it was sold to NOVEL, another very large software company, they proceeded to piss off everyone who was working on it, causing them all to leave and set up LibreOffice.

As a result, LibreOffice can be thought of as the latest version of OpenOffice, so if you already have OpenOffice, replace it with LibreOffice. If you already have LibreOffice, make sure it is the latest version. If you don’t have either, go get LibreOffice. If for some reason you can’t upgrade OpenOffice to LibreOffice, they are currently both so similar that this guide should work for it too. Some of you might already have Microsoft Office, you can install LibreOffice alongside it, but you are better off just uninstalling Microsoft Office as it is a security risk and LibreOffice can read and write to all the Microsoft Office files (yep, the money you spent on Microsoft Office was completely wasted, deal with it).

Other than LibreOffice, you will also need an operating system to run it on. I’m going to be using Ubuntu and recommend it to you. It is free and can be installed alongside your old operating system (or can replace it). Go get it from However, if you don’t want to do this, you can use any operating system, just substitute in the programs I use with the equivalents supplied by your operating system.

The main tool, aside from LibreOffice, that you are going to need is a text editor (please note, a text editor is very different from a Word Processor!) I’m going to be using gedit. Any text editor will do, but one which understands XML will be a bonus (as they can do things like flag up formatting errors, which will save you lots of head scratching if you make a typo.) You will also need something to test the output with. If you have a kindle, use that else you will need a kindle emulator, you can get amzon’s from here or a quick google will find others. You will also need a PDF viewer and/or a printer to test the print copy, and it is worth grabbing Calibre too, as it can view many formats and has lots of useful tools for fiddling about with various different ebook formats. That should be all you need to get started.

Why a Printed Book and an e-book Need Different Information

We are going to start this section by looking at why the trickiest problem that stands between us and our goal exists. This problem is that the information we need to include in the a file to be printed is almost diametrically opposite to that which we need to include a file that will be read on a e-reader. This may seem odd, as you may feel the they both contain the same information, namely, your novel. To understand this difference you have to understand the difference between content and style.

Now, the content of your book is the words you’ve written and the style is how those words appear on the page. Pretty simple, yeah? Now, with the printed version of your book, content and style are fairly concretely linked, it isn’t really possible for someone to change the book’s style in anything other than a fairly trivial way (such as making the font bigger by holding the book closer.) To all extents and purposes, in the printed book, you have absolute control over the way everything will look. If you want to choose a font that is impossible to read and font size that requires even those with the best eyes to need a magnifying glass, no one can stop you.

However, what I am going to say next, depending on your background, will either come as a great relief or great heresy. When publishing your book in electronic format, you have practically no control over the styling. You can set what can be considered as style suggestions, but whether they are honoured or not depends on the e-book reader and the reader’s preferences. And if you try to force the issue (or don’t take enough care), you can actually make your book unreadable. If you are a bit of a control freak about the presentation of your book, it would be good to start coming to terms now with the fact that you are going to have to give this up (for the electronic version at least).

Before the non-control freaks out there start celebrating about how easy the electronic version is going to be to create if it just requires stripping out the styling, I have to warn you that, unfortunately, things are never that simple. Instead of style information, what the e-book version needs is context information. Conversely, the printed version doesn’t care at all about context. It doesn’t even care that the shapes it is going to print are words, nor does it care that those shapes on the first page represent your book’s title. The electronic version, though, very much wants to know which of the various characters represent your title so that, when it is loaded into an e-book, the e-book can display it in its index. It also wants to know where all your chapters start and end so it can navigate directly to them, and it, most importantly, wants to know which bits are the words of your story so it can render them in the way the reader has requested.

Now for the why. There are a few reasons why you can only suggest, rather than dictate, how the electronic version of your book is formatted. The first is down to device limitations. A good example of this is in the case of fonts. To be able to use a font, the e-reader has to have the font installed. There are millions of fonts out there, there is no way that all of them can be installed. It is possible to embed the fonts you want to use in your novel, but this requires a more advanced device to be able to read them, which would make the e-reader more expensive, so it isn’t currently supported in many devices.

The second reason why you can only suggest how your book is styled is that e-book readers can just ignore. Left to there own devices, people sometimes make questionable choices or just mistakes. E-readers sometimes enforce technically unnecessary rules because they believe it will make the experience better for the reader. There is nothing you can do about them. If you come up against one, don’t fight it. You won’t win and, once you’ve got over the frustration, you’ll probably realise that what you were trying to would have only worked on a limited number of device configurations or wasn’t really that important after all. For example, you can try to set all your text to be centre aligned on a kindle, but it won’t be. There is no reason why this is the case, except that in 99.99% of cases it would be a mistake, so the kindle ignores you.

The third reason is that not all readers of your novel are the same, so they will have their device set up differently. Take the example of font size. If your book is being read by someone with poor vision, they might well want or need to make the text bigger. Now, if you’ve tried to be cleaver and relied on the size of the font to do something you shouldn’t (such as centring a bit of text by putting x number of spaces in front of it), when the font size is changed, everything is going to look very ugly.

The final reason, and often the most frustrating, is because of the way text flows when it is read on a e-reader. Because you don’t know how big the text is going to rendered nor whether the device is going to be used landscape or portrait nor a myriad of other factors, you don’t know how big a page is going to be. This means that any formatting you want to do that is relative to the page isn’t going to work. These problems tend to manifest themselves most when you have important information that you want to include in a header or footer. It can also be a problem if you have a diagram that needs to be close to some explanatory text. Often the solutions available will work for you. For example, footnotes can be included at the end of the chapter, rather than the bottom of the page, and navigated to by clicking. But sometimes it can require a big rethink of how your book is laid out, especially if you are writing an academic text book.

The upshot of all this is that our master document will have to include all the style information required by the print version, all the context information required by the electronic one plus the style suggestions for it, and that, when exported, the unneeded information will be discarded.