輸入選項
用來控制匯入 mobi
的檔案處理選項
- --input-encoding
- 指定輸入文件的字元編碼。如果設定這個選項就會覆蓋任何由文件本身宣告的編碼。尤其當文件沒有宣告任何編碼或文件所宣告的編碼有誤時會很有幫助。
輸出選項
用來控制輸出 epub
處理的選項
- --epub-flatten
- 這個選項只有在您想把
EPUB 檔案用在 FBReaderJ
上時才需要。它會將
EPUB
內的檔案系統扁平化,將所有的檔案放在最上層。
- --epub-version
- 要產生的 EPUB
檔案版本。EPUB 2
是最具廣泛相容性的,只有在您確實需要的情況下才使用
EPUB 3。
- Extract the contents of the generated EPUB file to the specified folder.
The contents of the folder are first deleted, so be careful.
- --flow-size
- 將大於該大小 (以 KB
為單位) 的 HTML
檔案分割。由於很多
EPUB
閱讀器無法開啟巨大的檔案,故此功能十分有用。預設值
260KB 是 Adobe Digital Editions
的檔案大小要求。設定為
0
來停用大小為基準的分割。
- --no-svg-cover
- 不使用 SVG
做為書本封面。這個選項是用在您的
EPUB 要用在不支援 SVG
的裝置上時,像是 iPhone
或 JetBook
Lite。沒有這個選項,在前述裝置上會以空白頁面來顯示封面。
- --preserve-cover-aspect-ratio
- 當使用 SVG
封面時,該選項會導致封面平鋪滿有效的屏幕區字段,但仍會保持它的縱寬比(寬度和高度的比例)。意思就是說,這可能會在圖像頂邊或底邊處產生空白邊界,但是圖像本身不會被扭曲變形。不選該選項的話,圖像可能會產生輕微的扭曲變形,但優點是不會出現空白邊界。
介面外觀
用來控制介面外觀輸出之選項
- --asciiize
- Transliterate Unicode characters to an ASCII representation. Use with care
because this will replace Unicode characters with ASCII. For instance it
will replace "Pelé" with
"Pele". Also, note that in cases where there are
multiple representations of a character (characters shared by Chinese and
Japanese for instance) the representation based on the current calibre
interface language will be used.
- --base-font-size
- The base font size in pts. All font sizes in the produced book will be
rescaled based on this size. By choosing a larger size you can make the
fonts in the output bigger and vice versa. By default, when the value is
zero, the base font size is chosen based on the output profile you
chose.
- --change-justification
- 更改文本對齊方式。
使用值"left"
將轉換資源中所有的文本為左對齊。
(如:未對齊)
使用值"justify"
將轉換資源中所有的未對齊的文本為對齊。使用值"original"(預設)則不更改源檔案的對齊方式。請注意,僅部分輸出格式支持對齊方式。
- --embed-all-fonts
- Embed every font that is referenced in the input document but not already
embedded. This will search your system for the fonts, and if found, they
will be embedded. Embedding will only work if the format you are
converting to supports embedded fonts, such as EPUB, AZW3, DOCX or PDF.
Please ensure that you have the proper license for embedding the fonts
used in this document.
- --embed-font-family
- 在書中嵌入指定字型。這指定了書中使用的「基礎」字型。如果輸入檔案自己指定了字型,就有可能覆蓋這個基礎字型。您可以使用過濾樣式資訊的選項來去除輸入檔案的字型。注意,字型嵌入只在一些輸出格式中有用,主要是
EPUB、AZW3 和 DOCX。
- --expand-css
- 預設情況下,calibre
將使用各種CSS屬性的簡寫形式,如邊距、填充、邊框等。此選項將使用完整的展開形式。注意,在產生EPUB檔案時,由於Nook不能處理速記CSS,所以將輸出設定檔案設定為Nook設定檔案中的一個,CSS總是被展開的。
- CSS 樣式表或原生 CSS
的路徑。這個 CSS
會添加到來源檔案的樣式規則中,因此可以用來覆蓋那些規則。
- --filter-css
- 以逗號分隔的 CSS
屬性列表,將移除所有
CSS
樣式規則。這是非常有用的,如果存在的一些樣式信息,防止覆蓋您的的設備上的樣式信息。例如:字體系列,顏色,左邊距,右邊距
- --font-size-mapping
- 將 CSS
字型名稱映射到字型大小(以
pts
計)。舉例來說您可以設為
12,12,14,16,18,20,22,24。這些設定值的對應會從
xx-small 到
xx-large,最後一個大小就會是最大的字型。字型縮放演算法會使用這些大小來適當的縮放字型。預設使用的映射方式是以您所選擇的輸出設定檔為準。
- --keep-ligatures
- 保留輸入文件中的「印刷連字」。所謂「印刷連字」是指對於ff,
fi,
fl之類的字母組合的一種特殊的展示方式。大部分閱讀器在使用預設字體時無法支持「印刷連字」,所以常常無法正常顯示。預設情況下,calibre會把「印刷連字」轉換成對應的字母組合。本選項用於選擇保留「印刷連字」。
- --line-height
- pt
行高。控制兩行高度距離。僅僅適用於未定義行高的元素。大多數情況下,最小行高值更加有用。預設不進行行高操控。
- --linearize-tables
- 有些設計不良的檔案會使用表格來控制頁面文字的排版。在轉換這些檔案時常會發生文字超出頁面的問題。這個選項會將表格的內容讀取出來,並重新以直線的方式呈現它。
- --margin-bottom
- Set the bottom margin in pts. Default is 5.0. Setting this to less than
zero will cause no margin to be set (the margin setting in the original
document will be preserved). Note: Page oriented formats such as PDF and
DOCX have their own margin settings that take precedence.
- --margin-left
- Set the left margin in pts. Default is 5.0. Setting this to less than zero
will cause no margin to be set (the margin setting in the original
document will be preserved). Note: Page oriented formats such as PDF and
DOCX have their own margin settings that take precedence.
- --margin-right
- Set the right margin in pts. Default is 5.0. Setting this to less than
zero will cause no margin to be set (the margin setting in the original
document will be preserved). Note: Page oriented formats such as PDF and
DOCX have their own margin settings that take precedence.
- --margin-top
- Set the top margin in pts. Default is 5.0. Setting this to less than zero
will cause no margin to be set (the margin setting in the original
document will be preserved). Note: Page oriented formats such as PDF and
DOCX have their own margin settings that take precedence.
- --minimum-line-height
- 最小行高,元素字體計算值的百分比。calibre
將保證行中所有元素至少有此高度,無論輸入文件如何定義。設為零即禁用。預設
120%。首選項中也有此設定,請注意。否則可能出現雙倍行高,達
240%。
- --smarten-punctuation
- Convert plain quotes, dashes and ellipsis to their typographically correct
equivalents. For details, see
https://daringfireball.net/projects/smartypants.
- --transform-css-rules
- 包含轉換本書中 CSS
樣式規則的檔案路徑。建立這樣一個檔案的最簡單方法是在
calibre GUI
中使用精靈建立規則。在「介面外觀
->
轉換風格」的轉換對話框部分存取它。
一旦建立規則,就可以使用「匯出」按鈕將它們儲存到檔案中。
- --transform-html-rules
- Path to a file containing rules to transform the HTML in this book. The
easiest way to create such a file is to use the wizard for creating rules
in the calibre GUI. Access it in the "Look &
feel->Transform HTML" section of the conversion dialog.
Once you create the rules, you can use the
"Export" button to save them to a file.
探索式處理
使用一般樣式修改文件文字與結構。預設為停用。使用
--enable-heuristics
啟用。個別動作可以
--disable-* 選項停用。
- --html-unwrap-factor
- 決定一行字元是否能成為一個新的段落的因子,有效值為
0 到 1
之間的小數,預設值是
0.4,即略小於半行的長度。如果文件中只有很少的行需要消除段落內換行,應當減小這個設定值。
搜尋與取代
以使用者定義的形式修改文件文字與結構。
- --search-replace
- 包含搜尋和取代正規表達式的檔案路徑。該檔案必須包含正規表達式交替行後面跟著取代模式
(它可以是一個空行)。正規表達式必須是
Python
正規表達式的語法並且檔案必須是
UTF-8 編碼。
結構偵測
控制文件結構的自動偵測。
- --chapter
- An XPath expression to detect chapter titles. The default is to consider
<h1> or <h2> tags that contain the words
"chapter", "book",
"section", "prologue",
"epilogue" or "part" as
chapter titles as well as any tags that have
class="chapter". The expression used must evaluate
to a list of elements. To disable chapter detection, use the expression
"/". See the XPath Tutorial in the calibre User
Manual for further help on using this feature.
- --chapter-mark
- 指定如何標記偵測到的章節。「pagebreak」(分頁)會在每個章節前插入分頁符號。「rule」(水平線)會在每個章節前插入水平線。「none」(沒有)會停用章節的標記。「both」(兩者)則會同時加入分頁符號及水平線來標記章節。
- --insert-metadata
- Insert the book metadata at the start of the book. This is useful if your
e-book reader does not support displaying/searching metadata
directly.
- --remove-first-image
- Remove the first image from the input e-book. Useful if the input document
has a cover image that is not identified as a cover. In this case, if you
set a cover in calibre, the output document will end up with two cover
images if you do not specify this option.
- --start-reading-at
- 用於偵測文件中開始閱讀位置的
XPath
運算式。某些電子書閱讀器
(以 Kindle 為代表)
使用此定位標識來開啟書籍。請參閱
calibre 使用者手冊中的 XPath
教學了解使用此功能的更多幫助。
目錄
控制目錄頁的自動產生過程。預設情況下,如果來源檔案有目錄頁,它會優先使用而不自動產生。
- --level1-toc
- 指定應添加到目錄級別1的所有標籤的
XPath
表達式。如果指定此項,它會優先於其他自動檢測形式。可查閱
calibre 使用者手冊中的 XPath
向導。
- --level2-toc
- XPath
運算式指定所有標籤應添加在二級目錄表。每個條目加入到一級目錄條目下。請參閱
calibre 使用者手冊中 XPath
教學的例子。
- --level3-toc
- XPath
運算式指定所有標籤應添加在三級目錄表。每個條目加入到二級目錄條目下。請參閱
calibre 使用者手冊中 XPath
教學的例子。
- --max-toc-links
- 插入目錄頁的連結最大數量。設定為
0
代表停用。預設值:50。只有在偵測到的章節數目少於這個臨界值時才會把連結加入目錄頁中。
詮釋資料
設定輸出的詮釋資料選項
- --series-index
- 這個書本在系列裡的索引。
除錯
轉換至偵錯模式的相關選項
- --debug-pipeline,
-d
- Save the output from different stages of the conversion pipeline to the
specified folder. Useful if you are unsure at which stage of the
conversion process a bug is occurring.