How to make an e book in an afternoon


Published on

A tutorial from Comma Press in Manchester.

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

How to make an e book in an afternoon

  1. 1. Make an eBook in an AfternoonHow to make eBooks in the ePub and MOBI (KF8compatible) formats using free software.These instructions are intended as a how-to guide for making eBooks usingfree and widely available software. If you devote a couple of hours to followingthem, you should have a properly formatted, glitch-free eBook ready forpublication.This lesson will show you how to make eBooks in the most widely used eBookformat (ePub) and then convert this to the Amazon Kindle format (MOBI).We’ll be looking at the example of making an eBook version of a novel, butthe same principles apply for books of short stories, poetry, non-fiction, etc.Before you start, you’ll need to have the following things ready: • The text of your book in rft (rich text) format. You can choose to save a document in rtf format from MS Word. • Another rtf document containing the text of the jacket blurb and any review quotes. • A high-res jpeg image of the book’s cover (minimum 600x800 pixels).And you’ll need to download and install these two software applications: Sigil. This is an open-source ‘WYSIWYG’ (What You See Is What You Get) ePub editing application. Its basically a split-screen xhtml editor that lets you see what your books pages will look like as you make changes to the xhtml code. Download it from Get the latest stable version you can run on your machine, as the later versions have more time-saving functionality. Kindle Previewer. This converts ePub files to the newest version of MOBI (which is compatible with Kindle eInk readers, the Kindle Fire and the iPad) and allows you to view them more or less as they will appear on a Kindle device. Download it at
  2. 2. Part One.Open the Sigil application. This will automatically open a new ePub file. Savethe file as the title of your book, e.g. ‘Novel’.Open the .rtf file of your book in either Text Editor (on a Mac) or Wordpad (ona PC). Copy the text of your book, excluding the title page, prelims and tableof contents.and paste it into the Sigil page (which will automatically have been named‘Section 1’). It should now look like this:
  3. 3. Now highlight the name of the first chapter, and from the drop-down menu atthe top left of the menu bar, select ‘Heading 2’.The text should now look like this:Then go through the text, highlighting each chapter title and formatting it asHeading 2.You’ll see the following 3 buttons at the top of the Sigil window: = Book view. This lets you see what the formatting will look like in the finished book = Split view. Click this button to see both the finished page and the xhtml code behind it. = Code view. Click this button to view the xhtml only.If you toggle to code view, and look closely a the xhtml, you’ll see that tagshave been attached to the text ‘Chapter One’, so it reads <h2>ChapterOne</h2>. This is because you formatted it as Heading 2.
  4. 4. It’s worth noting at this stage that Sigil automatically generates a table ofcontents (TOC) for your book using the header tags you apply. The table ofcontents allows someone viewing an ePub file on a reading device to navigatethrough the text.Sigil will look for the <h> </h> tags in the xhtml code, and add whatever text isbetween them to the table of contents. It does this on a hierarchical basis,with Header 1 being the top level, and Header 6 being the bottom level. E.g.: Chapter One (set in Header 2) Chapter Two (set in Header 2) Chapter Three (set in Header 2) Chapter Four (set in Header 2) Sub-chapter 1 (set in Header 3) Sub-chapter 2 (set in Header 3) Chapter Five (set in Header 2)…and so on.Now toggle back to ‘book view’, using this button.At the moment, the chapter titles are aligned to the left, but you’ll want tocentre them. To do this, highlight your first chapter heading (e.g. ‘ChapterOne’) and click the ‘centre text’ button on the menu bar:Now your book should look like this:If you toggle to ‘code view’, you’ll see that some new code has appeared, as ifby magic. The first bit to pay attention to is near the top of the page. It’llappear in khaki.<style type="text/css">h2.sgc-3 {text-align: center;}</style>
  5. 5. This is CSS code. CSS stands for ‘Cascading Style Sheets’, and it’sessentially a labour-saving way of implementing complex formattingthroughout a document, by setting out some rules at the start. The CSS rulethat has just been written is, as you might expect, about centring.The buttons on the menu at the top of your Sigil window will each implementdifferent CSS rules. But to make a really nice looking eBook, it’s useful tounderstand enough about CSS to be able to write it yourself.CSS rules have 3 components. The ‘selector’, the ‘property’ and the ‘value’. Inthe rule: h2.sgc-3 {text-align: center;}h2.sgc-3 is the selector, text-align is the property, and center is the value.These rules are then imposed on the text itself using tags, like this:<h2 class="sgc-3">Chapter One</h2>Because the text ‘Chapter One’ is tagged with the selector <h2class="sgc-3"> the corresponding CSS rule at the top of the document isapplied, and the text is centred.Why use CSS? Well, you might want to implement formatting changes onmultiple sections of text. It would take forever to write out all the differentstyles in tags around each bit of text you want to change. Instead, you cancompile them as one CSS rule.The next section will require you to write some actual code. But don’t bedaunted! Yes, it looks like squiggles at first, but soon it will start to makesense, and once you’ve learned a bit, you’ll be in command of the formattingof your book.Now we’re going to amend the CSS rule so that it centres not just the firstchapter heading, but all text tagged in the Heading 2 style.To do this, go into ‘code view’ and change the CSS rule:h2.sgc-3 {text-align: center;}to this:h2{text-align: center;}(all you’re doing is deleting the code: .sgc-3)Now toggle back to ‘book view’ and look at the page. All the chapter headingsshould now be centred. If it hasn’t worked, go back into code view and checkyou’ve got the CSS exactly right.In page view, you’ll notice the body text is all left-justified, each paragraph isseparated by a line break, and there are no indents. Yuk!
  6. 6. Let’s fix that in the CSS.Copy these CSS rules (you should be able to copy and paste them from thispdf document):h2 {text-align: center;}p.sgc-2 {text-align: center;}h1.sgc-1 {text-align: center;}p.sgc-4 {text-align: center;}h4.sgc-2 {text-align: center;}h2.drop {margin 0 0 0 1em 0;}p {text-indent: 2em; margin:0 0 .2em 0;}p.noindent {text-indent: 0; }…and paste them over the line of CSS in the code view of your Sigil book. so it looks like this:Now toggle to ‘book view’. The text should look like this:Great! We have indents! However, the first line of body text is still indentedand we don’t want it to be (according to most publishers’ house-styles, thereshould be no indentation after a line-break).
  7. 7. There’s a quick fix for this. Toggle to ‘code view’. Find this bit of code, whichappears right at the start of the first line of body text, and copy it from thecode view page (not from this document):<p><br /></p><p>Now open the find & replace tool, using this button on the menu bar:Paste the code into the ‘find’ field. Then paste in the following code into the‘replace’ field.<p><br /></p> <p class=noindent>And click ‘replace all.’ This should locate all line breaks and ensure that theproceeding paragraph is not indented.Tip – Sigil sometimes reverts find-and-replace changes when you switch backto ‘book view’. If this happens, click your cursor onto the page of code beforeyou switch to ‘book view’.We also want to justify the body text. Highlighting all the sections of text thatneed to be justified and hitting the justify button is time consuming, especiallyif it’s a long book. Using CSS will save time. So, toggle to ‘code view’ and findthis CSS rule:p {text-indent: 2em; margin:0 0 .2em 0;}and add this code, before the closing brace:text-align: justify;So the whole rule now reads:p {text-indent: 2em; margin:0 0 .2em 0; text-align: justify;}If you toggle to ‘book view’, the body text should now be justified throughoutthe book, so it looks like this:
  8. 8. That’s Part One finished! Save what you’ve done so far before continuing toPart Two.Part TwoThe chapters of your book will be listed in the Table of Contents (TOC)because of the way you’ve formatted the chapter titles with h2 tags. If you’reusing a recent version of the Sigil software, there’ll be a pane on the righthand side of your window displaying all the items in the TOC. If you have anearlier version of Sigil, you’ll need to go to Menu/Tools/TOC Editor to view it.Here you can see the TOC items and uncheck any you don’t want to include.Now we’re going to divide up the book, so that each chapter begins on adedicated page. Here’s how:In ‘book view’, click your cursor just after the body text at the end of the firstchapter. Then on the menu, select Insert/Chapter Break.This will split the book into 2 distinct sections, which you’ll see listed in the lefthand pane as Section0001.xhtml and Section0002.xhtml. Continue throughthe text, adding new Chapter Breaks for each chapter (but with care – youcan’t undo this!).Tip – It doesn’t really matter what the pages within an eBook are called, i.e.Section0001.xhtml, Section0001.xhtml, etc. These page names are for thebook’s internal reference only – the reader will never see them.So far, so good. You’ve laid out and formatted the novel, and separated it intochapters, which have automatically been added to the TOC. Unfortunately,this is the point where ePub and MOBI (the Kindle format) compatibility issuesraise their heads. For eBook readers using the ePub file format, the TOC you
  9. 9. already have should make the eBook perfectly navigable. But for Kindledevices, you need to build a dedicated Contents page. Here’s how:1) First of all, in the left hand pane, right click on one of the existing pages(e.g. Section0001.xhtml) and select ‘Add New Item.’ A new page will becreated. Rename this page ‘Contents.xhtml’ (by right clicking on it andselecting ‘rename’). Then right click on it again and select ‘Add Semantics’;then ‘Table of Contents.’ You can drag and drop this page in the left handpane so it’s at the top of the list, and will appear as the first page in the book.2) Now go back to the original rtf document of the book, copy the text from thecontents page. Paste it into the eBook page you just created.3) Write ‘Contents’ at the top of the page, format it as Heading 2, and centreit.4) As eBooks don’t use page numbers, the next thing you need to do is deletethe page numbers listed on the page.By now, your contents page should look something like this:5) Now you need to make it navigable. Toggle to ‘code view’.To link the text ‘Chapter One’ to that page within the eBook, you’ll need toinsert some code. Pasting in the following code will link the text ‘Chapter One’with the xhtml page called ‘Section0001.xhtml’.<a href="../Text/Section0001.xhtml">Chapter One</a>If you now toggle to ‘book view’, and click on the text ‘Chapter One’ (which willappear in blue), you should navigate to the xhtml page ‘Section001.’To build the table of contents, repeat this step for each chapter.When you’ve finished, check that the hyperlinks are correct by clicking oneach chapter name on the Contents Page to see if it links to the right chapter.
  10. 10. Tip – the old Kindle eInk devices will sometimes arbitrarily indent some itemson a contents page. To avoid this, highlight your all chapter headings on thecontents page and left justify them using the button on the menu.PrelimsSome publishers don’t consider it necessary to add a prelims page to aneBook, as copyright and publisher information will be included in the metadata(more about this later). However, if you want to add a prelims page, here’show to do it.1) First, right click on one of the existing pages (e.g. Section0001.xhtml) andselect ‘Add New Item.’ A new page will be created. Rename this page‘Prelims.xhtml’ (by right clicking on it and selecting ‘rename’). Then right clickon it again and select ‘Add Semantics’; then select ‘Copyright Page’.2) Paste in your prelims text and centre it.3) You may well want the prelims text to appear smaller than normal-sizedtext. There are two ways of achieving this. a) In ‘code view’, paste this CSS over the existing CSS code in the Prelims page:p.sgc-1 {font-size: 50%; text-align: center}That should make the text 50% smaller.Tip – Kindle devices, particularly the eInk Kindle readers, have limited supportfor different sized text within an eBook. This was essentially because the‘vision’ of these devices was to give the user control over this aspect of thereading experience – setting the text size themselves. Amazon have revisedthis with the Kindle Fire, which allows publishers to have more control overfont sizes.The upshot is, before publication of your eBook, you must road-test youreBook on a range of devices, old and new (not just the Kindle Previewersoftware), to see whether your prelims text appears in the size you want.Cover ImageHere’s how to insert a cover image.1) Make sure you have the cover image saved somewhere on your computer.It should be a jpeg of at least 600 x 800 pixels resolution.
  11. 11. 2) Right click on the folder ‘Images’ in the left hand pane. Select ‘Add ExistingItem’. This will prompt you to import an image file.3) Once imported, right click on the image file and select ‘Add Semantics’;then select ‘Cover Image’.MetadataMetadata is information about the book, including the title, the author’s name,copyright information, a description of the contents, a blurb, press quotes, alist of territories in which the eBook will be available (which will depend on therights specified in your contract with the book’s author), and in some cases,an ISBN*. You can find much of this information on the jacket of a book, or onthe prelims pages.Metadata doesn’t appear within the pages of an eBook, but is included as partof the ePub file.Metadata is important when it comes to having your book sold by eBookretailers. Crucially, it’s what allows customers find your book when theysearch online (and remember, they might not search for the book’s title or theauthor’s name, but by topic, theme or genre). Without the right metadata, aretailer may not accept your eBook, or it might not be very visible whenpeople search for your book.*Technically, there’s no requirement for an eBook to carry an ISBN. EBookssold on Amazon, for example, don’t need one. However, some eBook retailersdemand it, so allocating it one now could save you hassle in the future. Itshould not be the same ISBN as the hard-copy edition, as this leads toconfusion when customers search for the book using the ISBN.How to add metadata1) In the top menu, select ‘Tools/Meta Editor’.2) Add the book’s name and the author’s name.3) Click ‘Add Basic’. As a bare minimum, I’d recommend adding a Description(use your blurb text for this), the Publisher, the Publication Date, the ISBN ifyou’re allocating it one, and ‘Rights’. In ‘Rights’, list the territories in which youhave the right or license to sell the eBook.4) Click ‘Add Advanced’. Here, as a minimum, I’d add Copyright Holder,Designer, Editor (if an anthology), and Translator (if applicable).
  12. 12. Checking – the first roundFirst of all, have a quick scroll through each chapter of the book in Sigil.Obvious things to check are: • Are the chapter headings centered and correctly formatted as h2? • If the body text uses numbers, asterixes or other symbols to divide sub- sections of a chapter, are these centered? • Is the body text correctly indented on the first line of each new paragraph? • When there’s a line break, is the proceeding paragraph unindented? If not, replace the opening <p> tag of the proceeding paragraph with <p class=”noindent”> • Do the chapter titles on the Contents Page hyperlink to the corresponding chapter in the book? • Are the prelims the correct size? • And obviously, look for any miscellaneous typos that may have crept in. Pay particular attention to any text you have added or altered ‘by hand’ while making the ePub (as opposed to text imported from the rtf). Conversion to MOBI format. 1) Save the Sigil ePub file. 2) Then open the Kindle Previewer application. 3) From the main menu, select ‘Open’ and then choose your ePub file from the dialogue box.At this point, you’ll see a message box telling you the file is being converted.After a moment, you should get the message ‘Kindle Previewer hasSuccessfully Compiled the Book. The Output File has been generatedhere.’ If this is what you see, click OK and carry on to stage 4 below.If you see a message that says ‘Kindle Previewer has SuccessfullyCompiled the Book. But there are warnings !’ this, as you might expect,means something isn’t quite right.Click on ‘Compilation Details’, and scroll down to see what the warning is for.It’s most likely to be one of 2 things, which you’ll need to fix in Sigil before youproceed: a) The cover image is too small. b) There’s a navigation problem in the Table of Contents, which usuallymeans a hyperlink on the contents page directs to a page that doesn’t exist inthe book, or visa versa.
  13. 13. 4) The Kindle Previewer will automatically open in Kindle Fire mode. But as the older Kindle eInk reader is the device most prone to formatting problems, it makes sense to start with that. So on the top menu, select Devices/Kindle. 5) Now navigate from chapter to chapter, using this button: …to check that the formatting and alignment of the chapter titles looks okay. 6) Click this button to see the contents page. Check that all the links to chapters on the contents page work. 7) From the first Chapter, use this button to scroll back through the pages to the prelims. Check they look okay. 8) Now scroll forward through every page of the book. It’s probably not necessary (or a good use of your time) to proof read it. But do at least scan the formatting and alignment of the text on every page. 9) Now repeat the process in ‘Kindle Fire’ and ‘iPad’ modes.Once you’re satisfied it’s all looking good (and, if you’ve gone back to makeany changes in Sigil, you’ve re-checked it in the Kindle Previewer) you’reready to check it on the Kindle itself. 1) Kindle Previewer will have automatically created a new folder in the same location as your ePub was saved. The MOBI file of your eBook will be saved in here. 2) If you’ve opened your eBook in Previewer more than once, you’ll have several MOBI files in here. Make sure you select the latest version. 3) Plug your kindle device into your computer. 4) Drag and drop this MOBI file into the ‘documents’ folder of your Kindle. 5) Disconnect (by safely ejecting it!), then check how the eBook looks on the Kindle, using the same checklist as above.Kindle eInk and Kindle Fire compatibility.As noted above, the older Kindle eInk devices do not support some formattingcommonly used in ePub files. Many of these glitches have been ironed outwith the introduction of the Kindle Fire device and the new, KF8-compatibleupdated MOBI file format.But it’s worth bearing in mind that many of your customers will have olderKindle eInk reading devices, so it makes sense to check how your book looksin the Kindle Previewer in ‘Kindle’ mode, and on an actual Kindle eInkdevice prior to publishing it.To learn more about compatibility issues, you can find a full list of the xhtmltags supported by different Kindle devices on page 52 of this document: 
  14. 14. If you don’t have a Kindle, you can drop into the Literature Northwest office totest your eBook files on our Kindle. Please email arrange this in advance.Now you’re ready to publish!It’s really straightforward to sell a book on Amazon. You can set-up anaccount on the Amazon Kindle Direct Publishing website: