Sigil User Guide (PDFDrive)
Sigil User Guide (PDFDrive)
0.6.0
Dave Heiland
Copyright ©2012 Dave Heiland All rights reserved.
The completely updated release of Sigil 0.6.0 is the result of countless hours of
volunteer effort to create the fastest, most stable and powerful version of the best
EPUB 2 editing software available.
See What's New for a list of changes and features in version 0.6.0.
Help is available from other users and the developers of Sigil at MobileRead:
Sigil Forum @ MobileRead
The Sigil User Guide includes documentation that will help you get the best out
of editing your EPUB, including:
Stability: All known crashes and related bugs from previous versions have
been identified and fixed - making Sigil completely stable for updating your
EPUBs.
Robustness: Sigil can correct even more common problems when reading
files, and will no longer exit when opening most invalid EPUBs. Saving has
been enhanced to perform more integrity checks. Splits and merges can
now be done exactly where you want without potential data loss. The cursor
position is correctly updated when you switch views. And Find & Replaces
work consistently and accurately over one or all files.
Flexibility: More preferences, options and features were added to let you
use Sigil the way you want.
Saved Searches: Never forget a frequently used Find & Replace search
again. Edit and organize searches, run a group of searches, and quickly
access searches using right-click in the Find & Replace text boxes.
Go To Links Or Styles: Quickly jump to the CSS style used for your
HTML or to links, and go Back to your starting point.
Edit Files Externally: Open your HTML, Image or Stylesheet files with an
external editor and Sigil will update your book as soon as you save in the
other application.
Clips: Store and share common text or formatting. Edit and group clips,
apply starting and ending tags to text, and quickly access clips using right-
click in Book View or Code View editors.
Reports: See details about your files, images, styles - including word
counts and file and image sizes.
Preferences: Customize Sigil even more by changing Sigil's fonts and level
of automatic source cleanup.
Link Stylesheets: Quickly link and unlink stylesheets to your HTML files.
Validate CSS Stylesheets: Check your stylesheet pages using the W3C
web service with a simple click.
Edit Headings In Generate TOC: Change the title and the level of any
heading entry when using Generate TOC for quick corrections. Use the
tooltips to see the actual HTML code for your heading.
Find & Replace: Use the new Replace button to replace without moving to
the next match, or the new options to make using regex easier (click on the
chevron icon on the lower left of Find & Replace to hide/show options).
Save a copy of your EPUB (without renaming your current file), or save
individual files from your EPUB.
Easily insert closing tags with Ctrl+., or delete selected tags and attributes in
Code View with Ctrl+Space
Quickly see the HTML code of selected text in Book View using
Format→Show Tag.
Hold the Ctrl key while clicking Find/Replace/etc. (in Find & Replace or
Saved Searches) to temporarily use Current File.
Hold the Ctrl key while clicking a Special Character to close the dialog
after inserting the character.
Hold the Ctrl key while pasting a Clip and it will cut the tags in the selected
text before applying the Clip.
Toggle between Book View and Code view using F2 or double-clicking the
tab header.
Split all files with a split marker not just the current one.
Sigil will now restart in whichever view you were using when it was last
closed.
All third party software has been updated to their current versions,
including Qt 4.8.3.
And numerous other tweaks and polishing to make Sigil easier and more
fun to use.
Preview View has replaced Split View since it was a major cause of issues with older versions.
Clean Source is set to Pretty Print when you use Sigil for the first time, but can be changed to Off
or HTML Tidy in Preferences.
Replace can only be done in Code View since it was not reliable in Book View.
Preferences and dictionaries have moved to a new location so you may need to reconfigure your
preferences or copy your dictionaries.
XPGT files are no longer supported and are treated as any other unknown file type.
For a detailed list of the changes made to the code, see the software Changelog.
All of the new features, along with all of the original features and functionality
are of course described in this User Guide.
ABOUT SIGIL
S
igil was designed to make it easy to create great ebooks using the EPUB 2
format. If you are formatting books for your own use, or you are a
professional editor publishing books on multiple platforms, then Sigil is
for you. You can use Sigil to format and package your books into an EPUB that
looks exactly the way you want it to using an advanced set of features to make it
easier. Its features have made Sigil one of most popular EPUB editors available.
This open-source and completely free software is written and supported entirely
by volunteers. The Sigil development team includes John Schember (the lead
developer and maintainer of Sigil), Grant Drake and Dave Heiland. Sigil was
originally created by Strahinja Markovic in 2009 and remains completely free to
download and use. Support is also provided by other volunteers who contribute
code, translations and helpful answers to user's questions. See the Help→About
menu in Sigil for a complete list of contributors.
You can download the EPUB version from the Sigil website and view it in Sigil to see an example
of an EPUB ebook.
ABOUT EPUB
The EPUB (electronic publication) format is one of the most popular file formats
for ebooks. It is an open and freely available format that can be used by anyone.
An EPUB ebook is simply a file containing several other files stored together
using the common zip format. These files include your words, images, Table of
Contents, stylesheets, fonts and details about your book like author or title.
EPUB's standard format means your book can be read on many ereaders or
converted easily to other ereaders not using EPUB.
Your words and text are actually stored in the EPUB book using the HTML
format (Hyper Text Markup Language – the same code used by web pages to
display text and images). This just means that the files contain your text along
with markup codes and tags (like <h1> or <p>) which tell ereaders how to format
and display the text – some words could be bold or italic, others could be a
paragraph or a heading, etc.
In addition to HTML tags to control or style the layout, EPUB books typically
make use of stylesheets to help organize the use of styles used by the HTML
files. A stylesheet is another file in the EPUB that contains a list of HTML tags
along with instructions on how to display any text using that tag, e.g. <h1>
(heading level 1) should be larger and centered. This allows you to separate the
content of your book from its layout and allows you to easily adjust the look of
the EPUB.
Of course, when anyone actually reads an EPUB they don’t see all these HTML
files or stylesheets. The ereader just displays the text and images like a normal
book as close as it can to the formatting you defined, even if there are thousands
of pages or files.
You don't have to understand all the details of the EPUB format or understand
HTML formatting codes to start using Sigil. However, if you spend any time
with Sigil you will soon need to become familiar with these areas in order to get
the most out of the advanced features of Sigil, and, ultimately, to achieve the
design you want.
Text files are actually stored in XHTML format (an XML compliant version of HTML), but to
make the guide easer to read we'll use HTML to refer to either HTML or XHTML.
To learn more about HTML you can read various online guides, including:
Help with on the EPUB format is available from EPUB users at MobileRead:
If you really want to dig into the details of the official EPUB standard on which
Sigil is built you can read the original technical specifications:
A great way to learn about EPUB is to find an EPUB ebook that is formatted how you like, load it
into Sigil and look at it.
INSTALLATION
— DOWNLOADING SIGIL —
You can download the latest version of Sigil from the official Sigil web site and
install it for your OS.
WINDOWS
Sigil can run on Windows XP, Vista, or Windows 7.
Download the version that matches your version of Windows. If you are not
certain which version of Windows you are running, use the 32 bit version:
32 bit: Sigil-0.6.0-Windows-Setup.exe
64 bit: Sigil-0.6.0-Windows-x64-Setup.exe
If you get a message about Sigil not being “a valid Win32 application”, you
downloaded the 64 bit version by mistake and should download the 32 bit
version.
MAC
Sigil only runs on MAC OS 10.7 (Mountain Lion) x64 bit or higher.
Sigil-0.6.0-Mac-Package.dmg
LINUX
A binary version of Sigil is no longer provided due to the number of versions of
Linux.
However, you can always build from source for your version of linux. And due
to the effort of many volunteers, there is most likely a pre-packaged version of
Sigil built for your Linux distribution available online:
You can also read the Tutorials section for step-by-step instructions on common
tasks in Sigil, and then refer back here for additional details.
EDITING
You can edit your book using either Book View or Code View. The Book View
editor is a WYSIWYG editor which displays your book as it might appear to
users and is useful when you need to make basic changes. The Code View editor
allows you to directly edit the HTML formatting of your files when you want
complete control over your book or you want to use Sigil's advanced features.
MANAGING FILES
The Book Browser organizes all the files in your EPUB by type and gives you
quick access to open files or to modify them. Double-click a file to open it in the
editing window, or right-click on selected files to see options for renaming,
deleting, merging, adding, linking stylesheets, etc. The HTML files are listed in
the order they appear in your book – and you can drag and drop them to reorder
them.
TABLE OF CONTENTS
The Table of Contents (TOC) window shows you exactly what your TOC will
look like, and allows you to jump to specific chapters by clicking on chapter
names. You can also generate a new TOC based on headings in your book at any
time, and create an HTML version of your TOC.
PREFERENCES
Many settings in Sigil can be customised in the Preferences window. In
particular you can set Sigil's user interface language, keyboard shortcuts, text
appearance and dictionaries.
VALIDATION
Sigil includes the FlightCrew EPUB validator to check if your book conforms to
EPUB standards, and it provides easy access to validate your CSS Stylesheets
with the online W3C CSS validation service. Sigil also ensures that your code is
valid XHTML when it is loaded, and can also automatically clean or format your
code using HTML Tidy.
ADVANCED TOOLS
Sigil has a number of custom tools to assist with creating your ebook - including
Saved Searches to save your Find & Replace searches, Clips to save text, and
Spellchecking with customizable dictionaries. Reports can also be generated to
display details about your files and styles, unused images and styles can be
removed automatically, and you can jump directly to styles used by HTML code.
LANGUAGE SUPPORT
Sigil has been translated into over 15 languages and makes it easy to change the
user interface language as needed. It is written in C++ for high performance and
includes full Unicode UTF-16 support.
USER INTERFACE
— WINDOWS, MENUS AND TOOLBARS —
Windows: Displays for information like Book View and Book Browser.
Main Menu: Lists most of the available commands, like File→Open.
Toolbar Buttons: Quick access to many menu items from movable
toolbars.
Keyboard Shortcuts: Easy access to all menu items, like Ctrl+S to save
your file.
Context Menus: Commands shown when you right click on something,
like a filename or window.
The screenshots in the User Guide may be slightly different to what you see on your computer.
WINDOWS
Sigil uses various windows in the main interface to present information: a
window to show your files, to edit your book, to view your table of contents, etc.
Certain windows can be moved or hidden. For example, you can move the Table
of Contents to the top and you can even undock (separate them from the main
Sigil window) some windows like the Book Browser:
To move, dock or undock a window double click on the heading of the window.
You can also click on the header label and drag it to its new location, and in
some OS's you can also undock and re-dock the windows by clicking on the little
button in the top right corner of the window.
You can even create tabbed windows, e.g. drag the Book Browser and drop it on
the Table of Contents.
KEYBOARD SHORTCUTS
Keyboard shortcuts (e.g. Ctrl+S for Save) are shown next to menu entries and in
Edit→Preferences: Keyboard Shortcuts.
MAIN MENU
This is the list of menu items that is always at the top of Sigil's window or your
screen:
File
Add:
Existing Files: add HTML files, images, etc. from your computer
Quit: exit Sigil, asking if you want to save your file first if it hasn't been
saved
Edit
Change Case:
Lowercase: change the selected text to lowercase
Uppercase: change the selected text to uppercase
Propercase: change the first letter of each word to uppercase
Capitalize: change the first letter of the selection to uppercase
Split at Cursor: split the current file into two files immediately
Split at Markers: split all files at previously inserted chapter markers
Insert
Insert
Closing Tag: in Code View insert a tag to close the last unclosed tag
Format
Heading:
Normal: format the paragraph as normal text
Heading 1: format the paragraph as a level 1 heading
Heading 2: format the paragraph as a level 2 heading
Heading 3: format the paragraph as a level 3 heading
Heading 4: format the paragraph as a level 4 heading
Heading 5: format the paragraph as a level 5 heading
Heading 6: format the paragraph as a level 6 heading
Align Left: align text to the left margin (use remove formatting to reset to
default)
Center: align text centered on the screen
Align Right: align text to the right margin
Justify: align text to left and right margins
Text Direction LTR: set the direction of text from left to right
Text Direction RTL: set the direction of text from right to left
Text Direction Default: set the direction of the text to the default
Show tag: while in Book View show the HTML tag for the current location
Remove Formatting: remove some style formatting in Book View, delete
tags in Code View
Search
Count All: count every matching text according to the Find & Replace
settings
Current File:
Find Next In File: Find only in the current file regardless of F&R
mode
Count All In File: Count All only in the current file regardless of
F&R mode
Go To Link Or Style: go to the selected link or go to the CSS style for this
tag
Go Back To Link Or Style: go back to where you clicked a link or used
Go to Link or Style
Go To Line: jump to a specific line number in Code View
Tools
Add To Index Editor: add the selected text to the Index Editor list
Mark For Index: add the selected text to the index when it is created
Reports: Display various details about HTML files, images, CSS styles,
etc.
Delete Unused Image Files: remove unlinked images from your book
View
Toolbars
File: show or hide the open and save buttons
Edit: show or hide the undo and cut buttons
View: show or hide the Book and Code view buttons
Insert: show or hide the insert chapter and image buttons
Back: show or hide the Back button
Donate: show or hide the Donate button
Tools: show or hide the Tools buttons
Heading: show or hide the heading buttons
Format: show or hide the bold and formatting buttons
Align: show or hide the text alignment buttons
List: show or hide the numbered list buttons
Indent: show or hide the indent buttons
Change Case: show or hide the change case buttons
Text Direction: show or hide the text direction buttons (off by
default)
Zoom In: increase the size of text and images in the view
Zoom Out: decrease the size of text and images in the view
Zoom Reset: reset the window zoom to 100%
Window
Previous File: open the file above the selected file in the Book Browser
Next File: open the file below the selected file in the Book Browser
Help
MAIN TOOLBAR
The main toolbar contains buttons used for shortcuts to Sigil's main features:
To move buttons, click and hold on the small bar to the left of each button group then drag it to
where you want it.
Right click on the toolbar to easily select which buttons or windows to show.
The buttons are listed below, with their equivalent menu entry:
New: File→New
Open: File→Open
Add Existing Files: File→Add→Existing Files
Save: File→Save
Undo: Edit→Undo
Redo: Edit→Redo
Cut: Edit→Cut
Copy: Edit→Copy
Paste: Edit→Paste
Donate: Help→Donate
FORMATTING TOOLBAR
The formatting toolbar contains buttons used mostly for formatting text. This is
the default toolbar:
The icons are listed below with their equivalent menu entry:
Heading 1: Format→Heading→Heading 1
Heading 2: Format→Heading→Heading 2
Heading 3: Format→Heading→Heading 3
Heading 4: Format→Heading→Heading 4
Heading 5: Format→Heading→Heading 5
Heading 6: Format→Heading→Heading 6
Normal: Format→Heading→Normal
Bold: Format→Bold
Italic: Format→Italic
Underline: Format→Underline
Strikethrough: Format→Strikethrough
Subscript: Format→Subscript
Superscript: Format→Superscript
Lowercase: Format→Lowercase
Uppercase: Format→Uppercase
Propercase: Format→Propercase
Capitalize: Format→Capitalize
Text direction is not visible by default. Use View→Toolbars to hide/unhide button groups.
CONTEXT MENUS
Context Menus are menus that appear when you right-click on text, a label, a
window, a tab, a header, a text box, etc. – like a file name in the Book Browser,
selected text in Code View, or an image in Book View. Context menu items are
discussed in related chapters:
When in doubt, right-click on something to see if there are additional actions available!
ZOOM
On the lower right of the main window is a zoom control that lets you shrink or
The 100% indicates the zoom level of the view and this percentage will increase
or decrease when you click on the + or – icons.
STATUS BAR
The bottom area on the main window (to the left of the zoom control) will
occasionally list status information when an action is completed.
The status bar can also show information about the currently opened file, such as
Line and Column in Code View:
TOOLTIPS
Many of the buttons, dropdown boxes, labels and fields have tooltips that
provide information on how they are used.
To see a tooltip just hover your mouse over the button or other item and the help
There are many tooltips available in Sigil — most dialogs and buttons will provide some help text.
PREFERENCES
— CUSTOMIZE SIGIL —
The Preferences dialog gives you control over several settings in Sigil.
You can change the following settings (see below for details):
Appearance
Clean Source
Keyboard Shortcuts
Language
Spellcheck Dictionaries
Once the Preferences window is open you can choose the area you want to
modify by clicking on the entry on the left. Select OK (or close the window) to
save the current settings.
APPEARANCE
You can modify the fonts and colors that Sigil uses to display your book while
editing:
Book View / Preview View: You can independently set the font
family/size for serif fonts and san-serif fonts.
CSS / Code View: These settings control the font family/size for both
HTML files in Code View and CSS files. You can also set the color used
for highlighting text.
Insert Special Characters: You can set the font family/size of characters
in the Special Characters dialog.
CLEAN SOURCE
You can set the level of automatic cleaning that is performed on your EPUB
HTML source code:
Sigil can automatically clean your HTML code when you save by using the
included HTML Tidy software. This does not correct any errors but attempts to
normalize your code by adjusting spacing or consolidating styles.
Cleaning source is only done when you save your book or do a Replace All, so save often and
reload to see any changes done for cleaning.
Off: HTML Tidy will not be used. No automatic cleaning of code will be
done – your code will be left formatted exactly the way you typed it.
Pretty Print: HTML Tidy will be used to remove any unnecessary spaces
or blank lines in your code and will indent HTML tags to make it easier to
read the code. No code will be changed – only spacing.
Tidy: HTML Tidy will be used to clean your code – this will include pretty
printing plus converting some of your tags into styles and some of your
styles into an internal stylesheet. It is possible under rare circumstances that
Tidy will clean too much and delete text, so you may want to carefully
consider using this option.
When set to HTML Tidy, cleaning will often convert tags or style attributes you
have applied into a style tag and create a class name for the style (see the
Stylesheets chapter for more information). If this has happened you will see the
new styles at the top of your file, e.g.
<style type="text/css">
/*<![CDATA[*/
/*]]>*/
</style>
This is a perfectly valid stylesheet (the sgc stands for Sigil class), although if you
prefer to keep your tags exactly as typed, or use external stylesheets to manage
your styles as most people do, you may want to set Clean Source to the Pretty
Print option to prevent the conversion of styles to internal stylesheets.
Sigil will attempt to correct errors in your code when you open an EPUB or HTML file - this is not
affected by the Clean Source setting.
KEYBOARD SHORTCUTS
You can view all the keyboard shortcuts assigned to functions in Sigil – and
change them to what you prefer. So if you want F12 to always open Find &
Replace then you can change it here.
Use the Filter text box to easily find keys or descriptions that contain letters you
type.
LANGUAGE
You can set the language of Sigil's interface and the default language of your
book:
You can select from the available languages using this option. If a translation is
not available for specific words then they will be shown in English.
You must restart Sigil in order for the new user interface language to take effect.
Try setting the interface to another language and restarting Sigil to see the translations volunteers
have created.
This option sets the language that will be selected in the Metadata Editor for new
books or books that do not already have a language set.
SPELLCHECK DICTIONARIES
SPELLCHECK DICTIONARIES
Sigil supports spell checking in Code View, and allows you to choose from
standard or personal dictionaries:
STANDARD DICTIONARIES
To add other standard dictionaries, such as ones found at the OpenOffice Dictionaries site,
download, extract, and copy the files, e.g. en_GB.aff, en_GB.dic, hyph_en_GB.dic to the
"hunspell_dictionaries" directory location and restart Sigil.
USER DICTIONARIES
Sigil creates a "default" user dictionary for you. But you can also create your
own personal dictionaries, and even use different ones for different books.
To create a new user dictionary, select Add under User Dictionary on the left
and then enter a name for your new word list:
You can choose which User Dictionary is in use. When you select a user
dictionary on the left, you will see the words for that dictionary on the right and
can then add, edit, or remove them.
Whenever you use Add to Dictionary in Code View, your selected word will be added to the
currently selected User Dictionary.
Windows:
...\Local Settings\Application Data\sigil-ebook\sigil
MAC:
~/Library/Application\ Support/sigil-ebook/sigil/
inux:
$HOME/.local/share/data/sigil-ebook/sigil
Sigil supports opening EPUB files and reading HTML files. However, Sigil only
saves books in the EPUB format: the EPUB file will contain all of your HTML
files, images, stylesheets, fonts, etc. zipped up into one file.
OPEN FILES
To open a file, click the button , or select the menu item File→Open or its
keyboard shortcut then choose the file you want to open:
EPUB Files
HTML Files
The file and and linked images and stylesheets are imported if possible and
placed into the appropriate folders.
The metadata in the HTML file will be loaded into the metadata for the
book.
If the file is not valid xhtml it will be updated to make it valid if possible.
Depending on your preferences, Sigil will format or clean the files.
ADD FILES
Add files to your EPUB by clicking the button , selecting the menu item
File→Add→Existing Files, or right-clicking on a file in the Book Browser and
choose Add Existing Files:
HTML Files
Metadata is not loaded from the file (unlike when you use Open).
Sigil will attempt to load images that are referenced.
Files will be placed into their appropriate folder.
Image Files
Stylesheet Files
Font Files
Other Files
All other files will be placed in the Misc folder as they are not usually used
in an EPUB, although certain text files in the Misc folder can be edited in
Sigil.
Sigil cannot read EPUB files or documents that are very badly formatted or non-standard. You may
need to open the EPUB (using a standard zip program like WinZip or 7Zip) and correct the errors
before reloading it into Sigil.
ADD BLANK FILES
You can also create new empty files in Sigil. Select the menu item File->Add and
choose from blank HTML page, blank CSS stylesheet, or blank SVG image (a
special image format). You can also do this using this Book Browser.
If you edit any text in your document, an asterisk ( * ) is added to the file's name in the titlebar.
When you save your book Sigil will check it for errors and warn you if you need
to fix anything.
Sigil will not save a corrupt EPUB, so frequent saves will make it easier to
recover from any unexpected errors. Sigil will also clean your source code
according to your preferences when saving the file.
Your saved EPUB file contains all the files that make up your book - your text, images, stylesheets,
embedded fonts, table of contents, metadata, etc.
SAVE A COPY
You can select File→Save A Copy to save a copy of your EPUB to a different
filename. The difference between Save or Save As is that the current file you are
working on is not renamed. So you can use this feature to save file without
changing the name of your file or the directory you save files to.
You can use Save A Copy for quick backups.
Book View (or WYSIWYG mode – what you see is what you get) is one of two
ways you can edit your book in Sigil. Book View is how most people edit their
book when they start to use Sigil since it is the closest to a standard word
processor. Its a good way to make basic changes to your book when you aren't
too concerned about the underlying HTML code. However, when you want more
control over the format of your EPUB or to use Sigil's advanced features then
you can use Code View.
Switch to Book View by clicking the button , selecting the menu item
View→Book View or its keyboard shortcut:
You can toggle between Book View and Code View by using the keyboard shortcut F2 or by
double-clicking on the current tab's name.
When you apply formatting in Book View, Sigil will do its best to apply the
formatting you intended. However, in some cases it may not look exactly as you
want. You can undo the change, and then try to re-format the text. But if you
want to make sure the formatting is exactly the way you want it is probably
necessary to use Code View to adjust the formatting. You can switch between
Book View and Code View at any time since they are just two views of the same
page. Your current paragraph position will be remembered.
Certain features in Sigil are only available in Code View. For instance
Spellchecking and the Search Editor can only be used in Code View, and Find &
Spellchecking and the Search Editor can only be used in Code View, and Find &
Replace will automatically switch you to Code View if you try to replace text, or
do a find across all HTML files.
Book View is only an approximation of what your book will look like - you need to test your book
on your target ereaders.
FORMATTING
All of the buttons in the formatting toolbar are available for you to use.
CONTEXT MENU
The Book View context menus includes a number of useful features.
Open Tab For "imagename": open the image tab for the image
Open With: open the image in an External Editor
Save As: save the image to a selected location on your computer
Undo
Redo
Cut
Copy
Paste
Select All
CODE VIEW
— DIRECT HTML EDITING —
Code View allows you to directly edit the HTML code included in your EPUB
and is the most common way to edit files for advanced users.
Switch to Code View by clicking the button , or selecting the menu item
View→Code View or its keyboard shortcut:
You can toggle between Book View and Code View by using the keyboard shortcut F2 or by
double-clicking on the current tab's name.
Code View is very powerful, but you must be careful when editing it to ensure
you enter valid HTML code.
When switching from Code View to Book View or saving your file, Sigil will check if your code
has any major errors. If there are any errors you will be prompted to correct them Manually or
Automatically. You should usually choose Manually to fix the issue to avoid any chance of the
Automatic correction deleting text.
You can change the colors used for highligting in Code View using Preferences.
FORMATTING
Most of the toolbar buttons for formatting are available for use.
CONTEXT MENU
Right click on text to see a context menu which includes the following options:
Undo
Redo
Cut
Copy
Paste
Delete
Select All
PREVIEW VIEW
— TEST LINKS AND STYLES —
Preview View is a read-only view of your HTML files that allows you inspect
your code and styles together. It is typically used only when investigating
unusual style issues.
Switch to Preview View by clicking the button , or selecting the menu item
View→Preview View or its keyboard shortcut:
The dividing bar between the preview and inspector areas can be dragged to resize the areas. You
can even drag it to the very bottom to hide the inspector area.
PREVIEW AREA
The window at the top shows your book as it will appear to readers, exactly the
same as the Book View except that you cannot edit the text. Any changes you
make in this view will not be saved.
INSPECTOR AREA
This is an HTML developer's tool that allows detailed examination of the code
behind the book's appearance. It is intended to allow you to see why specific
sections of your book are displayed the way they are, and to make temporary
changes to styles and text to see how they affect your text.
Any changes you make in the Inspector area are only temporary and are not saved!
The Inspector is basically the Chrome web developer toolset and you can find
more information about it from their documentation. Not all the information
applies to Sigil since the software is meant for general web page inspection.
Scroll down to the Developer Window section to see what functions are
available:
The typical use of the Inspector is to click on the magnifying glass at the bottom
of the Inspector then scroll the preview area to the text of your book that you
want to inspect and click on it. The inspector pane will scroll to the related
section of code, allowing you to view various details about the text.
You can then make modifications to the styles used by the text to test out
changes. Changes to styles are reflected immediately in the Preview area, but if
you edit any text you may need to click in the Preview area to refresh it. You can
you edit any text you may need to click in the Preview area to refresh it. You can
then edit your CSS stylesheets to include any changes you decide to keep.
If you click on an area in the inspector area, the preview area will not sync as you might expect.
BOOK BROWSER
— MANAGING FILES IN YOUR EPUB—
All of the files that make up your EPUB can be accessed by the Book Browser.
Your text files, images, as well as any fonts or stylesheets, are organized into
folders allowing easy access to open them, or to right-click on them to perform
actions.
The Book Browser is usually open, but you can open it by selecting the menu
item View→Book Browser:
Double-clicking a file will open it in a tab in the editing window.
To open a file just double-click the file name. If the file was not already open in
a tab, a new tab will be created for it. If it was already open in a tab the view will
switch to the tab containing the file.
If you change tabs, the Book Browser will select the file used by the tab.
You can only select multiple items within the same folder.
RE-ORDERING FILES
The order of the files in the Text folder is important since it is the order in which
the files will be displayed to readers.
You can drag a file in the Text folder and move it up or down if you need to re-
arrange the order in which the chapters or files appear in your book.
arrange the order in which the chapters or files appear in your book.
You can also use the context menu to rename or re-sort the files.
All other folders are automatically sorted alphabetically and cannot be re-
arranged — the order of their files does not affect how your book is displayed.
CONTEXT MENU
Right-clicking on one or more items in the Book Browser brings up a context
menu with relevant actions:
Remember to update the TOC if your file was included in the Table of Contents.
RENAME
If you select a single file to rename, then the name of the file is highlighted so
that you can type in its new name. By default the extension is not highlighted to
make renaming easier, but you can also change the extension if necessary.
If you select multiple files, then a new dialog is displayed asking you how you
want to rename the files. Enter the name the first file should have, including
numbers at the end of the name. Sigil will then name each of your files
sequentially using the name you provided and starting at the number you
provided. A file will not be renamed if a file already exists with the new name.
For example:
Chapter 1
will rename the files to: Chapter 1, Chapter 2, Chapter 3 ...
Section_0099
will rename the files to: Section_0099, Section 0100, Section_0101 ...
Part 2 - Section 08
will rename the files to: Part 2 - Section 08, Part 2 - Section 09, Part 2 - Section 10 ...
When you rename a file any links pointing to the file in your EPUB will be updated.
MERGE
If you select a single HTML file, then the file will be merged into the previous
HTML file in the list.
If you select multiple HTML files, then all files will be merged into the first
HTML file you selected.
You can also use the Merge keyboard shortcut. See the Splitting and Merging
chapter for more details.
SORT
Sort the selected HTML files alpha-numerically. This means filenames
containing numbers will be sorted in their expected numerical order, e.g. “1 3 2
10” will be resorted as “1 2 3 10” instead of the default “1 10 2 3”.
LINK STYLESHEETS
For HTML files.
Link Stylesheets to the selected files. Choose the stylesheets to link from the
dialog window – only stylesheets marked with a checkmark will be linked,
others will be unlinked from the HTML file.
When the dialog is first opened a checkmark is shown against stylesheets only if all selected files
are linked to that stylesheet.
Stylesheets are applied in the order listed when the document is rendered.
ADD SEMANTICS
For HTML and Image files.
This sub-menu allows you to designate the semantic 'type' for selected files.
EPUB ereaders may use this information (stored in the content.opf file) to guide
them in how to present these files to readers.
For Image files, the only option is “Cover” – to indicate that this image is the
cover image of the book.
For HTML files you can select from any of the following options – but each file
can have only one type:
Cover
TitlePage
Table Of Contents
Index
Glossary
Acknowledgements
Bibliography
Colophon
Copyright Page
Dedication
Epigraph
Foreword
List Of Illustrations
List Of Tables
Notes
Preface
Text
Text should indicate the page of the book that should be shown when the book is first opened, but
not all ereaders follow this convention.
OPEN WITH
Opens a dialog window to allow you to choose an external application to edit
this file..
SAVE AS
Opens a dialog window to allow you to choose one or more files from your
computer to add to your EPUB.
Files will be added to the appropriate folder based on their file extension
regardless of what file you right-clicked on.
This is the same as the main menu option File→New→Add Existing File(s)
ADD BLANK SECTION/STYLESHEET/SVG IMAGE
Adds a blank HTML document, CSS Stylesheet, or SVG Image file to the folder.
For HTML it will add just below the file you right-clicked on, or at the bottom
of the folder if you right-clicked on the folder name. For others it will add them
in alphabetical order.
The new file will be numbered with the lowest available number starting from
001 (e.g. Section001.html).
ADD COPY
Creates a copy of the file you clicked on and adds it to the folder.
Files will be added to the appropriate folder based on their file extension
regardless of what file you right-clicked on.
This is the same as the main menu option File→Add→Existing Files and the Add
Existing toolbar button.
SELECT ALL
A quick way to select all of the files in the current folder so you can rename,
link, etc. all of them at once.
FONT OBFUSCATION
For Font files.
If you are using custom fonts in your ebook, then this sub-menu allows you to
define how the embedded fonts are stored in the EPUB. Normally when fonts are
added to the EPUB the fonts are stored in a readable form. In some cases you
may not want to make the fonts available for the readers to access directly. In
these cases you can obfuscate or scramble the fonts in the ebook so that readers
cannot access the fonts, but the fonts will still be useable by EPUB ereaders. The
details of obfuscation and its implications are beyond the scope of Sigil, but
there are many references to it on the web.
None
Use Adobe’s Method
Use IDPF’s Method
The method will have a checkmark next to it if all selected fonts use that
method.
Any navList or pageList items in the file are not saved – only the Table of
Contents entries are saved after renumbering.
TABLE OF CONTENTS (TOC)
— A MAP OF YOUR BOOK —
You can single-click on an entry to jump to its location in the book, and expand
or collapse entries by clicking on the arrow icons to the left of the chapter names
or collapse entries by clicking on the arrow icons to the left of the chapter names
if there are sub-chapters.
Use the right-click context menu to select Collapse All or Expand All to quickly show or hide
sub-chapters.
An EPUB Table of Contents is stored in the toc.ncx file, which is accessible in the
Book Browser. You can edit this information manually, but Sigil provides a way
to generate its contents automatically.
CREATE HEADINGS
In order to create a Table of Contents automatically you first need to define the
headings or chapters in your book.
In Book View you can create the your headings by selecting the text you want to
make into a heading, and then selecting the level of the heading you want from
the Format→Heading menu, or more easily using the buttons on the toolbar, in
If your chapter names do not use heading tags (h1, h2, etc.) as described above, then you will not
be able to generate a TOC automatically.
You can use the Show TOC Items Only checkbox to show or hide entries that will
not be included in the TOC. This does not affect your TOC, only what you see in
the dialog. You can also use the Select headings to include in TOC drop-down
menu to quickly select or unselect headings of a certain type, and then fine tune
the selections manually.
You can rename the TOC entry by clicking Rename . This will also change your
HTML code to set the "title" attribute of your heading.
You can change the level of your Headings using the left and right arrow keys.
This will also change the level of the headings in your HTML code.
The tooltip for each title (just move your mouse over the title and leave it for a few seconds) will
show you which file the heading is in and its HTML code.
When you select OK , Sigil will add or update automatically generated IDs to
any headings you have selected if they don't have them. It will then create a new
toc.ncx file containing links to your chapters. If your heading is "near" the
beginning of your HTML file, Sigil will link directly to the file and not to the
heading ID. This is because on some ereaders linking directly to an element
slows down the display of the TOC.
Generating the TOC automatically will overwrite any existing TOC in the toc.ncx file.
An inline TOC is just another HTML page in the EPUB that contains the Table
of Contents in text format.
For most EPUB ereaders, the TOC that is automatically generated from
Generate Table Of Contents or stored in toc.ncx is used to display the TOC.
However, there are times when an inline TOC is desired in an EPUB or when it
is needed because the EPUB will be converted to another ebook format that does
not use the TOC file.
If you are creating an EPUB you should leave out the inline HTML TOC file unless you have a
clear reason to include it. If you need a TOC for a specific format you are converting to then you
can include it just for that conversion.
The Generate Inline HTML TOC button will create a linked table of contents and
overwrite any existing HTML TOC file (if it has a semantic type of TOC). If no
such file exists it will create an HTML file called TOC.html and mark its semantic
type as TOC. If TOC.html already exists it will be replaced.
You can change the style of the inline TOC once you've created it – but remember to do this each
time you create the TOC.
METADATA
— EDIT DETAILS ABOUT YOUR BOOK — THE METADATA EDITOR ALLOWS YOU TO ADD OR EDIT
DETAILS ABOUT YOUR BOOK – LIKE AUTHOR, TITLE AND LANGUAGE, AS WELL AS HUNDREDS OF
OTHER ENTRIES DEFINED BY THE EPUB STANDARD.
Edit your book details by clicking the button , or selecting the menu item
Edit→Metadata Editor or its keyboard shortcut:
All of the details about the book (called metadata) are stored in the contents.opf
file in the EPUB. You can edit this information manually, but the Metadata
Editor allows you to edit it more easily.
REQUIRED DETAILS
The Metadata Editor shows the 3 fields required for an EPUB at the top – you
must fill these in in order to create a valid EPUB:
If you write a person's name as Lastname, Firstname then Sigil will automatically add it as
Lastname, Firstname for filing purposes, and also add it as Firstname Lastname which is what
is usually displayed to readers.
You can list several authors of a book by separating the names with a semicolon, e.g. Smith, John;
Doe, Jane (they will appear in the table at the bottom of the Metadata window once you save and
re-open the Metadata Editor).
OPTIONAL DETAILS
You can add optional details using the Add Basic or Add Role buttons. These
will be added to the table below the required fields. The table allows you to
provide the following values for each entry:
The Add Basic metadata items include about 30 items such as:
Date: Publication
Date: Creation
Date (custom): you can enter your own date type in the "File As" column
Identifier: ISBN
Identifier (custom): you can enter your own identifier type in the "File As"
column
Rights: copyright information such as Copyright 2012 An Author
The Add Role metadata contains hundreds of possible activities that people may
have performed in the creation of this book such as Authors, Editor, Proofreader,
etc.:
You can add the same type of field multiple times.
You can copy an entry by selecting it and clicking the Copy button. You can then modify it as
needed.
You can re-arrange the order of the entries (which may affect how ereaders display the
information) by selecting the entries and clicking on the Up or Down buttons.
VALIDATION
— MAKING SURE YOUR EPUB IS ERROR FREE —
In order to be considered a valid EPUB, your ebook must meet the standards
defined for EPUBs. This means it must include certain files and information and
not contain any errors as defined by the EPUB specification. To help you check
if your EPUB is valid you can use the following tools.
FLIGHTCREW
Validate your EPUB with FlightCrew by clicking the button , or selecting the
menu item Tools→Validate EPUB With FlightCrew:
FlightCrew is included as part of Sigil so it will open a new window listing any
issues that it finds. Once you have run Validate to produce a report, look at each
of the issues listed and then edit your document to correct them.
You can double-click on most entries to be taken to the relevant part of the book.
You should validate your document each time you change it to verify there are
no more errors.
This resource is present in the OPF <manifest>, but it's not reachable (it's unused).
This warning means you have included the listed file in your EPUB,
but you have not used it anywhere in your book. If you intended to use
it, you should link to it, otherwise you can delete the file. Try to search
all your files or toc.ncx for the filename — you should leave off the
pathname when searching, e.g. if the error is in Text/Chapter1.html then
just search for Chapter1.html
This OPS document is reachable but not present in the OPF <manifest or spine>.
"Reachable" means that a reference of some kind that points to this resource exists in the
epub.
This error means you have a reference or a link to a file or image in
your EPUB, but that file is not included in the EPUB. You need to add
the file to the EPUB or correct the name of the file used in your text.
You can usually find these by searching for the filename listed in all
the HTML files. You may also have to re-generate or update your
TOC.
ID value 'SOMEIDNAME' is not unique
This error means you have an ID named SOMEIDNAME in your
EPUB that is defined more than once. Typically these are in headers or
footnotes and can be caused by copying and pasting or merging. You
can find these by searching all HTML files for the ID name that is
listed and changing them so all IDs are different from all other IDs. If
the issue is in a heading and you have auto-generated your headings,
you can delete the ID and they will be re-generated the next time you
create your TOC.
attribute 'INVALIDATTRIBUTE' is not declared for element 'SOMEELEMENT'
This error means you have an HTML tag named SOMEELEMENT
that contains an attribute INVALIDATTRIBUTE, but
INVALIDATTRIBUTE is not valid for that tag. For instance <h2
invalidattribute="test">. This can be caused by typos or by old versions of
HTML. You need to search for INVALIDATTRIBUTE in all HTML
files and remove, correct, or replace each occurrence.
no declaration found for element 'INVALIDELEMENT'
This error means you have an HTML tag named INVALIDELEMENT
that has not been defined. Typically this is simply because it is invalid
and is old HTML syntax that need updating. You need to search for
INVALIDELEMENT in all HTML files and remove, correct, or
replace these with valid HTML.
element 'INVALIDELEMENT' is not allowed for content model
'(p|d|h2|h3|h4|h5|h6|div|ul|ol|...'
This error means you have an HTML tag named INVALIDELEMENT
that is not valid HTML for an EPUB. Typically this is old HTML
syntax that needs updating (such as the <center> tag which should be
implemented using a style). You need to search for
INVALIDELEMENT in all HTML files and remove, correct, or
replace each occurrence with valid HTML.
value 'SOMENAME' is invalid NCName
This error means you have an ID name that is invalid. It probably
contains a space or other invalid character. You need to search for
SOMENAME and change it.
W3C VALIDATOR
You can also easily validate your CSS Stylesheet files using the W3C website by
selecting the menu item Tools→Validate Stylesheets With W3C.
This will send the contents of all of your stylesheets to the W3C service which
will produce reports of any issues.
You can validate individual stylesheets by using the context menu on the
stylesheet in the Book Browser.
EPUBCHECK
FlightCrew identifies most issues with EPUBs, but it may not catch everything.
As a final check you should also run your EPUB through the EpubCheck
program. You can use it online or download a local version of the program:
Sigil provides several ways to spell check your book. You can choose a
dictionary to use, and create personal dictionaries with your own words.
CONFIGURE SPELLCHECKING
You can set the spell checking preferences that you want – including which main
dictionary to use, and which custom dictionary to use if any. You can setup user
dictionaries for different types of books or individual books. Then you can
change user dictionaries as necessary.
AUTOMATIC SPELLCHECKING
Code View will highlight any misspelled words with a wavy red underline when
automatic spell checking is enabled using Tools->Spellcheck->Highlight Misspelled
Words:
You can then right-click on the misspelled word to bring up a list of choices:
You can insert any image into your EPUB. However, in order for images to be
used in your book you must add them into the EPUB first. You can then select
from the images in your book and insert them into your pages.
Sigil's Insert Image dialog also allows you to add an image to your EPUB and insert it in one step.
All of these will display a standard file dialog allowing you to select one or more
files from your computer. Select as many images as you want. If any of the
images already exist in the book, you will be prompted to confirm if you want to
replace them.
The images will be added to the Images folder in the Book Browser. However,
they are not yet actually used anywhere in your book – they are just available to
use.
But you can also add images to your book and insert them in one step:
Click on the location in your file where you want the image to be located (in
either Book View or Code View) and then select the menu item Insert→Image
or click the button :
A list of the images in your book is displayed. Select the image or images you
want to insert and click OK , or double-click on the image you want in order to
select it automatically.
You can also right click in your text Book View where you want the image and choose Insert
Image from the context menu.
You can enable thumbnails in the Insert Image Dialog by clicking on the
buttons on the lower left to choose the size of the thumbnails. The dialog
is slower with thumbnails so you can remove them by making them smaller until
they are gone.
You can choose files from your computer instead of from the EPUB by clicking on the Other
Images button. Files will be added to your book and then inserted automatically.
EDITING IMAGES
To edit an image once it is in your EPUB, Sigil allows you to easily edit it in an
external application.
COVER IMAGES
Images for covers are special in that you must tell the EPUB which image should
be used for the cover. Different ereaders use different methods to identify the
cover, so you should use both methods:
Create a cover.html file at the start of your book and then insert your image
into it.
Mark the cover.html file as a cover file by right clicking on it in the Book
Browser Text folder, selecting Add Semantics and choosing Cover.
Mark your actual cover image file as a Cover by right clicking on it's file in
the Book Browser Images folder, selecting Add Semantics and choosing Cover.
Please make sure you have permission to use any images in your book as most images are
copyrighted and their use may require a license.
DELETING IMAGES
You can select the menu item Tools→Delete Unused Image Files to automatically
delete any unused images. Sigil will present you a list of images that do not have
any links to them from your HTML files and then allow you to confirm or cancel
deleting them.
For more control over deleting individual images, you can use a report to view
the number of times an image is used and then delete the ones you want — see
the Reports chapter.
SPECIAL CHARACTERS
— INSERT SPECIAL CHARACTERS —
You can insert characters that might not be on your keyboard into your
document using the Special Characters dialog.
To insert special characters click the button , or select the menu item
Insert→Special Characters.
The dialog will stay open to allow you to insert text multiple times, and you can
move the window to any position on the screen you want.
You can use Ctrl-click to select a character to insert the character and close the
dialog window immediately.
If you pause over a character you will see a tooltip listing the HTML entity code
for the character and a description:
You can change the font and size of the characters in the dialog using Preferences.
SPLITTING AND MERGING
— WORKING WITH CHAPTERS AND FILES —
An EPUB can consist of one large HTML file with all of your text, or multiple
files each containing part of your book. In most EPUBs each main Chapter is
stored in its own HTML file in the EPUB. This isn't required, but it makes it
easier to work with the book and can make reading and editing quicker since the
files are smaller. All of your files can be accessed using the Book Browser.
If you have loaded one HTML file into Sigil and want to divide it into separate
files, then you can use Sigil's Split functions. And if you have several smaller
files that you want to combine into a larger file, then you can use the Merge
function.
Most ereaders start each new HTML file on a new page – giving you automatic page breaks
between chapters if you split your Chapters into separate files.
SPLIT AT CURSOR
Split a file into 2 files immediately by clicking the button or selecting the
menu item Edit→Split At Cursor.
This is the easiest way to split a single file. Simply click in your document
exactly where you want the file to be split, e.g.:
Then use Edit→Split At Cursor:
Everything from the beginning of the original file up to the point where you
clicked is put into one file, and everything after the point you clicked on is put
into a second file. Note that the first file kept its name, and a new file with a new
name was created to hold the second file. You can rename and edit the files as
necessary.
SPLIT AT MARKERS
If you want to split several files or a large file into many files, then you can also
use the file marking approach.
1. Scroll through your file, and wherever you want a new chapter to start click in
the document to set your cursor position. Then select the menu item Insert→Split
Marker. This will insert code into your document telling Sigil to remember that
you want a new chapter to begin here – you will see a horizontal line in Book
View exactly where you inserted the marker:
2. When you have marked all your chapters, use Edit→Split At Markers. This will
automatically split all of your files into as many files as you marked. If you
decide not to split the file, you can delete the horizontal marker lines.
Once you have split your files you rename them. And you can even Merge some
or all of them together again.
If you split a file, any header information is copied to the new file.
MERGING FILES
If you want to combine two or more files into one file, you can use Merge.
To Merge two files, right-click on the second file and then select the menu item
Merge, or select the second file and use the Merge shortcut. The two files will be
combined immediately.
To Merge more than two files, select all the files you want to merge, then right-
click on the selection and choose Merge. You will be prompted to confirm the
merge:
Once you confirm OK, your files will be combined into the first file.
Finding text and updating it is one of the most common tasks in Sigil – to look
for words, to remove unwanted text in one file, or to change the formatting of
specific items in the entire book. In fact, if you ever need to make lots of
changes to your text you will almost certainly want to use Find & Replace in
Code View (and its related Saved Searches feature) since it allows you to
quickly make a large number of edits across all your files.
To open the Find & Replace dialog, select the menu item Search→Find & Replace or
its keyboard shortcut:
Book View only supports finding text in the current file — all other actions will be done in Code
View.
You can set various modes (Normal, Case-Sensitive, Regex, search some or all
HTML files, search down/up, etc.) and options to modify the behavior of the
actions you select (find, replace, replace all, etc.), e.g:
When open, the Find & Replace dialog is always positioned at the bottom of the
editing windows for easy access. You can use the buttons on the lower left to
show or hide Options.
Keyboard shortcuts exist for all find and replace operations – such as Ctrl+G to find again. See the
Search menu for a list of shortcuts.
ACTIONS
The buttons on the right are used to run your search commands.
After you run a search, the text you entered in either the Find or Replace box is saved and is
available for you to select later. Click the down-arrow to the right of the Find (or Replace) text box
to show the list of items in the search histories.
Whenever you run a search, the results are shown in the Find & Replace status bar.
FIND
Finds the next occurrence of your search term and highlights it.
To search for text, enter it in in the Find text box and press the Find button.
Any text in the Replace box is ignored if you are just doing a Find.
If you select text in your document, you can use Ctrl+F to open Find & Replace window and your
selected text will be placed in the Find box.
REPLACE
Replaces are done in Code View so you must first run Find in Code View.
To replace text:
To undo changes you can use the button or right-click in the editing window and select Undo
to change the text back. But if you are replacing across files and your next match is on a different
page, you need to switch back to the file containing the replaced text before selecting undo.
REPLACE/FIND
Replaces one occurrence of the next matched by Find and then runs Find
automatically to highlight the next match.
To replace text, enter the old text in the Find box, and the new text in the
Replace box. Then click Replace/Find .
The first time you do a Replace/Find the first match will be highlighted.
Subsequent use of Replace/Find will replace the highlighted matched text and
then automatically Find the next match.
You can safely use Replace/Find instead of Find if no text is selected since it will act just like Find
until a match is highlighted.
REPLACE ALL
Replaces all text matching your search term with your replace term according to
your settings. This is done all at once automatically.
Test your find and replace strings using Replace a few times before using Replace All to avoid
surprises.
Save your book before a Replace All and check it after the replace in case of issues.
Check if your mode is set for Current File or All HTML Files
COUNT ALL
Count All is initially hidden and can be displayed using the Options button (see
below) — or you can use its keyboard shortcut.
Count All displays a count of the number of times the search term you entered in
the Find text box occurs in the selected files.
Count All always counts down from the start of a file and ignores the Up/Down
direction.
Its a good idea to use Count All before doing a replace to check the number of replacements
are what you expect. And you should run it after a Replace All in case the particular search and
replace created new matches.
NORMAL
This mode will search for exactly what you type except that it will ignore case,
e.g. “A” and “a” will be considered the same letter.
CASE SENSITIVE
REGEX
For instance, you can search for “Page [0-9]+” which will find "Page " followed
by one or more numbers.
See the Regular Expressions chapter for more details about using regex.
You can control which files to search with these options making it easy to search
all or just some of your files.
CURRENT FILE
This restricts your search to just the file you are viewing. You can search HTML
files and Style files.
If your search reaches the end of the file it will automatically wrap around and
search from the other end of the file. You will see a small picture of an arrow
flash on the screen to indicate the search wrapped around.
If you hold the Ctrl key down while clicking on an action you will be able to temporarily run the
search only on the Current File.
This searches in every HTML file. It does not search in every file - just every
HTML file.
When a search reaches the end or beginning of the book it will automatically
move to the next or previous file (in the order listed in the book browser), and it
will loop around when all files have been searched.
This searches only the HTML files that you selected in the Book Browser.
When a search reaches the end of a file it will automatically move to the next or
previous selected file (in the order listed in the book browser), and it will loop
around when all files have been searched.
UP
Searches from your position in the document upwards – finds the previous
occurrence of your search.
DOWN
DOWN
Searches from your position in the document downwards – finds the next
occurrence of your search.
OPTIONS
Find & Replace provides several options when using Regex mode.
Click the button on the Find & Replace window to expand the window to
show the options (and the button Count All ):
The checkbox options shown are only used when you are in Regex mode:
The Saved Searches dialog allows you to save and edit all your common Find &
Replace searches. You can also use it to run your searches.
To open Saved Searches, select the menu item Tools→Saved Searches or its
keyboard shortcut:
All Saved Searches are run by default with mode Regex, All HTML Files, Down.
CONTEXT MENU COMMANDS
Most actions concerning editing searches can be done by using the right-click
context menu.
Select one or more entries then right-click on the selection for the following
options:
Add Entry: add a blank search under the entry you clicked
Add Group: add a new group under the entry you clicked
Import: read a list of exported entries from a file into the list
Reload: restore the list from the last saved state
RUNNING SEARCHES
Saved Searches can be used to run your searches as well as manage them.
All of the Find & Replace actions are available from the Saved Searches
window, and you do not need Find & Replace open to use them.
To run a search, just select an entry and click one of the actions. All result
messages will be displayed in the window and in Find & Replace.
Although all searches are done using the mode All HTML Files by default, you can hold the Ctrl
key down when selecting a search to force the search temporarily in the Current File.
GROUP SEARCHES
You can actually run a group of searches. Each search will be run sequentially.
Simply select a group name and then, for example, run Count All . Or select
several non-group entries and run, for example, Replace All .
SAVE
To save your entries to disk, click Save .
To exit without saving your entries you can just close the window (with the close
button or the Esc key). You can also use the context menu Reload to reload your
entries from disk - which will delete your current entries.
You can use the Export and Import context menu items to save your searches so
that they can be shared with others.
If you save and are running more than one copy of Sigil, then the other instances of Sigil will
automatically reload the newly saved searches to keep all copies in sync.
FILTER
You can use the filter text box to restrict the list of searches shown to make it
easier to find a search.
LOAD SEARCH
Clicking the button Load Search will load the search you have selected into the
Find & Replace box.
Loading does not run the search — it is only a way to populate the fields in Find
& Replace. You can also just right-click in the Find & Replace text boxes and
select a saved search from the context menu to do the same thing.
You do not need to load a search if you are going to run the search from the
Saved Searches dialog.
You can load a search using just the keyboard by using the shortcut to open Saved Search, typing
your search name in the filter box and hitting return (followed by Esc if you want to close the
window).
MOVING ENTRIES
You can move searches or groups around by using the arrow keys or by drag and
drop.
In order to group entries you must first create a group to put them in.
SAVE SEARCHES
While in Find & Replace you can save your search by right clicking in the Find
or Replace text boxes and selecting the menu item Save Search:
LOAD SEARCHES
You can also load saved searches into Find & Replace by right clicking in the
Find or Replace text boxes and selecting the menu item corresponding to your
saved search:
Once you have loaded a search you can change the mode or options before
running it.
CLIPS
— SAVING TEXT —
The Clips dialog allows you to save snippets of text and paste them into your
document at any time. It can also be used to insert HTML tags around your text.
To open Clips, select the menu item Tools→Clips or its keyboard shortcut:
CONTEXT MENU
Most actions concerning editing clips can be done by using the context menu.
Select one or more entries then right-click on the selection for the following
options:
Add Entry: add a blank search under the entry you clicked
Add Group: add a new group under the entry you clicked
Import: read a list of exported entries from a file into the list
Reload: restore the list from the last saved state
SAVE
To save your entries to disk, click Save .
To exit without saving your entries you can just close the window (with the close
button or the Esc key). You can also use the context menu Reload to reload your
entries from disk - which will delete your current entries.
You can use the Export and Import context menu items to save your searches so
that they can be shared with others.
If you save and are running more than one copy of Sigil, then the other instances of Sigil will
automatically reload the newly saved clips to keep all copies in sync.
FILTER
You can use the filter text box to restrict the list of clips shown to make it easier
You can use the filter text box to restrict the list of clips shown to make it easier
to find text.
MOVING ENTRIES
You can move entries or groups around by using the arrow keys or by drag and
drop.
In order to group entries you must first create a group to put them in.
PASTING CLIPS
Clicking the button Paste Clip will paste the entry you selected into the last
window you selected (your document in Book View or Code View, or Find &
Replace).
You can paste a clip using just the keyboard by using the shortcut to open Clips, typing your clip
name in the filter box and hitting return (and then Esc if you want to close the window).
Right-click on your text to bring up the context menu. You can then select your
clip and it will be inserted immediately.
If you define a clip using "\1" in the text then Clips will treat this as a Regex
replacement command. When you paste the clip, the "\1" will be replaced with
whatever text was selected.
Then when you apply the clip the text will be changed to
<span class="name">Hello World</span>
You can use this to build up a library of styles and formatting that can be applied
quickly.
In fact, you can use other regex commands in your clip, although complex regex
statements might not work.
Hold the Ctrl key down while pasting a clip in Code View to remove any tags and attributes before
the clip is pasted.
You can also use Ctrl+Space to remove formatting tags from selected text before pasting a clip.
CLIPBOARD HISTORY
— CLIPBOARD LIST —
Clipboard History allows quick access to your most recently copied or cut text.
To paste text from the clipboard, select the menu item Edit→Paste From
Click on the text you want to use and it will be pasted into your last selected
window and the dialog will close automatically.
You can also just type the character shown for the entry to select it.
LINKS AND IDS
— LINKS, FOOTNOTES, AND IDS —
Sigil provides some helpful tools for creating ids and links which can make
creating footnotes and cross-references easier.
INSERT IDS
To mark text as a destination for a link you need to give it a name by inserting an
anchor ID.
Select the text you want to mark with an ID and click the button or select the
menu item Insert→ID:
Type the name you want for this ID, e.g. footnote-1 (it must start with a letter).
To edit the ID, select the word or click somewhere in the word then click the
button again.
To delete an ID you will need to edit the HTML code to remove the tags
completely.
To identify IDs in your book you can search in Code View, or you can add the following CSS
temporarily to your stylesheet:
INSERT HYPERLINKS
To create a link to another part of the document select the text you want to link
and then click the button or select the menu item Insert→Hyperlink:
You will be given a list of valid targets in the EPUB that you can select (double-
click one or select and click OK ). A valid target in the EPUB is any filename,
any anchor IDs that have been created, or even any images. The list will be
sorted so that targets in the current file are listed first, followed by all remaining
files in book order.
To edit a hyperlink, select the text again or move your cursor in the text using
the arrow keys (you can't click in it or you will be taken to the link) and then
click the button . The link will be highlighted in the list if it is valid.
You can also enter any URL you want as a target for the link (e.g. to point to
web sites) by typing the entry in the Target box.
NAVIGATING LINKS
To go to a link in Book View just click on it.
To go to a link in Code View, hold the Ctrl key down while clicking on the
HTML opening tag.
To go back to where you clicked the link, just click the button or select the
menu item Go Back to Link or Style.
STYLES
— WORKING WITH STYLESHEETS —
EPUB editing is all about styles. Sigil provides very easy to use but very
powerful tools for helping you work with stylesheets.
NAVIGATING STYLES
You can easily jump to the definition of a style being used by your HTML code.
While in Code View simply hold the Ctrl key down and click on an HTML tag,
or select the menu item Search→Go To Link Or Style or its keyboard shortcut. You
will immediately be taken to the exact location of the class style used for the
HTML tag you are in — if one exists.
To return to where you were, just click the button or select the menu item Go
Back to Link or Style or its keyboard shortcut.
DELETING STYLES
You can select the menu item Tools→Delete Unused Stylesheet Classes to
automatically delete any unused classes in stylesheets. Sigil will present you a
list of class names in your stylesheets that do not have any references to them
from your HTML files and then allow you to confirm or cancel deleting them.
For more control over deleting individual classes, you can use a report to view
the number of times a class is used and then delete the ones you want — see the
Reports chapter.
INDEXES
— CREATE AN INDEX FOR YOUR BOOK —
If you want to create an Index for your book, you can use Sigil to identify what
to index and then to automatically create a new HTML page containing the
index.
Highlight a word or phrase in either Book View or Code View and then select
the menu item Tools→Index→Mark For Index or its keyboard shortcut (which you can
change). This will then open a prompt for you to enter how you want these
words to appear in the index:
The text you enter as the name to use in the Index will be used as follows:
[blank]: if you leave the name empty, then the exact words you highlighted
will be used in the index
words: if you enter a word or phrase, then that word or phrase will be used
(e.g. Oak instead of oak)
heading/words:if you use a "" in your name then a hierarchical group will
be created (e.g. ForestTree/Oak will create an entry Oak filed under Tree
filed under Forest)
entrya;entryb:if you use a ";" then multiple entries will be created for this
word or phrase
When you mark text for indexing it just adds add some Sigil-specific HTML
code that tells Sigil to include these words when you create the index. In code
view it might appear as follows: <a class="sigil_index_marker"
title="Character/Alice">Alice</a>
If you no longer want a word or phrase to be indexed by Sigil, you will need to
delete the special HTML tags around the word.
To identify indexed words you can search in Code View, or you can add the following CSS
temporarily to your stylesheet: [class="sigil_index_marker"] { color:#335500; }
To add specific words to the index list while in Book View or Code View,
highlight the word or phrase, and then select the menu item Tools→Index→Add To
Index Editor.
This will bring up the Index Editor with the word added to the list of entries to
index. You can also enter words directly in the Index Editor as described below.
This will, eventually, create or update an HTML page called Index.html. It will be
marked with the semantic type "index". Entries are listed alphabetically with
indentation for heirarchical entries, and extra spacing between entries that start
with different letters.
You can edit the index page as with any HTML page, but if you re-create the index your changes
will be over-written.
INDEX EDITOR
The Index Editor is used to manage the list of entries that will be included in the
index. It does not include the words you marked for indexing — they are
included automatically.
To open the Index Editor select the menu item Tools→Index→Index Editor or its
keyboard shortcut:
TEXT TO INCLUDE
The "Text To Include" column is a list of words you want Sigil to search for in
your text and then to create an Index entry using the format in the "Index
Entries" column. Entries in the "Text To Include" column can use the following
Entries" column. Entries in the "Text To Include" column can use the following
formats:
words: the words in the book must exactly match the listed words (case-
sensitive)
wordsa;wordsb: separating words by a ; means either word can match for
this entry (e.g. Gutenberg;gutenberg)
Regex: you can enter most regex patterns (e.g. [Gg]utenberg)
You can paste in text - e.g. from a text file list of words - and they will be automatically split into
separate entries for each line.
INDEX ENTRIES
The "Index Entries" column is what will actually appear in the Index for words
matching the "Text To Include" column.
Entries in the "Index Entries" column can use the following formats:
words: if you enter a word or phrase, then that word or phrase will be used
(e.g. Oak instead of oak)
heading/words: if you use a "" in your name then a hierarchical group will
be created (e.g. ForestTree/Oak will create an entry Oak filed under Tree
filed under Forest)
entry;entry: if you use a ";" then multiple entries will be created for this
word or phrase
CONTEXT MENU
Most actions concerning editing clips can be done by using the context menu.
Select one or more entries then right-click on the selection for the following
options:
Add Entry: add a blank search under the entry you clicked
Open: replace the current Index List with entries from a file
Reload: restore the list from the last saved state
Save As: save all entries to a file for keeping a per-book list of index
entries
Auto Fill: fill the list with every word in the book
SAVE
To exit without saving your entries you can just close the window (with the close
button or the Esc key). You can also use the context menu Reload to reload your
entries from disk - which will delete your current entries.
If you save and are running more than one copy of Sigil, then the other instances of Sigil will
automatically reload the newly saved index entries to keep all copies in sync.
FILTER
You can use the filter text box to restrict the list of searches shown to make it
easier to find a search.
REPORTS
— VIEW DETAILS ABOUT YOUR BOOK —
Sigil provides several reports that list details about the files and styles in your
book.
You can usually double click on an entry in the report to jump to the filename
listed.
Some entries have tooltip information. For instance in the Image Report the number of times used
column shows which files use the image.
Use Tools→Reports to generate the reports and then select which report to view:
HTML FILES
This report lists all of your HTML files and details about the files.
You can delete files from the EPUB while in the report by right-clicking on
selected files and choosing Delete From Book.
IMAGE FILES
This report lists all of your images and indicates whether or not they were used
in the book and how many times.
You can delete files from the EPUB while in the report by right-clicking on
selected files and choosing Delete From Book.
CSS FILES
This report lists all of your CSS Stylesheets and indicates whether or not they
were linked to and how many times.
You can delete files from the EPUB while in the report by right-clicking on
selected files and choosing Delete From Book.
Sigil is a powerful editor but it can't edit images and it may not have some of the
features you use in other editors. In these cases you can edit the file in an
external program — and when you save, Sigil will immediately update its copy.
This is very useful if you want to quickly edit images or want to edit CSS
stylesheets and immediately see how changes affect the layout of your book.
To edit a file externally, right click on the file's name in the Book Browser and
choose Open With from the context menu (you can also right click on an image in
Book View):
When you open a file you first need to choose the application to use with that
file type. Each file type (html, image, stylesheet) can use a different application.
You can then give the application a friendly name that will be used in the menu
the next time you use Open With:
When you next use Open With on the file you will see the friendly name you gave
the application, and the option to choose a different application. Only one default
application will be listed but you can change it at any time:
If you make changes to the file in Sigil while the file is being edited in another program then you
may lose data. You should always open the file for editing externally, make the changes, then save
and close the file in the external application before making any changes to that file in Sigil.
TUTORIALS
— STEP-BY-STEP GUIDES —
These tutorials show you how to use Sigil for several common tasks, including
how to create an EPUB from another document, how to edit an EPUB, how to
use stylesheets and how to use custom fonts in an EPUB.
Details and tips on all of Sigil's features can be found in the Features chapter.
If you haven't read the introduction of the User Guide yet, then you should to get
an overview of EPUB. The most important point to be aware of is that an EPUB
is just a collection of files including HTML documents, images, and styles all
zipped up into a single file. Sigil allows you to work with all those files and
package them as an EPUB.
CREATE AN EPUB
— YOUR FIRST BOOK —
This tutorial shows you how to take your manuscript and turn it into an EPUB
ebook. Of course, you can do all kinds of other things with Sigil, but creating
your first EPUB is a good way to see the features of Sigil.
If you are starting with a document created by one of the many available word
processor programs, the first thing you need to do is convert your document to
HTML so that you can import it into Sigil.
Sigil only supports importing HTML files since converting from other formats is actually quite
specialized and best left to other tools.
Although conversion is not part of Sigil, here are some suggestions for
converting files to HTML:
Microsoft Word file: use the MS Word menu option File→Save As Filtered
HTML. Or use the MS Word Macro @ MobileRead. Both approaches try to
reduce the amount of extra code included by MS Word so that your HTML
file is cleaner and simpler to edit in Sigil. You really want to have your
code as clean as possible.
Text file: try renaming the file to end in .html, or load into into MS Word,
OpenOffice or LibreOffice and save as HTML. Text files usually don't
convert well due to difficulty in identify the start and end of paragraphs.
RTF file: try the rtf2epub tool at http://code.google.com/p/epub-
tools/downloads/list.
PDF file: use Adobe Acrobat File→Save as HTML menu option, or use
http://pdftohtml.sourceforge.net/. PDF files usually don't convert well since
they were built for a fixed layout. Avoid if possible.
Mobi file: Unzip the .azw or .prc into a directory. Then open the HTML
file in Sigil.
START SIGIL
When you first start Sigil you will be shown a screen with several windows. The
Book Browser window is on the left (which is used to access all the files in your
EPUB), an editor Window is in the center and set to Book View (to edit your
book as it appears), and a Table of Contents window is on the right (to show you
any chapter titles you've defined).
See the User Interface chapter for more details.
You will now see your file in the Book Browser window under the Text folder
on the left, and the file will be opened in the Book View editor in the middle
with its filename showing on the tab header:
Your HTML file is now part of the EPUB ebook. From now on you you are
editing your EPUB and not just an HTML file.
If your file includes any images or stylesheets, Sigil will attempt to load them as well.
When converting your file to EPUB or loading an EPUB Sigil may add some necessary details and
re-organize your files into standard folder names but it won't change your text.
Enter a name for you file in your file manager. It will be given a .epub extension
since it will be saved as an EPUB file.
You can now use the button to save your EPUB at any time – and you should save often.
To make sure your ebook conforms to EPUB standards, you need to add a bit
more information.
To open specific pages in your book, just double-click them in the Book
Browser.
Browser.
You can then follow the remaining steps to create a complete EPUB ebook. You
can always make more changes once you've created your EPUB – read through
the User Guide for more details on editing, working with files, images and
formatting.
To add details about your book (called metadata) to your EPUB, use the button
or the menu option Tools→Metadata Editor:
You may have noticed that there is a lot of room for other values in the Metadata Editor. Only the
Title, Author, and Language are required for EPUBs, but if you want to add more values using the
Add Basic or Add Role buttons you can.
In order to define an EPUB cover you will need to import the image into your
EPUB, create a file to hold your cover, and mark the image and file as covers as
EPUB, create a file to hold your cover, and mark the image and file as covers as
described below.
To select the image you want as your cover, use File→New→Add Existing Files:
You need to create an HTML file and insert your cover image into the file.
Create a new HTML file in your EPUB by right clicking on a file name in the
Book Browser and selecting the menu option Add Blank Section:
A new HTML file will be created in your Text folder:
Rename the file so you know what it is by right-clicking on the filename and
selecting Rename from the menu:
Enter cover.xhtml as the new name (you can just type cover – the extension will not
change by default):
Move the file to the top of the Text folder since a cover should be the first file of
a book. You can drag-and-drop the file to its new position (click on the filename
and hold the mouse down while you move it to its new position):
Now that we have an HTML file, we need to put your cover image into it.
Double-click on the cover.xhtml file to open it in the Book View editor window
(you will see cover.xhtml as the title of the open tab in the editor window), click
somewhere in the blank window to start editing.
Use Edit→Insert Image to select your image from the Images folder, or use the
Insert Image icon on the toolbar:
Now that you have both a cover image and an HTML file with a cover in it, you
need to mark both as Covers to make sure the various ereaders can recognize the
cover:
To mark the HTML file as a cover right-click on cover.xhtml in the Book Browser
window, select the menu item Add Semantics, then choose the Cover entry:
And to mark the image as a cover image right-click on the cover image in the
Book Browser window, select the menu item Add Semantics, then choose the
Cover entry. You must set both the image and the HTML file to type Cover to
make sure all ereaders recognize the cover.
Your EPUB now has a cover defined (if you look at the Add Semantics menu
again for the files you will see the Cover items now have a checkmark next to
them).
Sigil will display the current TOC in a separate window. If you haven't defined
any text as a chapter heading, then the Table of Contents window will be blank –
except for the Start placeholder text and two buttons for generating a new Table
of Contents:
MARK YOUR CHAPTER HEADINGS
In order to tell Sigil what your chapter headings are you need to highlight the
text in your files (e.g. Chapter 1) and then click on the Paragraph Format icon
(which will probably list Normal on the button if you have selected some
standard text) at the top of the Book View window:
Select Heading 1 for a top level heading. This will mark the the text as a heading
at level 1 – you can see that the format of the text and the dropdown menu has
changed:
When you click on a heading in your text the Paragraph Format menu will change to show the
heading level.
You should now mark all the chapter headings in your document in the same
way.
Once you have marked all your chapter headings you can click the Generate
Table Of Contents button on the Table of Contents window:
This will open the Heading Selector dialog:
The dialog allows you to mark which headings to include or not include in your
Table of Contents. Click OK when you are finished.
The Table of Contents window has now been updated to show your current TOC
– which includes the headings you selected:
You should save your book if you haven't already.
You can also use Sigil to create create an inline TOC page using the Generate Inline HTML
TOC button. This is not required or usually used in EPUBs, but if you convert to other formats or
want a fancy TOC then its available.
If you loaded an HTML file into Sigil, this usually means all of your text and
chapters are in one large file. This is okay, but the standard practice with EPUBs
chapters are in one large file. This is okay, but the standard practice with EPUBs
is to put each chapter in your book into a separate HTML file. This makes it
much easier to edit.
Since most ereaders start a new file in the EPUB on a new page, it means your chapters will also
start on a new page.
The easiest way to split your book into one chapter per file is to do a bulk update
by marking all the locations of your chapters and then have Sigil split at those
points.
You should save your book now, in case you want to undo any changes.
For each chapter heading in your book, click just to the left of the chapter
heading so that your cursor is at the start of the line:
Once you have inserted all your Chapter Markers into your file, you need to run
Edit→Split at Chapter Markers:
Your book will now be split into separate files as shown in the Book Browser:
You can rename the chapters, and you should save your book once you have
made your changes.
See the Splitting and Merging chapter for more details.
To check or validate your book, use File→Validate. This will open a window just
below your document and list any problems that were found. For instance, if you
forgot to enter the Title of the book in the Metadata Editor you might see:
It can be difficult to interpret exactly what the issues are sometimes, but you
should read through them to see if there is anything that you recognize and can
fix.
Once you've fixed all the errors Validate will confirm everything is okay:
See the Validate and Clean chapter for more details.
This tutorial shows you how to get started with advanced editing of an EPUB in
Sigil.
BASIC EDITING
If all you want to do is make a few simple changes in your book, then you can
just open each of the files (by double-clicking on them in the Book Browser) and
make the corrections in Book View. Then save your EPUB.
But if you want to do more significant changes then you need to learn about
Code View and Find & Replace.
However, your text is not actually stored in an EPUB looking like it does in
Book View. In fact, it is stored in HTML format – which is a mix of your text
and HTML tags that tell ereaders how to interpret and display your book.
You can see the HTML code in your files by using Code View.
So why do you need to know all this? Because in order to bulk edit text or to
control the formatting of your book easily, you need to use Code View. And as
its name implies, Code View shows you the raw HTML code that makes up your
book.
CODE VIEW
CODE VIEW
To switch to Code View, use View→Code View. You can switch back to Book
View at any time by using View→Book View. Or you can use the Book View and
Code View icons on the toolbar.
That's quite a lot of text, but its not as jumbled as it appears. First, ignore
everything at the top of the file up to and including the line <body> as it is just
information required by HTML files and usually the same in every file.
Your text starts after the <body> tag – you can see the chapter name and several
paragraphs of text, along with other odd looking codes explained below.
HTML BASICS
A full description of HTML is beyond this tutorial, but understanding the basics
will help you edit your text.
If you look at the HTML version of your file in Code View you will see lots of
words like <p> or <h1>, etc. These are the HTML tags that tell ereaders what to
do with your text.
For instance, the HTML code below tells the ereader that the text Chapter 8 is a
level 1 Heading:
<h1>Chapter 8</h1>
The <h1> tag is the start of the text to be treated like a heading, and the </h1> tag
indicates the end of the text included in the heading. Depending upon some other
settings, ereaders will typically make the text of a heading larger and center it on
the screen.
And the HTML code below tells the ereader that the text This is a paragraph is an
ordinary paragraph. Since its a paragraph the ereader will apply a certain
formatting, perhaps indenting the first line.
<p>This is a paragraph.</p>
Tags can get more fancy since they can include attributes that modify how they
are interpreted. For example, the following paragraph tag (p) has an attribute
called style with a value of font-weight: bold:
<p style="font-weight: bold">A bold paragraph</p>
The code tells ereaders that for this particular paragraph, the style of the text
should be bold.
These are just a few examples of HTML code, but they give you an idea of what
the majority of HTML is all about.
the majority of HTML is all about.
What is important to remember is that in Code View you have access to both
your text and the formatting codes that control the look of your book – so you
can find and change them. Sigil provides a way to easily edit your text and
HTML tags.
See the Introduction, Code View and Stylesheets chapters for more details.
Once you are in Code View you can edit your text just like in Book View. Try
changing some of your words (but not the HTML tags just yet), and then switch
back to Book View. You will see the updates you made. In fact, any changes you
make in Book View or Code View will be visible in the other view as they both
only change one copy of your file.
Unlike Book View, where you can make whatever changes you want without breaking your EPUB,
when you are in Code View it is essential that you edit carefully. You will need to make sure all
the tags you use are valid and are opened and closed properly – if they aren't, you will get a
warning when you try to save and you will be unable to save your EPUB until they are fixed.
Save often to have your code checked for any errors to catch them early.
To open the Find & Replace, use Search→Find / Replace. The window will remain
open and below the editing window until you close it.
This is the Find & Replace window in Book View:
As you can see, in Book View you only have the option to Find text.
You need to switch to Code View to see the full set of options available in Find
& Replace.
In Code View, to open Find & Replace use Search→Find / Replace or the Ctrl+F
keyboard shortcut:
The Find and Replace text boxes are where you enter what to look for and change. The four
buttons on the right (Find, Count All, Replace, Replace All) are used to run your search. The Mode
dropdown boxes on the bottom allow you to change what to search for, where to search, and which
direction to search in.
To make a simple change enter some text to search for in the Find box, and what
to replace it with in the Replace box, then click Replace:
Or click on Count All to show how many matches there are:
To test Find, enter a search string and click Find a few times (any text in the
Replace box is ignored if you are just doing a Find or Count All). Your matched
text will be highlighted in the Code View window.
Since your matched text was already highlighted, Sigil has replaced it with your
new text (which could be empty if you wanted to delete that text in your
document) and then automatically found and highlighted the next match. If
matching text wasn't highlighted already, then Replace would have just found
and highlighted the next match without replacing it.
If you are satisfied that the Replace is working okay, you can use Replace All to
update all the matching text in your document at once instead of one at a time.
Always use Count All and possibly a few Replace commands before using Replace All – to make
sure you have entered your find and replace strings correctly.
You may have noticed the selection box containing Current HTML File. If you
change Current HTML File to All HTML Files, your Find or Replace will be
done across every HTML file in your EPUB:
done across every HTML file in your EPUB:
The real power of Find & Replace in Sigil is provided by its support of Regular
Expressions (also called regex).
You use regex in Find & Replace by changing the mode of the search from
Normal to Regex.
Regex is a very important tool in Sigil, but only a very brief introduction can be
given in this tutorial.
For example, instead of searching for very specific text to replace or delete, such
as "Page 123", it would be much more useful to search for text that contains
"Page" followed by a number – that's exactly what regular expressions can
provide.
Instead of putting your actual text into the Find or Replace boxes, you can
substitute it with special regex codes. So in the example above you could search
for "Page \d+" instead of "Page 123" because "\d+" is a regex code that means
any digit repeated at least once.
USING REGEX TO REPLACE TEXT
But even more useful is that you can use regex to help with replacing text as
well. In the example above, you might want to keep the page numbers but
replace the word "Page". You could use then use something like:
Find:
Page (\d+)
Replace:
This is page number \1
This will replace any occurrence of "Page" followed by a number with "This is a
page" followed by the same number:
Before:
Page 418
After:
This is page number 418
The first point to note about this replacement is the use of the regex code (\d+) in
the Find box. The \d+ code tells the search to look for numbers as above. But the
use of parenthesis around the code tells the search to remember what those
numbers were. The other point to note is the use of the regex code \1 in the
Replace box which tells Replace to substitute the characters remembered in the
Find statement for the string \1 wherever it finds it.
As a further example of regex, this is how you might change the formatting of
certain text into chapter headings.
Let's say that you have an imported HTML file that contains lots of chapter
headings, but none of them are marked using the h1 heading tag. Instead they are
all marked as paragraphs like this:
<p>CHAPTER 7</p>
Assuming every paragraph like this is a chapter heading, you could use this
regex:
Find:
<p>\sCHAPTER\s(\d+)\s</p>
Replace:
<h1>Chapter \1</h1>
That's quite a lot to digest, but if you look carefully you can see that its very
similar to the Page number example above in that its remembering the digits in
the chapter name and using them in the replace.
Its the Find that is the most interesting. It breaks down like this:
You could just use a space instead of \s but \s is more flexible since it will match
any number of blank spaces and tabs and even across new lines (regex only
searches one line by default).
Before:
<p> CHAPTER 14
</p>
After:
<h1>Chapter 14<h1>
It becomes more difficult to use regex if the formatting used in a file is not consistent – in these
cases you may have to do several Find & Replace passes and even resort to making the updates one
by one manually.
This is only a very basic description of what regex is, but it gives you an idea of
what is possible. The trick with regex is getting the right find and replace strings,
and that only comes from reading, asking questions, and experience.
This tutorial is basically a quick reference for Regex. You should read Edit an
EPUB first as an introduction to Regular Expressions.
Regex is a very powerful way for you to edit and cleanup your EPUB when
using Find & Replace. However, when you first start using regex it can be
confusing because there are a lot of commands you can use. This is a brief
summary of some basic regex commands.
You can find more details about regex at these links (or ask for help in the Sigil
forum):
OVERVIEW
When using regex commands in Find & Replace the purpose is to allow you to
search for patterns instead of exact text. This means that you can tell Find &
Replace to search for "a number" instead of "8", or to match any words between
certain tags and then replace it with new tags or new words.
In order to allow you to search for patterns, you need to use regex commands in
place of the specific text you want in your search. For instance, instead of
searching for 8 you could search for \d (which means one digit) or \d+ (which
means one or more digits).
An example Find & Replace command using regex might be to change all level
1 headings to level 2 headings:
Find: <h1(.*?)</h1>
Replace: <h2\1</h2>
where the Find command searches for any text between the h1 start and end tags,
and using () to save the text. (The start tag is left open in order to catch any class
definitions, and the ? tells .* to do minimal matching). The Replace command is
used to replace the matched text with the saved text (indicated by \1) surrounded
by the h2 start and end tags.
The following sections give a sample of common regex commands that you may
find useful.
GENERAL MODIFIERS:
You can put these commands at the start of any regex to modify how the
expression behaves:
(?s) – search across lines when using .* since by default .* only matches
within a line of text.
(?U) – match the first occurrence of your string (also called minimal or
ungreedy matching). This is very useful when using .* to avoid matching
too much.
(?i) – ignore case when matching.
SINGLE CHARACTERS:
You can use these regex commands to represent single characters:
MULTIPLE CHARACTERS:
These regex quantifiers or codes allow you to represent multiple characters:
And there is a special character that tells your search to stop at the first match it
finds instead of the largest match which you can use instead of the general
modifier (?U):
GROUPS:
In some cases you need to group your expressions together so that, for example,
you can save them for a later replace, or to indicate a choice of words:
– atext or btext
(atext|btext)
(group) – group the words together for later retrieval – you can use multiple
groups
REPLACING:
When replacing text, one of the most useful features is to be able to use text that
was matched by storing it in a group. Once you have grouped text you can
reference it in your replace command:
\1– use in Replace to retrieve the value of a saved group (use \2 for the
second group, etc.)
CREATE LINKS AND FOOTNOTES
— LINKING YOUR TEXT —
Sigil provides a couple of ways to link text to other parts of your book, such as
chapter names and footnotes, so that readers can select the link and jump to the
identified text.
An ID is just a unique name, like footnote1 that you will assign to a part of your
text so that you can refer to it. ID names must be unique within an HTML file,
but its best if they are unique throughout the whole EPUB in case you move text
around.
If you want the destination to be the top of a file, then you don't need to create a special ID – you
just need to know the filename.
A link is a way to refer to your ID. It could just be footnote1 if the ID is in the
same file as your link. Or if the link and ID are in different files it could look
like filename#footnote1 – the # character is just used to separate your filename from
the ID name. The link could also include directory names like
../Text/filename2#footnote7 but still just refer to a filename and ID.
Links to websites or other pages outside of your EPUB will not work if you click on them in Sigil,
Links to websites or other pages outside of your EPUB will not work if you click on them in Sigil,
even though they may work on some ereaders.
CREATE AN ID
In Book View, you can create or assign an ID to text so that you can point to it:
Select the text you want to link to, e.g. [1] This is a footnote
Click on the Anchor icon ( ) to open the anchor properties window:
Enter a name for the anchor – names must be unique in the file
The text is marked as an anchor:
You can double click the text to view or edit the anchor's ID name
You can remove an anchor tag and its ID in Book View by right clicking on it and selecting
Remove.
CREATE A LINK
In Book View you can create a link to text you have already marked with an ID
as follows:
Select the text you want to be linked, e.g. [1]
Click on the Link icon ( )
In the Link dialog change the URL type to <other> and enter the ID to point
to your destination, e.g. footnotes.xhtml#footnote1 (you can leave out the
filename if the ID is in the same file):
You can remove a link in Book View by right clicking on it and selecting Unlink or use the unlink
icon.
Most of the other options in the Link properties window are not used. For instance you could
change the Link Type to "Link to anchor in the text" but this is only useful if you used anchor tags
in the current file that you want to link to. Target and Advanced options are also generally not
used.
In Code View IDs and links are created as with any HTML document.
In Code View IDs and links are created as with any HTML document.
Create an ID
In Code View you can create two types of IDs that can be used for links.
Anchor IDs like in Book View: just use an a tag around the destination text,
e.g. <a id="footnote_1">This is a footnote</a>
ID names assigned to existing HTML tags, e.g. <h3 id="chapter1">Chapter
1<h3>, or <p id="id7">text</p>
Which form you use is up to you, although Chapters should always use IDs in
the heading tag.
CREATE A LINK
You can point directly to a text file without a path since text files are in the same directory in the
EPUB, but you can also prepend the filename with "../Text/".
REVERSE LINKING
Most ereaders have a Back button that you can click once you follow a link to
take you back to the original linked text. But for those that don't, you can create
a link from your destination text back to your original source text. This is often
called reverse linking
Reverse linking is just like any other kind of linking – it just means you have to
create a link from your destination text back to your source text – so both source
and destination will have an href and id tag and will be mirror versions of each
other.
In Book View, assign an ID to your source text just like you did to your
destination. Then create a link from your destination text back to your source
text in the same way you created the original link.
This tutorial describes stylesheets and how to use them in your EPUB.
A stylesheet (or CSS – Cascading Style Sheet) is a list of instructions that tells
ereaders how to display the text in your book. More specifically it tells the
ereader how to style text in HTML tags used in your book. Understanding and
using CSS is the best and most flexible way to layout your book exactly as you
want.
And if you really need to dig into the details, the CSS2 technical specification is
available:
Using CSS can get quite complicated, but if you become familiar with the basics it will make it
much easier to understand why your book looks the way it does and how to modify its layout.
This chapter assumes you are familiar with Code View since you need to use Code View to see the
details of styles.
WHAT IS A STYLE?
Styles are used in a book to say things like “make this text blue”, or “make text
centered”, or leave a little more space above this text. A style definition is just
text that looks like:
text that looks like:
color: blue;
But styles aren't very useful unless they are applied to something. In the case of
an EPUB styles are applied to the HTML elements in your document, like p
(paragraphs), h1 (level 1 headings), div (divisions), span (spans), etc.
There are 3 ways styles can be used for HTML tags in an EPUB:
STYLE ATTRIBUTES
To apply a style directly to an HTML tag, you can use the style attribute in the
tag. For example, to apply the style color: blue to a paragraph you would change
<p>Hello</p>
to:
<p style="color: blue">Hello</p>
In fact this is exactly what Book View does when you select the buttons to make
text Bold, Italic, Underline, etc., only in this case it will usually use the span tag,
e.g.
<span style="text-weight: bold">bold text</span>
This works perfectly well if you just want to change a few things and rarely
This works perfectly well if you just want to change a few things and rarely
update the formatting. But if you later want to change from using bold to italic
for certain words then you will have to edit every place in the book that set the
specific style.
Styles attributes are rarely used unless they were created by software doing an
automatic conversion or update and should be avoided.
STYLE SELECTORS
A style selector is a way to give a particular style a name, and then use the style
in the document just by referring to its name. More specifically the style selector
is used to select which elements in your document should use the style you
define.
For example, if you wanted to style all paragraphs in your EPUB to be centered,
you could define a rule for a style selector as follows:
p{
text-align: center;
}
This defines a style selector p that will match (or select) all paragraph elements.
You can control which tags get selected by modifying the selector. One of the
most popular ways to select specific tags is by using a class name. This is just a
name that you choose (like "firstparagraph" or "centeredtext") to give to your
tags.
For example if you wanted to style the first paragraph in a chapter slightly
differently than other paragraphs, you could define a style selector as follows:
p.first {
text-indent: 0em;
}
This defines a style selector that will match (or select) paragraph tags that use
the class name first. You could then use that style in your document for a
paragraph by assigning the class name first to the paragraph as follows:
<p class="first">First paragraph in a chapter</p>
The great advantage in this abstraction is that you can now update the values of
the style (to change the indentation or other settings) without having to update
your text.
It is common practice to use class names that refer to the purpose of the style and not what the style
does in case you change the styling later. For instance, use span.placename instead of span.bold
in case you want to change your place names to italic later.
Now you need to actually store your styles somewhere in order to use them.
In an EPUB you can store your stylesheet in the same file as your text (using the
style element), or in separate files (external stylesheets or CSS files).
STYLE ELEMENTS
When you store style selectors and rules in the same file as your text they can
only be applied to the HTML file they are in and cannot be shared by other
HTML files.
When using these internal styles, the style definitions are stored inside a style tag
at the top of your HTML files. If you open a file in your book and switch to
Code View, you will see that the top of the file contains text between two head
tags. This section of your document contains information about the file, and one
of the things you can put here is the style tag that defines your internal style rules.
Here is a typical use of internal styles (they are surround by the style tag):
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html >
<head>
<head>
<title></title>
<style>
h1 { text-align: center; }
p.boldtext { font-weight: bold; }
</style>
</head>
Once you have created style rules, you can apply them to your HTML tags. In
the case of the h1 tag in the example you don't need to do anything because
you've stated that every h1 tag should be centered (because you haven't specified
a specific classname the style will apply to all text using the tag). But for the p
tag, you need to tell your paragraph to use the class boldtext as above, e.g.
<p class="boldtext">A paragraph.</p>
Internal styles are a way of grouping styles together and using style selectors, but
when you have many files in an EPUB it becomes a bit confusing as you have to
have separate style rules in each file.
Internal styles are usually only created by software doing automatic conversion
or cleaning, and should be avoided if you are creating the styles yourself or
doing an extensive edit of a book.
The best way to manage styles is to use a separate stylesheet file to hold your
style rules.
You can convert your inline styles and your internal stylesheets into a separate stylesheet file. Just
remember to assign the appropriate classes to your tags and to delete the old style attributes and
elements.
EXTERNAL STYLESHEETS
If you create a separate file to hold all your style rules, they can apply to the
entire book. They are also much easier to find and edit, and updates are much
easier to manage as you add and remove files. It also helps to ensure your book
is formatted consistently as you can see all your styles in one place.
In Sigil, external stylesheets are stored in the Book Browser in the Styles folder.
You can double click on the stylesheet file to add and edit your styles as
necessary.
If there isn’t a .css stylesheet file in the folder already, you can create a blank one by right clicking
on Styles and selecting Add Blank Section.
For example, if you open the styles.css file in a simple EPUB you might see
something like this:
Warning
If you have any errors in your style definitions they will silently be ignored. You can use Validate
CSS With W3C to check for errors.
Even though you've created the external stylesheet, its not actually used by
Even though you've created the external stylesheet, its not actually used by
anything yet.
To use it, you need to tell your HTML files to use the stylesheet – by linking to
them as described below.
Click on the stylesheets you want to be used for the files and select OK.
You can link multiple stylesheets to one page if separate CSS files help you
organize styles better, but most EPUBs use just one stylesheet.
If you link multiple stylesheets they will be applied in order so the styles in the last stylesheet will
override the styles in the preceding stylesheets.
WHAT STYLES SHOULD BE USED?
The styles you use for your text are entirely up to you.
The best way to learn to use styles is to look at an EPUB that contains formatting
you like and look at what its CSS files contain and how it uses those styles in the
book.
INCLUDE CUSTOM FONTS
— EMBEDDING FONTS IN YOUR BOOK —
This tutorial shows you how to use custom fonts in your EPUB.
One of the benefits of ereaders is that you can choose your own font, so its usually best to just use
embedded fonts to highlight specific types of text such as chapter headings, quotes, etc. and not to
change the font of the entire book.
To use a font in an EPUB you must first load the font into the EPUB, define a
style for the font, and then apply the style to your text.
You will need to know about stylesheets to embed fonts so you should read through the Stylesheets
chapter first.
The fonts will be added to the Fonts folder in the Book Browser. However, they
are not yet actually used anywhere in your book – they are just available to use.
Many fonts are not free. Before you include fonts in your EPUB please make sure that you have a
license or permission to use them. There are many free fonts available online if you search for
them.
Fonts files must be either OpenType (.otf) or TrueType (.ttf) format. All ereaders should support
otf but most will likely support both formats.
Open a stylesheet that you will use to include your fonts (see the Stylesheets
chapter for more details).
@font-face {
font-family: 'MyFontBold';
font-weight: bold;
font-style: normal;
src: url(MyFontBold.ttf);
}
You must define one @font-face rule for each style of font (normal, bold, italics, etc.).
When using font-family in @font-face and later, the font name must either be quoted or unquoted
every time you use it, but not both. Always using quotes around the font name makes things more
consistent and avoids having to check if a name is valid without quotes.
The font still isn't actually being used in the book yet, that's the next step.
So, for example, to use your new font for headings, define the style for the
heading tag as follows:
h1 {
font-family: 'MyFontBold', serif
}
Or to certain paragraphs:
p.longhand {
font-family: 'MyScriptFontItalic', serif
}
Or if you want, although its not recommended, you can apply the font to all text
in the book:
body {
font-family: 'MyFont', serif
}
The font-family rule above says to use your font if possible for the text, but if its not possible use a
generic serif font.
You may need to save your EPUB and then re-open it in Sigil to make sure Sigil reads your new
style.
Due to a bug in the Qt libraries used by Sigil, fonts may not display correctly in Sigil so you will
may have to test them on your target ereaders.
FONT OBFUSCATION
When you use a font in an EPUB, the font file could be extracted by someone
and used somewhere else. If your fonts are licensed you may want to prevent
this.
You can use Sigil's font obfuscation menu to scramble the font file using one of
two standard methods, Adobe or IDPF – which one is up to you, but you should
two standard methods, Adobe or IDPF – which one is up to you, but you should
test on your target ereader to make sure the font is still readable. Obfuscation is
not encryption – it just modifies the font file making it hard to use elsewhere
while still being useable by readers to display fonts.
To use font obfuscation, right click on your fonts in the Book Browser window,
right-click and select Font Obfuscation from the menu and choose a method to
use for obfuscation.
Validate to check for errors; then fix them. See Validation for typical error
messages and what to do about them.
Spell Check, and consider creating a separate dictionary for your book if it
has lots of unique words.
Use Metadata Editor to set your Title, Author, Language, and Copyright.
And if you want, also set the Publication Date, Subject, Description,
Copyright and ISBN if there is one.
Use Add Semantics to set your cover image and cover file (if you have one)
as type Cover.
Set your first text file (where the book will open) as semantic type Text.
Regenerate your TOC, and re-create your HTML TOC if there is one.
Link your stylesheets to all files that need them. Use Reports to check for
missing links.
Search for and remove if necessary text like , ", <br >, empty
paragraphs <p> <p>, empty <div> tags, src="", href="", change - to
ndash, etc..
Search for sgc-classes, <style> tags or style= attributes and convert them
CSS files.
Remove unused images or unused style classes using the built in tools.
Scan your book in Code View line by line for unexpected formatting,
especially if you've used Book View to make updates.
Validate again. Use the W3C CSS validator function to check your
stylesheets as well.
COMMON QUESTIONS
STARTING SIGIL
SIGIL DOES NOT START ON MY 32 BIT WINDOWS OS?
If you are running a 32 bit version of Windows make sure you downloaded the
32 bit version of Sigil and not the 64 bit version.
USING SIGIL
There are a lot of formats out there, and converting from one format to another is
not a trivial issue. Since there are already excellent tools for converting from one
format to another, Sigil will remain focused on being the best EPUB editor
available.
For exporting Word files to HTML for import into Sigil, use Word's Save As
Filtered HTML open, or refer to Save as HTML Word macro.
To convert Mobi to HTML you can use calibre to unpack the Mobi file to access
the HTML file or convert Mobi to HTML.
If you want to report a problem with a file that cannot load and crashes Sigil,
then you must attach the EPUB file to your bug report. You can set bug reports
to private so that non-developers cannot see your file. But in most cases you will
to private so that non-developers cannot see your file. But in most cases you will
need to correct the file.
I PASTED SOME RICHLY FORMATTED TEXT INTO SIGIL BUT IT’S ONLY
PASTED AS PLAIN TEXT?
Pasting rich text into Sigil may not work very well. You can try to export (or
convert) your text to HTML and then import the new file directly. This will
preserve the formatting.
In Sigil, if the font you are using does not have the required glyphs to render a
character present in the text, glyphs from a different font that can render it are
used. This is called font substitution. So as long as some fonts on your computer
can display these characters, so can Sigil.
ADE on the other hand only displays a small subset of Unicode characters by
default. The supported characters are listed in the Adobe PDF Reference v1.7,
Appendix D, tables D.1 and D.3.
If you want other characters than these to display in ADE, you will have to
embed the required fonts.
Note that ereaders may support displaying formats or styles differently and how
text is display in one reader, or in Sigil, may be slightly different to how its
displayed in another ereader.
If you edit in Book View it may insert blank spaces or lines based on what you
edited. You can remove these entries in Code View.
or an empty paragraph:
<p> </p>
For multiple blank lines, its best to use a style to define the amount of space you
want to leave.
Add the heading tag you want to use for the image and give it a title to display in
the TOC, e.g.
<h1 title="CHAPTER 1"><img src="../Images/myimage.png" ><h1>
The TOC will now have an entry called "CHAPTER 1" which links to your
image.
You can even use heading tags with no text in your document if you just want a
Chapter entry:
<h2 title="Chapter Subsection"></h2>
This will affect only the paragraph spacing (the p means paragraph). To remove
all the whitespace between the various elements and make the document look
more “book like”, use this code:
body, div, p, h1, h2, h3, h4 { margin: 0; padding: 0; }
Add this code to your CSS definitions, which will set the text using the dropcap
class in a span tag to use certain values:
span.dropcap {
float: left;
font-size: 4.7em;
line-height: 0.8em;
margin-right: 3pt;
margin-bottom: -0.1em;
}
In Sigil, find the paragraph you want to start with a drop cap, and switch to Code
View. Change the text from something like this:
<p>Hello</p>
to:
<p><span class="dropcap">H</span>ello</p>
Switch back to Book View and you should see the dropcap.
Add <span class="dropcap"></span> around all the letters at the start of paragraphs
where you want a drop cap.
You might need to adjust the values for font-size, line-height and margin-bottom
to get the effect you want. Sigil’s Book View may not show exactly how it’ll
appear on all ereaders, but it’s pretty close.
Then use an archive manager to unzip or access the EPUB file. Add the xml file
you created to your EPUB in the META-INF directory, then re-zip your EPUB.
CONTRIBUTING TO SIGIL
— HELPING DEVELOPMENT —
Sigil is free and open-source software, and it is developed and supported entirely
by volunteers who love books and want well-edited ebooks to be easily
available. Your entirely optional contributions can help improve Sigil and show
your appreciation for making the software available. Feel free to just say hi on
the Sigil forum and let others know how useful Sigil is to you.
TRANSLATING SIGIL
Translating Sigil into other languages is highly encouraged. There is an active
community of volunteers who translate Sigil already, and new languages can
always be added.
The best way to translate Sigil is to use the web based translation system
provided by Transifex. Translations done using Transifex are downloaded just
before releasing a new version:
Alternatively you can use local Desktop tools for translation. Sigil uses Qt's
Linguist tool for creating and editing translations. You can either download Qt
and compile the tools manually or use the pre-built packages:
Updating and creating new translation files using the Desktop tools is the same
process:
All translations files should have the form sigil_lang.ts. Where lang is a two letter
language code. For example the Polish translation will have the filename
sigil_pl.ts.
ASSISTING USERS
If you are an experienced Sigil user, EPUB expert, or working your way there,
you can help by answering users' questions – primarily at the official Sigil
Forum at MobileRead. You can also check issues on the development website
and add comments.
CODING
If you are a C++ programmer and have suggestions for improvements or bug
fixes you are welcome to submit patches for consideration.
DONATIONS
Sigil is free software, but your donations are greatly appreciated.
Please use Help→Donate to say thanks and to help Sigil development continue.
The Sigil User Guide is also free. If you've found it useful, please say thanks by
donating directly to the author.