Sigil: for full ePub editing.

How is this done? Part 3: how to make high-quality text in epub. institute_books wrote in September 28th, 2012

In previous posts in the “How to do it” section, we talked about, as well as in Russia.It turned out that the topic of creating text in epub was of interest to many, so today we will tell you in more detail about How to make high-quality text in epub format.

To begin with, it should be noted that epub was created as a professional format for publishers. It was assumed that the publisher's team should have a programmer, and it is not difficult for a programmer to make an epub.

In fact, EPUB is an archive, a ZIP file, compressed in a special way. This is easy to verify: change the extension of any .epub file to .zip and unzip it. Inside this archive you will find the book's content files (in XHTML format), additional files for illustrations, fonts, etc., and the required supporting files that the EPUB standard requires to describe the book.

If you need epub for personal use(for example, read a book you have in doc or txt in Bookmate), you can use a converter program, for example, Caliber or epubgen(there are many such programs, we will not list them all). The result will be acceptable - but only for personal use. This epub is not suitable for publication.

If epub is needed for distribution, then you will have to put in more effort. You can get a better epub by using the program Scrivener. This is a word processor designed specifically for writers: it allows you to create and process texts, as well as track and save ideas, images, store drafts, generate names for characters, and more. Text written in the program can be exported to epub and get good results. Scrivener is available for both Windows and Mac and costs about $40. The only drawback is that the interface in the program is only English, Russian is not supported.

The easiest option to make a high-quality epub accessible to non-professionals is to use the program Pages(text editor for Mac).

To do this, you need to download the template file ( http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip ). From this template you need to import styles into your text file, do not forget to click the “remove duplicates” checkbox. After which you needmark those styles that should be included in the table of contents, then (this is very important, although long and tedious!)go through the entire text and click “apply styles” for each paragraph or fragment. After this you canput a nice picture and title on the first page of the book(to get the cover). Then select File-export-epub and get a fairly good epub.

It is important to remember that all images in text in Pages must be associated with the text (and not tied to the page) - that is, the graphics must be inserted directly into the text. In addition, all footnotes must be page only.

For professionals

A programmer who knows XHTML and CSS will cope with this task without any problems.

We can recommend to professionals a program that allows you to create epub - Sigil. Its advantage is that it is free and provides ample opportunities. You can insert simple text into the Sigil program, fine-tune styles, insert fonts, and so on, achieving excellent results. But without CSS knowledge, unfortunately, nothing will work.

There is also the possibility of exporting from Indesign in epub - but for this you need to be a good layout designer. In addition, processing the layout will require quite a significant amount of time. You can read more

The summary of our post can be formulated as follows: if you need a high-quality epub and you are not a professional and don’t know CSS and XML, then use export in the Pages program. If you do not have a Macintosh, then use the Scrivener program.

We thank Vladimir Kharitonov, partner of eb00k, for preparing the text.And executive director Associations Internet publishers.

You can view any image inside ePub in an enlarged form by double clicking on the “picture”.

Book in pdf format (9.2 Mb): link to preview and download (mirror: https://cloud.mail.ru/public/GGZY/tGbNDEVV3)
(it is recommended to download together with the ePub format, it is more informative, since in ePub it is possible to view the code, and not just the appearance of the pages). In the lower right corner there is a full screen view button. When you go to full screen view, you can click the thumbnail button to preview the reduced pages. The pdf version was made by converting from doc with settings “for iPad”.

(page size 140x190 mm). Visitors can leaf through the book and if they don’t need it, then don’t download anything to their computer. Individual chapters were published as part of the Master Class on Publishing Books in ePub Format.

I think most readers know that on your computer you can add notes (comments) to a PDF file, which are saved in the file. Internal (cross-links) and external links from the file are clickable (working). Adobe Reader offers high-quality search by keyword or phrase and much more. (small illustrations below are clickable)


Information must be free.

Non-commercial use only.

-=-=-=-

I can’t prohibit anything, so I ask: Do not convert this manual to fb2 format, because... then a “perdumonocle” will happen - the distribution of freak copies after the automatic conversion of fb2 to other formats. This will include copies of ePub with crippled formatting, broken internal links, loss of cover and other garbage.

And what for is bullshit?

Yes, now there are practically no reading devices in the world that need fb2))). And I believe that many people have enough skills to make an equally high-quality fb2 from my file. But, there are many electronic libraries on the network with built-in automatic meat grinders, er, converters, and then the process will start, and I will feel sad.

If you want to place this book on your website or blog- place the cover thumbnail and output + clickable (working) link to this page. All books (in different formats) are stored in cloud storage on Box.com. You do not need to load your hosting. And you can be sure that the Guide will be in the latest version.

