Can Everton Jones find out how his father stole Emperor Bokassa’s diamonds and, more importantly, where he hid them; before the world and his brother get there first?
Click on the picture link in the sidebar to read an extract of my first novel, which was published by Paradise Press in August 2012.

Wednesday, 23 April 2014

How to create a new blank e-pub using Sigil

These posts presume you are using Sigil to make your e-pub ebook. This post is a primer on how Sigil works and how to get started by creating a blank e-book file. I also explain the structure of the first blank chapter. I will link into this post where appropriate. Some topics are best covered in more detail elsewhere and when that happens I will link OUT to those posts.

The latest version of Sigil contains a host of new and powerful features, and can do a lot of clever things for you. As with most automated systems, use these with caution. What you want to achieve is an e-book which is coded as simply as possible with as little as possible which can go wrong. EACH e-book reader will have its own software installed and the more complicated your code the more likely it is that it will render differently on different devices. This post covers only the basics.

Begin your e-pub project by downloading and installing Sigil. You can get it from here (NB As with all open-source software you might have to scramble about a bit to find the correct download for you.)

[added: 29 Oct. 2015: The download location for Sigil has changed. I have added a new post with the uptodate details here.]

Double-click the icon to open a new blank e-pub file. It opens in a new Sigil window:



The various parts of the window can be moved about and/or might not be displayed. Select items from the bottom part of the View menu to display/hide them:

Click and drag to move the items about and either ‘dock’ them in the Sigil window or drag out of the window entirely to display them in a window of their own if you wish. (Click here for more details on how to display and move the Book Browser window.)

The ‘View’ menu allows the window to be customised. The ‘View/Toolbars’ menu item allows you to add or delete groups of buttons from the toolbar. The illustration shows the only ones you really need:
 

Selecting the options above makes the toolbar thinner and gains space in the main window whilst keeping the buttons you really need. Select a toolbar group from this menu to display/hide it. Each toolbar group displays as a panel in the space below the menu bar at the top of the window and can be resized and/or moved about if you really want to:


Your new e-pub has a single blank chapter, which is displayed in ‘book view’ in a tab in the central part of the Sigil window. The blank chapter is called ‘Section00001.xhtml’ by default. You will notice it is hilited in the book browser, which should be to the left of the window:


Double-click on the chapter file name in the book browser at any time to open it. Click and drag to resequence the items in the Book Browser. Right-click on the chapter filename to re-name (or delete) it using the option from the dropdown menu at any time:


Notice the ‘Book View’ button in the toolbar:

This is also available in the View menu. Click this at any time to switch to book view. ‘Book view’ is essentially a preview of how the file will look in the finished epub. The new, blank e-book should have opened in book view displaying the only chapter, Section00001.xhtml, in a tab in the main Sigil window:


As this is a blank e-book there will of course be nothing in it yet!

I should add that if you select ‘Preview’ from the View menu you will get a window which shows a preview of the file you are editing, broadly analogous to the ‘Book View’ window. However the Preview window updates in real time as you edit your file and contains other tools as well which I have not covered. Dragging the ‘Preview’ panel out of the Sigil window so that it displays in a window of its own might be useful so you can see the effects of your editing as you go along.

Now click the ‘code view’ button in the toolbar:


This is also available in the View menu. The display changes to show the html code which is what the file really looks like:


Click the ‘code view’ button at any time to switch to code view. In fact you can toggle between book view and code view by pressing F2. Going through the blank chapter line-by-line, it begins with:

<?xml version="1.0" encoding="utf-8"?>

This just specifies which version of XML is intended to be used and which character encoding to use. YOU NEED DO NOTHING to this line. Next is a doctype declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


This just specifies which version of html is intended to be used. Notice that it actually says ‘xhtml’. This is a very strict version of html which is required to be used in e-books by the ebook standards. ALL chapters of your e-book should be xhtml files. I have been rather vague about the distinction between html and xhtml in these posts. YOU NEED DO NOTHING to this line. Sigil then adds a blank line which is not important and then the next line is the opening <html > tag:

<html xmlns="http://www.w3.org/1999/xhtml">

It contains a link to a file which specifies the XML namespace, a convention to explain the meaning of terms used in XML which can vary from one implementation to another. YOU NEED DO NOTHING to this line.

There then follows the header, enclosed by an opening <head> tag and a closing </head> tag:

<head>
<title></title>
</head>


In this case the header contains just an empty <title> tag. There must be a <title> tag in every html file, even if, as in this case, it is empty. A title is important for a web page, which after all is what html was originally designed for, but, as the <title> isn’t displayed anywhere in an e-book, this tag can be left exactly as it is. YOU NEED DO NOTHING, just leave it blank.

