The Adventures of Joe Nobody and the Badly Formatted Epub! A Beginners FAQ!

Let me start by saying I am aware that I started a discussion in the main Sigil thread stickied at the top of the forum. After a short deliberation I figured that I am probably re-asking a lot of already answered questions and that these questions will likely be asked again.

I have decided that I will do my best to compile a Newbie FAQ. A beginners guide to Epub Perfection!!! I hope that all Sigil users, contributers and Creator, cough cough, will add there input and help make this a useful tool.

The format as I see it will be a collective posting and answering of questions that I will compile into an orderly manner in the first 5 or so posts in this thread. Feel free to post questions and answers in this thread. I will also watch other threads for Q & A that should be included.

Q: What is Sigil?
A: Sigil is a WYSIWYG eBook editor. It is designed to edit books in ePub format.

Q: Why would I use Sigil?
A: You are tired of poorly formatted eBooks that don't do the book you are reading justice. You want your eBooks to feel and look like the real deal! You want to customize your reading experience! So many reasons, so little time!

Q: Is it available on my OS?
A: Sigil is available for download and installation on Windows, Mac & Linux.

Q: I have downloaded the install files and now i have to install, help me?
A: Of course, Sigils creator has graciously provided us with these instructions.

Q: What is an ePub?
A: ePub is an open format defined by the Open eBook Forum of the International Digital Publishing Forum. It is based on XHTML and XML along with optional style sheets.

Q: What is .SGF then?
A: .SGF is the file type native to Sigil. It is used to save the data of your book as you edit it. It's the "working" code dumped raw. Also, it's proprietary to Sigil and shouldn't be used anywhere else.

Q: Why use .SGF and not just save it as an ePub?
A: With SGF, there is no preprocessing. The benefit here is that the user is isolated from the changes that are made when exporting an epub. In the future, when Sigil supports loading and saving of different file formats (RTF, Mobi, LIT, LRF etc... who knows), those formats will conceivably need some specific information recorded that cannot just store in an epub.

Q: So when do I make it an ePub?
A: You can save it as an ePub any time you like. It isn't actually necessary to do so until you are finished your project or want to view your work on your eReader.

Hey that's a nice Epub! Can it get any better? An advanced guide to Epub editing!

Q: How can I use an Image for a Chapter heading (an image saying "CHAPTER ONE", and have it show up correctly in the Table of Contents (in text, as "CHAPTER ONE")?
A: You can put anything between the heading tags to make Sigil link to it in the NCX, and set the "title" attribute on the <h#> element to get the text.

Q: What is the difference between the .sgf format and ePUB file format?

A: SGF just takes whatever the state of your XHTML code is in currently and dumps it as one large XHTML file (in an epub-like container, with the included images etc). The source file looks exactly like what you see in Code View.

Exporting an epub takes your source code, splits it up on chapter breaks, filters out Sigil-specific CSS and XHTML, creates CSS files from <style> tags and then writes it all out. So there is some (a lot actually) pre-processing going on.

Similar functionality to other editors - is there a way to mark part of the "find" expression and use it in the replace expression. For example find "The Book, Chapter [0-9]+:[^\n]+" and replace with "<h2>Chapter ...</h2>" where the "..." is the rest of the matched expression.

The offical FAQ mentions that this thread is the right place to contribute to the official FAQ.

The answer to the following FAQ question: How do I add margins to the text? could be significantly improved.

In particular, body { margin-left: 2em; margin-right: 2em; } is recommended, which will only add left and right margins. Extending this example to body { margin: 2em } doesn't work well either, adding top and bottom margins only to the entire book.

After a fair bit of searching on this forum, I discovered that a better approach for margins is: @page { margin: 2em; } which will add margins to every page of the book.

The answer to the following FAQ question: How do I add margins to the text? could be significantly improved.

In particular, body { margin-left: 2em; margin-right: 2em; } is recommended, which will only add left and right margins.

Using em for margins instead of points means that when the font size is increased, so are the margins, making readers who prefer a large font stuck reading two or three words in the center of a mostly-blank page.

Device: eb1150 & is that a nook in her pocket, or she just happy to see you?

Quote:

Originally Posted by akratic

The offical FAQ mentions that this thread is the right place to contribute to the official FAQ.

The answer to the following FAQ question: How do I add margins to the text? could be significantly improved.

In particular, body { margin-left: 2em; margin-right: 2em; } is recommended, which will only add left and right margins. Extending this example to body { margin: 2em } doesn't work well either, adding top and bottom margins only to the entire book.

After a fair bit of searching on this forum, I discovered that a better approach for margins is: @page { margin: 2em; } which will add margins to every page of the book.

to further expand on this point, i don't recommend using ems as the unit of measurement for margins, since that is a proportional unit (it is the width of the letter "m" in whatever font size you are using. if the font size itself is defined in ems, 1em is around 16pt). this means that if you enlarge the text, the margin will also be enlarged proportionally. it's better therefore either to use percentage (which is proportional as well, but to the size of the display) for example :
body {margin : 15%;}
or
@page {margin : 15%;}

or use pixels (this is a fixed unit and will not vary proportionally), for instance
body {margin : 20px;}
or
@page {margin : 20px;}

Device: eb1150 & is that a nook in her pocket, or she just happy to see you?

Quote:

Originally Posted by Elfwreck

Using em for margins instead of points means that when the font size is increased, so are the margins, making readers who prefer a large font stuck reading two or three words in the center of a mostly-blank page.