Addition:

The text of the book provides a link to a CSS example (css can be simply copied from the text or downloaded separately, used and modified at your discretion).
Direct link:
CSS example (445 downloads) This is legal, you are not breaking anything.

Larger version of the manual cover: http://photo.qip.ru/users/morjx/151019728/177572827/

Version history:

File version 1.2

UPD 01-05.02.2013 - several illustrations were added, the Tips & Tricks chapter was added, typos were corrected. UPD 02/10/2013 - the section “Frequently asked questions from authors about the e-book” and a Glossary of terms have been added to the Appendix. UPD 02/24/2013 - typo corrections, small additions to the Algorithm and Tips & Tricks sections. UPD 05/22/2013 - an illustration has been added to the Operation Algorithm, in the pdf file the font has been replaced with Verdana.

File version 1.3

UPD 29.05. - 06/02/2013 - chapter "Epub - what's inside?" moved to the initial part of the book, some illustrations and screenshots were changed. The chapter "Introduction" has been added. In connection with the updates of the Sigil editor from April 2013, the chapter “Insert Cover” has been added.

UPD 08/19/2013 - the chapter "Preparing the cover file" has been supplemented with a description of typical mistakes in cover design.

Noticed typos have been corrected, unnoticed ones are recommended to be considered the author's spelling. Authentic ePub book file has h2 headers blue.

There are very few programs with which you can work with the content of ePub files. And Sigil is perhaps the best of them.

Of course, ePub can also be edited manually. But a visual editor with rich tools is definitely a more convenient option. After all, each ePub book is an archive containing XML files with text, illustrations, design styles, and files with metadata. However, in order to cope with all this diversity, you will have to become more experienced in knowledge of both XML itself and the ePub specifications (the rules by which the structure of electronic books of this format is organized).

Sigil's powerful cross-platform editor makes working with ePub internals extremely easy. Moreover, the program is available for free.

The editor displays the book in two modes, which can be switched between by pressing buttons on the main panel. The first is designed for visual editing and resembles regular text editors like Microsoft Word. The second mode shows the contents of the book as a code.


This is a very convenient solution. The visual editor is great for beginners, but it's not feature-rich enough to, say, insert a drop cap or enable hyphenation. And knowing the basics of XML and CSS, you can significantly diversify the appearance of book pages.

There is also an additional display mode - web inspector (“Preview”). It helps you quickly find lines in the code that are responsible for certain text elements. For example, if you hover over a heading, the web inspector window shows its code. There is something similar in Internet browsers.

Simple navigation through the book is provided by two panels: one shows the file structure of the book, the other shows the table of contents tree.

When working with code, you will be provided with assistance from an expandable set of “snippets” (frequently used code fragments), tools for checking code for compliance with CSS and XML and ePub standards. The search and replace mechanism can work with all files of a book at once. The Unused Graphics and Styles Remover removes junk from the ePub file.

The service data manager will save you the lion's share of time when working on your book. The metadata editor will allow you to quickly enter all the background information: the name of the author, year and place of publication, name of the publisher, ISBN code, genre, names of editors and proofreaders - there are a great many fields for this.

In the program settings you will find a few more pleasant surprises. For example, you can customize the fonts and colors of code elements, set the interface language (including Russian) and configure keyboard shortcuts. But things didn’t work out with spell checking: there are no Russian dictionaries in Sigil yet.

All these are just the basic features of the editor. Working with Sigil, you will discover a lot more little things that will be useful in your work. For a detailed introduction to all the functions of the program, you can download the help. And the files of the program itself are available for downloading (links at the top of the page).

Conversion using the Sigil EPUB eBook editor program

"Tips & Tricks" - small tips and tricks of the ePub format*.

Converting a document

PDF* is the worst format for converting to ePub*. Word also has its challenges, but it is better suited for converting to a reflowable format. -recommends the following sequence:

Word* → Web*(HTML) → ePub*, perform the last step in Caliber (mobi)*.

General recommendations: The main type of headings recommended for use is h2. It is recommended to use the first level heading on the title page for the title of the book. Creating a Contents file with multi-level headings is not highly recommended h1, h2, h3 etc., since some readers can work (display) only single-level content (Table of Contents). At the touch of a button Generate Table of Contents- a table of contents is created, after which it is required HTML TOC - menuTools - Table Of Contents - Create HTML Table Of Contents.( Service- Table of contents- CreatefailHTML withtable of contents).

Fonts

Very complex formatting, variety of fonts and decorations are, of course, the work of the author. There is a term "bells and whistles" ("whistles and bells").