There then follows the body of the chapter, enclosed by an opening <body> tag and a closing </body> tag:

<body>
<p>&#160;</p>
</body>


In this case the body contains just a single paragraph, enclosed by an opening <p> tag and a closing </p> tag. The text of the paragraph is just &#160; which is the special html code for a non-breaking space.

The chapter then ends with a closing </html> tag.

The only other bits of Sigil which I use for e-book creation are to be found in the ‘Tools’ menu. The Metadata Editor:


is covered in another post. (I will link out here.) It can also be accessed using this button in the toolbar:

The Table of Contents Generator and editor:


can be used to generate the logical table of contents (click this link for information on how to use it). The table of contents generator can also be accessed using this button in the toolbar:


The other Tools menu item of interest is the epub validation tool:


I will cover the use of this tool later and will link that post here. The epub validator also be acessed using this button in the toolbar:


One further button in the toolbar deserves a mention, the ‘Split At Cursor’ button:

I have covered how to split a chapter using this button in yet another post.

Find and Replace can be found at the bottom of the main window:

and is self-explanatory.

One of the most useful features of Sigil is that it can be set to ‘tidy up’ your html chapter when you save it. This feature can be turned on/off from the ‘Preferences’ dialog which you get from the ‘Edit/Preferences …’ menu item. Just select ‘Clean Source’ from the Preferences dialog and check/uncheck the ‘save’ check box (this is covered in just a little bit more detail here). What ‘Clean Source’ does is to line everything up neatly when you save the file. It also checks for errors in your html and won’t let you save the file until it is right. If you do try to save a file containing errors you get a dialog which asks you if you want to correct the html yourself or let Sigil do it for you:


I DO NOT recommend using the ‘fix automatically’ option. Sigil will try its best to understand your html but will probably make a poor guess as to your intentions. Best to click ‘No’ and go back, find the error, and correct it yourself. It might be a nuisance, but at least Sigil is letting you know there is a problem! It is probably best to save fairly regularly (maybe as incremental backups with filenames which are different each time, like fileA.epub, fileB.epub, etc). That way you do not have too many errors to locate at one time!

Save the e-pub in your e-book project folder (File menu). Make sure the filename is a single text string with NO SPACES.

Next Steps: Now you have a blank e-pub file, you are ready to import the marked-up MS Word file into it as unformatted text. (Click here to see my post on how to mark up your file.) Subsequently you will create a CSS stylesheet and then use CSS styling to re-apply the formatting from the original Word file.

Index to ‘how to …’ posts:

How to ‘unpack’ an epub file to edit the contents and see what’s inside.
How to understand what is inside an epub
How to link the html table of Contents in a Kindle e-book
How to restructure the html table of contents for a Kindle
How to delete the html cover for a Kindle ebook
How to link the cover IMAGE in a Kindle e-book
How to clean up your MS Word file before your get started
How to markup an MS Word file to identify the formats before importing it into an epub
How to create a new blank e-pub using Sigil
How to import your marked-up MS Word file into your ebook using Sigil
How to create and link a CSS stylesheet in an e-book using Sigil
How to replace the markup with CSS styles in your ebook using Sigil
How to style an e-book so it works with the limited CSS styling available to Kindle e-readers
How to understand the syntax of CSS
How to style Small Caps in an e-book
How to split your ebook up into chapters using Sigil
How to sequence your e-book
How to phrase the copyright declarations etc. in an e-book
How to generate the logical table of contents using Sigil
How to understand toc.ncx in an e-book
How to generate the html table of contents in an e-pub
How to style the html table of contents using CSS
How to create an html cover for your epub using Sigil
How to present references and notes in a book
How to use Mark Up to link notes in your e-book
How to present a bibliography in a book
How to use markup to link entries in a bibliography with the notes section
How to index an e-book
How to use the tools in MS Word to create an index
How to alphabetise an index or bibliography
How to adapt the print index in your MS Word file for an e-book using markup
How to adapt cross-references in your print index for e-book and how to use markup to make the links
How to understand content.opf
How to understand and edit the Metadata of an ebook using Sigil
How to understand the manifest in content.opf
How to understand the spine and guide in content.opf
How to test your e-pub using flightCrew in Sigil
How to test your e-pub using epubcheck
How to convert an e-pub to Kindle using kindlegen

TinyURL for this post: http://tinyurl.com/mvjcjbg

No comments:

Post a Comment

 
Twitter Bird Gadget