calibre User Manual, Release 2.56.0
What are the best source formats to convert?
In order of decreasing preference: LIT, MOBI, AZW, EPUB, AZW3, FB2, DOCX, HTML, PRC, ODT, RTF, PDB,
Iconverted a PDF ﬁle, but the result has various problems?
PDF is a terrible format to convert from. For a list of the various issues you willencounter when convertingPDF,see:
Convert PDF documents(page66).
How do I convert my ﬁle containing non-English characters, or smart quotes?
There are two aspects to this problem:
1. Knowing the encoding of the source ﬁle: calibre tries to guess what character encoding your source ﬁles
use, but often, this is impossible, so you need to tell it what encoding to use. This can be done in the
GUI via the Input character encoding ﬁeld in the Look & Feel->Text section of the conversion dialog.
The command-line tools have anebook-convert-txt-input --input-encoding (page 255)
2. When adding HTML ﬁles to calibre, you may need to tell calibre what encoding the ﬁles are in. To
do this go to Preferences->Plugins->File Type plugins and customize the HTML2Zip plugin, telling it
what encoding your HTML ﬁles are in. Now when you add HTML ﬁles to calibre they will be correctly
processed. HTML ﬁles from different sources often have different encodings,so you may have to change
this setting repeatedly. A common encoding formany ﬁles from the web is cp1252 and I would suggest
you try that ﬁrst. Note that when converting HTML ﬁles, leave the input encoding setting mentioned
above blank. This is because the HTML2ZIP plugin automatically converts the HTML ﬁles to a standard
What’s the deal with Table of Contents in MOBI ﬁles?
The ﬁrst thing to realize is that most ebooks have two tables ofcontents. One is the traditional Table ofContents,like
the ToC you ﬁndin paper books. This Table of Contents is part of the main document ﬂow and can be styled however
you like. This ToC is called the content ToC.
Then there is the metadata ToC. A metadata ToC is a ToC that is not part of the book text and is typically accessed by
some special button on a reader. For example,in the calibre viewer, you use the Show Table of Contents button to see
this ToC. This ToC cannot be styled by the book creator. How it is represented is up tothe viewer program.
In the MOBI format, the situation is a little confused. This is because the MOBI format, alone amongst mainstream
ebook formats, does not have decent support for a metadata ToC. A MOBI book simulates the presence of a metadata
ToC by putting an extra content ToC at the end of the book. When you click Goto Table of Contents on your Kindle,
it is to this extra content ToC that the Kindle takes you.
Now it might well seem to you that the MOBI book has two identical ToCs. Remember that one is semantically a
content ToC and the other is a metadata ToC,even though bothmighthave exactlythesame entries andlook the same.
One can be accessed directly from the Kindle’s menus, the othercannot.
When converting to MOBI, calibre detects the metadata ToC in the input document and generates an end-of-ﬁle ToC
in the output MOBI ﬁle. You can turn this off by an option in the MOBI Output settings. You can also tell calibre
whether to put it and the start or the end of the book via an option in the MOBI Output settings. Remember this ToC
is semanticallya metadata ToC,in any formatother than MOBI it cannot not be part of the text. The fact that it is part
of the text in MOBI is an accident caused by the limitations of MOBI. If you want a ToC at a particular location in
your document text, create one by hand. So we strongly recommend that you leave the default as it is, i.e. with the
metadata ToC at the end of the book. Also note that if you disable the generation of the end-of-ﬁle ToC the resulting
Chapter 1. Sections