It is not always possible to predict how all these delights will look in different reading programs and on different devices. Therefore, use the simplest possible formatting and proven styles, even in the first stage of creation - Doc*.

Store the document "STRICTLY" in a numeric name. The Web* document is also saved in a numeric name. (html with filter). Example: 978-5-488-01801-3.htm - 978-5-488-01801-3.ePub;

Layout of the document. Types of e-book creation

Table layout- was previously the main layout method, but is now widely used in a variety of cases. Using tables, frames are made, modular grids are set, a colored background is created, elements are aligned, etc. Fixed layout type— a design (tabular or block), in which the width of the column/figure is specified in pixels, i.e. specified precisely. Rubber type layout— a design in which the table/figure column width is set as a percentage of the current screen resolution.

Tables in ePub format

If a book is created with a “fluid layout”, then it is recommended to insert the table in the form of a png* or jpg* image. But it is advisable to register the table in Doc* so that there are no future problems with converting tables to another format.

! “Then I fled and for a long time I heard plaintive calls behind me:

- Come on, I'll show you the skulls! Come back and look at the skulls!" (c)

Switching to Code Mode (html) and back

Switch from book view to code view and back - F2 key.

Reviewing the code (html) and correcting errors in the book

If the file has been split into separate pages, a cover and illustrations have been inserted, you need to check the file for typical errors and formatting flaws. Using the Find & Replace function, you need to check the file and replace all ("-") hyphens where there should be a dash "-". (Applying the Find and Replace function in Regex mode is possible to “This open file” / Current File or “To all HTML files” / All HTML Files).

Pay attention to line endings in paragraphs (extra spaces before the closing tag

). Extra spaces can lead to extra blank pages in books.

! Additional (extra) blank lines before headings must also be removed, otherwise readers will issue a page break command before the heading and this will again lead to blank pages.*

At the same stage, it is advisable to proofread the book page by page and line by line to identify common typos. If all the proofreading has been completed and the necessary additional pages have been created - Title Page, Preface or From the Author, Acknowledgments, Bibliography, Copyright Page, etc., then you can create a Table of Contents (click the appropriate button on the Generate Table of Contents toolbar).

Picture as title

Solution: The inserted image entry should be wrapped inside a title tag

Solution: If the book is divided into separate xhtml files at the rate of one page for each poem, then everything is very simple. In the Book Browser, in the left window, you can drag and drop a separate xhtml file to the desired position with the mouse. Afterwards, you need to re-create the Table Of Contents (Table of Contents or Contents file) to save the changed sequence of works. Additionally, I advise you to select all numbered files and Rename them so that there is sequential numbering of individual sections.

Insert a blank line between blocks of text

Sooner or later, this question arises among many book creators. I encountered it literally right away, because... collected books of poetry, for which spaces are very important to indicate individual stanzas or quatrains. The Sigil Editor's Guide, or more precisely the Frequently Asked Questions for Sigil (FAQ), offers the following solutions.

It is suggested to insert a "self-closing tag"
or "empty paragraph" in the form . Unfortunately, many reading programs, including ADE (Adobe Digital Editions), ignore these commands. Accordingly, empty lines will disappear in ADE-based readers. “Empty paragraph” is ignored as it does not carry any information load. Doesn't help either code


. One solution is to force all such code entries to be replaced with (non-breaking space within a paragraph). This decision is considered controversial. This is the method I use all the time. It is often recommended to specify the correct top and bottom margins for the paragraph tag (for example, 0.5em) instead of margin-top: 0; margin-bottom: 0.2em; like in this book. Some people only insist on increasing margin-top: 1em; and justifies his choice. Discussions about the intricacies of CSS style sheets periodically resume on forums. I wrote my choice.

The recommended code for inserting multiple empty lines is



(you will get 2 empty lines, this works and is used by me). Tag
is not ignored here, because is inside the container
.....
. The symbol in the Sigil editor is "wonderfully automatically replaced" by a non-breaking space character

! There is also another code for page breaks:


Displaying the first line of a work as the title in the Table of Contents

One or more poems by the author are left untitled and are indicated on page *** or xxx. How can I display the first line of a work as the title in the Contents file (in the Table of Contents)? Solution: Let's go to the page code viewing mode in the Sigil editor.

* * *

I remember a wonderful moment

Inside a tag

must be inserted title="..." You will get this entry:

* * *

I remember a wonderful moment

Now copy the first line of the poem and paste it before the ellipsis:

* * *

With this decision, the appearance of the poem on the page will not change, but the content will include exactly the first line of the work.

