Writing: Indie Savvy (Sigil ePUB Editor)

Ana's Note: This is a piece in the ongoing Indie Savvy series. 

Sigil ePUB Editor

SECTION 1: Formatting Options

There are many different opinions about how to format your eBook, some of them less disinterested than others. Any information you receive from a retail store is going to be written with their particular conversion engine in mind — and, yes, almost every retailer will run your eBook through an automated conversion as part of their processing paradigm to protect customers from poor formatting. And numerous third-parties exist to format your eBook, sometimes at a considerable price and sometimes with misleading marketing which implies that formatting is the hardest thing in the world. In my opinion, that doesn’t need to be true for most authors.

What I’m going to outline here is a self-formatting method that I believe to be easy to learn, simple to master, and (above all) financially free. If you decide to go with a professional formatter on the grounds that your time is worth more than your money, I strongly recommend going with a fixed-price formatter rather than one that will take a cut of all your book sales. This latter category usually combines formatting services with uploading services and will call itself a “publishing group” or something similar. Some authors decide that these arrangements are beneficial to them, but I recommend putting off that decision until your second book, after you’ve seen all aspects of the self-publishing process.

In the Smashwords distribution section, I will discuss in more detail a third-party formatter I have worked with in the past, but briefly here I can recommend the 52 Novels group as fixed-priced professionals who do good work and conduct good communication and good customer service. However, it is important to note: Even if you go with a third-party formatter in the end, you very likely will still need to know the basics outlined in this chapter. So keep reading.

SECTION 2: Why ePUB, and How To Download Sigil

If your book is a text-based book — such as a novel or instruction manual, in contrast to a graphic novel or comic book — then as soon as you’ve finished writing and editing your book, you need to get it into ePUB format.

The statement above is a statement of opinion not universally shared, but I could not believe it more strongly. The ePUB format is the format that the majority of retail stores will use when selling your book, and it is the format that the majority of your readers will expect to use on their eReaders. The ePUB format is also immensely easy to convert from but tremendously difficult to convert to: in other words, once you have your book in ePUB format, it’s very simple to get other formats from it later as needed.

Having an ePUB copy of your book will save you an inordinate amount of time during the uploading phase and will prevent the myriad of conversion errors that plague indie authors when they try to utilize retailer conversion methods (such as .doc to .epub or .pdf to .epub) which will almost certainly result in errors that your readers will assume are your fault. And having an ePUB copy at hand will allow you to send free review copies through email without having to pay your retailers for “gift copies”.

So now that I’ve convinced you that ePUB is the way to go, what does that mean and how do you go about it?

There is a longer description of the ePUB format online — which will go into all the technical background of the ePUB format as a free and open standard maintained by the International Digital Publishing Forum — but all you really need to know is that we’re talking about an electronic file format, .epub, just like .doc is a file format. Only where .doc requires Microsoft Word in order to read or edit the file, .epub requires its own editor for reading and writing. And for our purposes, we’re going to use the Sigil editor.

The Sigil editor is a free and open source software tool which you can download here. I’m going to suggest that you download the 0.3.4 version of Sigil, because at time of writing I believe it to be a better editor for our purposes than the more recent versions. You can find the following 0.3.4 versions at the link above for the following operating systems:

  • Sigil-0.3.4-Windows-x64-Setup.exe
  • Sigil-0.3.4-Windows-Setup.exe
  • Sigil-0.3.4-Mac-Package.dmg
  • Sigil-0.3.4-Linux-x64-Setup.bin
  • Sigil-0.3.4-Linux-Setup.bin

If you don’t know which version you should be using, probably Sigil-0.3.4-Windows-Setup.exe is the correct one: most of you in the audience will be running 32-bit Windows. Once you’ve downloaded Sigil and installed it, open it up and the program will automatically open a nice, shiny, clean ePUB for you to put words into.

SECTION 3: The Nuclear Option

The first method I’m going to teach you for ePUB formatting will have the unfortunate effect of stripping out all your formatting: all the bolding, all the italics, all the underlining, and so forth. The term for this process in the self-publishing world is the “nuclear option” — popularized by Smashwords — because it is so destructive to the formatting.

As you get more skilled with eBook formatting, the nuclear option may not be necessary for you to use, but I still recommend walking through this section. It’s important to know why the nuclear option works in order to understand how formatting errors happen. And once you know how to employ the nuclear option on a global scale for the entire novel, you can transition to using it for bits and pieces as your future novels may require. Here I will also talk about how to make the nuclear option as pain-free as possible, and how to ensure that all your formatting gets back in before you publish.

Prepping The Text With <P>

Copy and paste the first chapter of your book into a text editor that provides find-and-replace options for special characters. Microsoft Word provides this capability, and I will be using that here as an example. Open the find-and-replace dialog and replace all line-returns with a line-return that is framed by paragraph tags. In Word, the syntax for this request is to replace all ^p (line-return) with </p>^p<p> (closing paragraph tag + line-return + opening paragraph tag). The process should look like this:

Inserting The Text

Once you have your paragraph tags in your novel, open up Sigil. Go up to the Sigil tool bar and find these three buttons:

The button on the left that looks like a book is the text-view for the editor. The button on the right that looks like < > is the code view. The button in the middle is a combination view that shows the text on top and the code on bottom. For right now, open the code view. You should see a mostly-empty body tag, with a single paragraph tag containing a &nbsp (non-breaking space) inside. Highlight that line — <p>&nbsp;</p> — and paste in your prepared novel text. You’ll note that what you pasted in isn’t, strictly speaking, clean code. You should have a leading </p> tag at the top, for instance, which has no corresponding <p> tag. Sigil will clean this up for you, though; switch to text view and then back to code view and you’ll see what Sigil did behind the scenes. The entire process should look like this:

1. Open blank file and switch to code view.
2. Highlight the blank paragraph and paste in your prepared text.
3. Switch to text view and then back to code view to trigger a final clean-up.

The third picture above shows what a completely clean nuclear-optioned ePUB file should look like. Now that you know what your file should look like, you can police your results in the future when you move to simpler conversions and easier copy-paste movements. For instance: for some text, some of the time, you can copy your words into the Sigil text view without having to go through all that <p></p> prep work above, and it will still come out just fine. But! For other text, other times, all kinds of formating awfulness can come over invisibly from the original text editor (Microsoft Word is particularly bad about this at times).

Because you now know what the nuclear option should look like, you can always switch over to Code View after a copy-paste from the Text View in order to confirm that your file is clean. If you start seeing a lot of unexpected formatting in your code, like <p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"> when you were just expecting a simple <p>, you’ll know what is wrong and how to fix it.

Putting The Formatting Back

The nuclear option, as noted above, will strip out all formatting. For most novels, this will only affect bold, italic, or underlined text, but you may also be looking at having to re-indent anything that has a deeper indentation than the surrounding text, such as lines of poetry. You will also have to manually add in any images (more on that below).

The buttons pictured above are the Sigil formatting buttons for bold, italic, underline, and strikethrough. Once you’re in the Text View in Sigil, it’s easy enough to highlight a word and apply one or more of those formats. What isn’t easy is eye-balling your entire novel line-by-line to make sure you didn’t miss an italic word somewhere. So we’re going to use technology to make the process easier.

Earlier we used a text editor with find-and-replace options for special characters in order to prep your text for copy-pasting. Now we’re going to use that capability again to make sure that you catch all your special formatting. Instruct the find-and-replace engine to find all words with special formatting (in the below case, italic formatting) and “replace” them with red-coloring. Now you can see more easily at a glance which words need tweaking in Sigil. You can even use the find function to go directly from word to word so that you don’t lose anything.

This is still a time consuming process. But it is possible to get into an experienced rhythm where most authors can do a chapter in about 10-20 minutes, or five chapters to an hour. That means a twenty-chapter book can take about four hours of your time … or you can hire a third-party formatter for around $200. Really, the choice is yours, but I can say that any time or money invested into getting your novel into ePUB format is time/money well spent.

SECTION 4: Internal ePUB Formatting

And now a few words on formatting within your ePUB: keep it as simple as possible.

The reason for this has almost nothing to do with the ePUB format and almost everything to do with retailers and readers. Retailers want to minimize costs and maximize happy customers. They don’t know where your ePUB came from; for all they know, you wrote the code from scratch in a plain-text editor and left broken code tags everywhere. So retailers have a cost-effective solution: just run the ePUB file through an ePUB-to-ePUB conversion and if no errors are thrown, then the file must be clean!

The problem for you as the author, though, is that some of these store conversions will muck up special formatting (as well as frequently stripping out your cover page image to save space on the retail end), and your readers will blame you for it. Additionally, different eReaders display special formatting differently — or in some cases, not at all. I’ve seen eReaders and eReader apps strip out italic text, only to mean that the reader couldn’t tell the difference between narration and inner monologue.

These things aren’t your fault, but they’re part of the self-publishing process and you are going to have to work to minimize them. One way to do this is to own a number of eReaders and eReader apps and test each store-bought version of your book once the stores have uploaded the book for sale. Another way minimize risk, and much easier on the wallet, is to cut down formatting to the bare minimum. We’ll talk about special characters in a later chapter, but for now here are some things to be aware of.

Minimal CSS

If you add a CSS stylesheet to your eBook (Sigil —> Styles folder —> Add new item —> Style0001.css), I recommend keeping it simple and straightforward. Here is a css block that I’ve used in the past for homemade and converted ePUBs with good reading results:

body { margin: 0; }
h1 { text-align: left; }
h2 { text-align: left;}
img {text-align: center;}
p {
direction: ltr;
display: block;
margin-bottom: 5px;
margin-left: 0;
margin-right: 0;
margin-top: 5px;
orphans: 2;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: left;
text-indent: 0;
widows: 2
.text {
direction: ltr;
display: block;
margin-bottom: 5px;
margin-left: 0;
margin-right: 0;
margin-top: 5px;
orphans: 2;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: left;
text-indent: 30px;
widows: 2
.quote {
direction: ltr;
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
orphans: 2;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: left;
text-indent: 60px;
widows: 2
.superscript {
vertical-align: super;
font-size: 50%;

In the case above, a paragraph that was meant to take the appearance outlined in the “.quote” portion of the css would be framed by paragraph tags that looked like <p class=”quote”></p>. In the case of single words within a paragraph, the code would use a span tag to frame the word, like <span class=”superscript></span>. Here is an example text from my novel Pulchritude:

  <p class="quote">While she spoke the Beast stretched on the ground, his head thrown back, only evinced that he still breathed by his sorrowful sighs. He answered her in these words: "I can refuse you nothing; but it will perhaps cost me my life. [...] If you break your word you will repent it, and regret the death of your poor Beast when it will be too late. Return at the end of two months, and you will still see me alive."</p>

  <p>&nbsp;<br /></p>

  <p class="text">In this single exchange, the Beast hits every area except one on the "Power and Control Wheel" of domestic violence. <span class="superscript"><a href="../Text/Endnotes.xhtml#endnote12" id="backnote12">12</a></span></p>

You can find more information and examples at Amalthia’s eBook Formatting Tutorial online.

Header Text and Tables of Contents

The ePUB format uses special tags to denote text for headings. These tags also signal to the eReader software that the heading be included in the internal Table of Contents that the reader can access at any time while reading. Heading text should be framed by <h1></h1> tags (or <h2></h2> for sub-headings, and so on down) for sub-headings, and so on down) and should contain a “title” attribute for the TOC description. Here are some example headers from my novel Pulchritude:

  <h1 title="Chapter 1 - Rosella">Chapter 1 - <i>Rosella</i></h1>
  <h1 title="Chapter 2 - Ezio">Chapter 2 - <i>Ezio</i></h1>
  <h1 title="Deconstruction">Deconstruction</h1>
  <h2 title="La Belle et la Bete">La Belle et la Bête</h2>

Duplicating Your Meaning (The Italics Failsafe)

A good rule of thumb when formatting is this: if somehow all the formatting was removed, would the reader still catch your meaning? Formatting for emphasis can usually be lost without altering the meaning too much, but italicized text for thoughts can be a major problem if the italics go away. I highly recommend providing duplicate clues to your meaning in the case of formatting failure. In my novel Pulchritude, I indicated internal thought by both italics and quotation marks:

"I meant it this time," he realized sorrowfully.

Font Color and Night Mode

Unless it is really crucial to your novel, do not specify color for your text. A significant number of your readers will be using eInk devices, which will strip out your colors (at best) and potentially render them washed-out and hard to read (at worst). Above all else, do not fall into the trap of designating your novel text as black. This may seem like a sensible, if unnecessary, line of code to add into the mix, but it means that some reading apps will render black text on a black background when trying to read in “night mode”.


Use margins carefully and sparingly. In the CSS block above, I have provided small margins (5 pixels) and indentations for regular text and quoted text (30 and 60 pixels). If you can, test your margin settings on a smartphone; there are too many margin settings out there in the wild that are measured in half-inches and end up rendering as a little worm of text on the small screen of a phone. Don’t do that to your readers.


Images are tricky, and may take a little practice in order to get them right. Let’s first talk about formatting: you’re going to need to use .jpg / .jpeg files in your eBook. The ePUB standard supports more image file formats than that — it can, for instance, handle .png files with transparent backgrounds quite well — but a number of the stores you’ll be uploading to will convert your image formats to .jpg and may do so very badly. For example, here is how the Google Play store converted one of my Pulchritude images, rendering the transparent background into strange boxes and lines:

So save yourself the headache and just use .jpg files from the get-go. If you really wanted that transparent background, just save the background off as white — for the majority of readers, it will look transparent as intended, and the Sepia-themed and Night-mode users are used to images looking a little different.

Getting the images into Sigil is a bit roundabout. Right-click on the Images folder and choose “Add Existing Items…”, then browse to the image on your local computer and select it for addition to your ePUB file. Once the image is in the Images folder, you can reference the image directly in code by name. Here is an example:

<p><img alt="Chapter 1 - Rosella" src="../Images/Chapter%2001%20-%20Rosella.jpg" /></p>
<p><img alt="Chapter Break" src="../Images/Chapter%20Break.jpg" /></p>

The <img> tag contains an image. The “alt” attribute provides a brief description of the image for readers who cannot view or render the images for whatever reason, such as eReaders set up to accommodate visual disabilities. The “src” attribute points to the location of the image, in this case “..” (up two directories within the internal ePUB structure), “Images” (the Images folder in Sigil), and the file name. The “%20” you see above (Chapter%20Break) is the ascii code for a space, since the image was named “Chapter Break”. To avoid this, pull spaces from your images; an image named “Chapter-Break” would have a src of “../Images/Chapter-Break.jpg”.

SECTION 5: Conversion Choices

If you have any background in HTML at all, you will have noticed by this point that ePUB formatting looks a lot like HTML. You might be wondering why you wouldn’t just load up an HTML page and save it as an ePUB for an easy conversion. And you might go from there to thinking that you could save a Word document as an HTML page (the Microsoft Word editor provides this option) and get an easy ePUB that way. Less work, more value!

Well, maybe. You can open an HTML file from within Sigil and save it as an ePUB. And if the HTML file came from a really clean webpage where the author had lovely code and everything was wonderful forever, then the results can actually be pretty good. (This is one reason why the dotEPUB web extension is so cool to have on hand.) But! A number of webpages online are not clean and pretty in the HTML, and the ePUB result will be less so. Also, the ePUB standard does not encompass everything that HTML can do, so the bottom line is that any HTML-to-ePUB conversion is going to need a lot of cleanup. Really it comes down to what will take longer: building it up correctly from scratch or editing something existing until it’s correct. Only you can answer that.

As for the Word-to-HTML-to-ePUB, I really don’t recommend it. I use Word a lot (though not for writing books, but we’ll deal with that in another section), but it has a lot of invisible formatting that gets carried over into any conversion and which has to be laboriously removed by hand after the fact. I have never seen a Word-to-ePUB method that wasn’t more hassle and more error-prone than just building the ePUB from scratch to begin with.


DavidCheatham said...

I find it very sad that a lot of the problem of ePUB conversion (Which really is very simple) comes from the fact that people often still managed to screw it up, which means that retailers have to run an ePUB to ePUB conversion, which means now _they_ screw things up, so people have to preemptively predict what they're going to screw up and fix _that_.

Also, the ePUB standard does not encompass everything that HTML can do, so the bottom line is that any HTML-to-ePUB conversion is going to need a lot of cleanup. Really it comes down to what will take longer: building it up correctly from scratch or editing something existing until it’s correct. Only you can answer that.

There are tool designed to strip down HTML that make it pretty easy. Sadly, some of the best are commercial HTML editors and hence rather pricey for a book conversion. Also, those rather assume the user knows HTML, so would not work for many writers.

I'm rather startled that Sigil doesn't include such an ability. I had thought that was one of the reasons why people used it.

As for the Word-to-HTML-to-ePUB, I really don’t recommend it. I use Word a lot (though not for writing books, but we’ll deal with that in another section), but it has a lot of invisible formatting that gets carried over into any conversion and which has to be laboriously removed by hand after the fact. I have never seen a Word-to-ePUB method that wasn’t more hassle and more error-prone than just building the ePUB from scratch to begin with.

Word-to-HTML-to-ePUB is not a good idea, but that's mainly because Word-to-HTML is not a good idea. Word-to-RTF-to-ePUB can be okay, but that requires adding Calibre into the process, which is an added layer of complexity, which I have a feeling you avoided on purpose in this post.

Anonymous said...

Whаt should be Tοy tro сhοi, you would for certain
be entitleԁ to incuг some advantаgеs, enumеrated as to а lοwer

mу wеblog ... game

Anonymous said...

For to the highest degree vidеo gameѕ of pokіes аs сonsіderably
as online ѕlots, actively plаying numeгous сollections
is has affeсted Online.

Here is my homeρаge ... http://connorstuff.com/groups/game-for-review

Anonymous said...

Іf yоu aгe going fоr finest сontentѕ
lіke I dο, sіmрlу visit this ωeb рage eveгу day becausе іt giνes quality contеnts, thanks

my web-sitе; 3d wolf tattoos

Anonymous said...

Hi! I just wish to give you а huge thumbs up for the greаt info you have
right here on thіs post. I am returnіng
to your web site for mοrе soon.

mу blog post ... temporary tattoos

Anonymous said...

Нide plastic or гeal hаrd-boilеԁ eggs in a pre-deteгmіneԁ area.
And, of сouгse, the treaѕurеs cаn
bе anything you can think of thаt would have ѕignifiсant
value ωithin yоur paгticular family unit.
Some of these are video games based аround wintеr themes, playable onlіne through a user's web browser. This kind of board game can take you back in time and enhance the knowledge of history. A tick mark or dash should be marked for each car they find.

Review my web blog ... most fun games fun

Post a Comment