*__________________________________________________________________________*

If you immediately accustom yourself to a single style of naming book files and cover images, you can avoid many problems, confusion, etc.

*___________________________________________________________________________*

Inserting special characters

Inserting special characters. Yes, there is a button with the letter "omega" - Ω, which brings up a panel of additional symbols that may not be on your keyboard.

This panel can be kept open (drag it to a convenient position) so that you can insert multiple characters into the desired areas of text. If you hold Ctrl while clicking on a symbol, the symbol will be inserted while closing the panel.

Book background

To do this, you can specify a background color in the CSS style sheet (and set the desired background color).

body (

margin-left: 2%;

margin-right: 2%;

text-align: left;

background-color: #FFFFFF; /*white*/

color: #000000;

How to write an epigraph

According to the rules, the Epigraph is written on the right side of the sheet without quotation marks. The author's surname and initials are not placed in brackets, and there is no period after them.

The entry in the CSS style sheet is:

div.epigraph(

font-family: LiberationSerif-Italic, serif;

font-style: italic;

font-size: 98%;

margin: 1em 1em 2em 17%;

text-align: justify;

color: #000080; /*navy*/

It describes the use of a specific font, italic, slightly smaller than regular text (98%). Font color.

What is important is the margin parameter. This parameter defines the margins around the text, sequentially: top (top), right (right), bottom (bottom), left (left).

margin: 1em 1em 2em 17%;

Left margin 17% - selected empirically (experimentally). Design of the epigraph (view the page code, I’ll highlight the tags for clarity):

abracadabra to
crible-crable-boom...

Eat some more of these soft French rolls...

What does the reader see?

abracadabra to crible-crable-boom...

Eat some more of these soft French rolls...

I must remind you that accurate display of the epigraph is possible if the reader “works” with the CSS table. I try to take into account different options for the development of events and have already seen in books that the epigraph “sticks” to the title and to the main text, and the lack of indentation to the right. Therefore, I continue to methodically insert an empty line above and below the container with the epigraph.

Make Notes

Create a separate xhtml file and name it Notes. Place notes on it with the corresponding numbers. In book view, highlight the text of the first note and click the button with the anchor image. In the pop-up window, you can assign (or edit) an individual ID, for example, footnote001 (the identifier must begin with a Latin letter). This identifier must be unique. In the text of the book, place it in the place where the text needs a note. On the Sigil toolbar, click the button with the image of a chain (Insert Hyperlink - insert a link). In the pop-up window, select the ID (in the example given it will be Notes.xhtml#footnote001 i.e. Notes page name #footnote001). This creates a working link to a specific note. To be able to return to reading the text, you need to create an “anchor” on a word next to . On the Notes page you can write “back to reading” or “return to text”. Select this inscription and create a hyperlink to return to the original page with specific text (in this example it will be Section0031.xhtml#make_notes). Yes, these links will work when reading on a tablet/reader with a touchscreen, or when reading on a large computer. The placement of notes can be approached in different ways: Notes at the end of each chapter, Notes at the end of the book on one page, Notes at the end of the book with 1 note per page. And, yes, I can’t advise anyone who loves automation; I make notes manually.

Creating an Index File

It is recommended to begin this stage when all sections of the book have been completed. Index is an alphabetical index. If you think that this page is necessary in your book, select the desired term or phrase, go to the menu Tools - Index - Mark For Index (Tools - Index - Mark for inclusion in the Index). When all the necessary terms in the book are marked, you can select Create Index from the Tools - Index menu.

Clips (Clips, fragments)

Using the Clips function (Clips, fragments). In the Tools menu section, you can call up the settings for this function (on the keyboard Ctr + Alt + C).

The speed of code editing will increase several times!

So, this menu presents code elements that you can quickly apply to a selected piece of text (Example: - div clip has value

\1
. Switch to code view mode of the page. If you select the text and right-click on a div from the set of clips, the text will be enclosed inside this tag. When inserting a clip into the code, you can hold down the Ctrl key to remove any tags present in that section). These clips can be edited (Clip Editor), supplemented with new blanks, and saved text passages that often have to be inserted into a book. Many "regular expressions" (RegEx) can be used.

Examples of clips (or clips) that I use. First the conditional name is written, then the inserted code:

blank

strong \1

dash «-»

a href \1

epigraph

\1

imgDiv

\1

br

Closing Tag

Using the Close Tag feature. In the Insert menu item there is a Closing Tag item (Ctrl + dot in the English keyboard layout). This can be useful when editing code, for example when copying part of a paragraph

Some piece of text - at the end you need a closing paragraph tag

.

Template - xhtml file templates

Practical advice: if you are going to make not one book, but several, it makes sense to create a Template - blank xhtml files with prepared pages Cover, Title, Acknowledgments, Copyright. When creating a new book, import templates with prepared sections, this speeds up the work. (If you create a template epub file, the template and books based on it will have the same UUID identification numbers. This number can be seen in the content.opf and toc.ncx files (they must match).

Bulk file renaming

The editor allows group renaming of files. As already written above, the sequence of files in the book can be changed by simply dragging with the mouse. Afterwards, you may need to “put things in order” and number the files sequentially. For group renaming, you need to select the first xhtml file, press Shift and select the last one. Right-click in the menu and select Rename. If the files have the form Section0001.xhtml, then it is advisable to select a three-digit marking, otherwise the program will generate an error that there are duplicate numbers. With the second call, I usually restore the four-digit numbering. Sometimes it is convenient to give individual files meaningful names (only Latin, no spaces). Example: Title, Foreword. Then you need to re-create the Table Of Contents to save the changed sequence of works.

Embedding audio and video

At the moment it has no practical significance (imho), it is closer to experiments and self-indulgence. There are several ways. One of them is to embed media files using Flash.

iv>

The problem is that iOS devices (iPad, iPhone, iPod) do not support Flash, and neither does Kindle. It is possible to create an iOS-optimized book with embedded media using HTML5, but only HTML5-compatible devices and programs will be able to play them (iOS devices and goodweb browsers, but not Adobe Digital Editions and many other ebook software and readers).

! A couple more points: media files can add significant weight to a book. And the processor power of many reading devices (readers) may simply not be able to handle such a load.

METADATA

Filling in the METADATA - the output of the book. This is a very important part of the job. Click the Metadata Editor button on the toolbar.

Required fields: Book title, Author, Language. Additional data can be entered by clicking the Add Basic and Add Role buttons. This may include the document's creation date, publisher, editor, illustrator, cover designer, photographer, ISBN number or UUID. A description of the book Description can be inserted, which is displayed on the display in many reading programs.

Creating an e-book is a labor-intensive process. And as you can see, it is difficult to do at home. After all, before you create an e-book, all its pages need to be scanned - the difficulty lies in the fact that not everyone has professional equipment at hand to create high-quality scans. We have the necessary equipment for scanning books. And you can ask for help at creating e-books to us.


The page was generated in 0.01 seconds!

There are very few programs with which you can work with the content of ePub files. And Sigil is perhaps the best of them.

Of course, ePub can also be edited manually. But a visual editor with rich tools is definitely a more convenient option. After all, each ePub book is an archive containing XML files with text, illustrations, design styles, and files with metadata. However, in order to cope with all this diversity, you will have to become more experienced in knowledge of both XML itself and the ePub specifications (the rules by which the structure of electronic books of this format is organized).

Sigil's powerful cross-platform editor makes working with ePub internals extremely easy. Moreover, the program is available for free.

The editor displays the book in two modes, which can be switched between by pressing buttons on the main panel. The first is designed for visual editing and resembles regular text editors like Microsoft Word. The second mode shows the contents of the book as a code.


This is a very convenient solution. The visual editor is great for beginners, but it's not feature-rich enough to, say, insert a drop cap or enable hyphenation. And knowing the basics of XML and CSS, you can significantly diversify the appearance of book pages.

There is also an additional display mode - web inspector (“Preview”). It helps you quickly find lines in the code that are responsible for certain text elements. For example, if you hover over a heading, the web inspector window shows its code. There is something similar in Internet browsers.

Simple navigation through the book is provided by two panels: one shows the file structure of the book, the other shows the table of contents tree.

When working with code, you will be provided with assistance from an expandable set of “snippets” (frequently used code fragments), tools for checking code for compliance with CSS and XML and ePub standards. The search and replace mechanism can work with all files of a book at once. The Unused Graphics and Styles Remover removes junk from the ePub file.

The service data manager will save you the lion's share of time when working on your book. The metadata editor will allow you to quickly enter all the background information: the name of the author, year and place of publication, name of the publisher, ISBN code, genre, names of editors and proofreaders - there are a great many fields for this.

In the program settings you will find a few more pleasant surprises. For example, you can customize the fonts and colors of code elements, set the interface language (including Russian) and configure keyboard shortcuts. But things didn’t work out with spell checking: there are no Russian dictionaries in Sigil yet.

All these are just the basic features of the editor. Working with Sigil, you will discover a lot more little things that will be useful in your work. For a detailed introduction to all the functions of the program, you can download the help. And the files of the program itself are available for downloading (links at the top of the page).