calibre - en to zh_CN translation catalogue (90 entries)

en: E-book conversion
zh_CN: 电子书转换

en: calibre has a conversion system that is designed to be very easy to use. Normally, you just add a book to calibre, click convert and calibre will try hard to generate output that is as close as possible to the input. However, calibre accepts a very large number of input formats, not all of which are as suitable as others for conversion to e-books. In the case of such input formats, or if you just want greater control over the conversion system, calibre has a lot of options to fine tune the conversion process. Note however that calibre's conversion system is not a substitute for a full blown e-book editor. To edit e-books, I recommend first converting them to EPUB or AZW3 using calibre and then using the :guilabel:`Edit book` feature to get them into perfect shape. You can then use the edited e-book as input for conversion into other formats in calibre.
zh_CN: calibre 拥有一个易于使用的格式转换系统。一般情况下，您只需将一本图书添加到 calibre 中，单击“转换书籍”，calibre 就会自动尝试生成符合或近似于原始输入的输出文件。然而，尽管 calibre 可接受多种格式的文件进行转换，但并非所有格式都可以自动且无瑕地转换为其它电子书格式。对于转换过程中出现问题的文件格式，抑或是您只是想对图书转换过程进行自定义调整，calibre 提供多个选项来自定义图书转换过程。但请注意，calibre 的图书转换系统并不能替代功能完备的电子书编辑器。要编辑电子书，我建议先使用 calibre 把它们转换为 epub 或 azw3 格式，然后使用“编辑书籍”功能进行编辑，再使用编辑后的电子书作为源文件转换成其它格式。

en: This document will refer mainly to the conversion settings as found in the conversion dialog, pictured below. All these settings are also available via command line interface to conversion, documented at :doc:`generated/en/ebook-convert`. In calibre, you can obtain help on any individual setting by holding your mouse over it, a tooltip will appear describing the setting.
zh_CN: 本文档将主要考虑能在转换对话框中找到的转换设置，如下图所示。 所有这些设置也可以通过命令行界面进行转换，文档在 `generated/zh-CN/ebook-convert` 中。 在 Calibre 中，您可以通过将鼠标悬停在任何单独的设置上来获取帮助，然后会出现一个工具提示来描述该设置。

en: E-book conversion dialog
zh_CN: 电子书转换对话

en: Contents
zh_CN: 目录

en: Introduction
zh_CN: 介绍

en: The first thing to understand about the conversion system is that it is designed as a pipeline. Schematically, it looks like this:
zh_CN: 对转换系统，首先要了解的是它被设计为管道。从示意图上看，它看起来像这样：

en: The conversion pipeline
zh_CN: 转换通道

en: The input format is first converted to XHTML by the appropriate *Input plugin*. This HTML is then *transformed*. In the last step, the processed XHTML is converted to the specified output format by the appropriate *Output plugin*. The results of the conversion can vary greatly, based on the input format. Some formats convert much better than others. A list of the best source formats for conversion is available :ref:`here <best-source-formats>`.
zh_CN: 输入首先被恰当的*Input 插件*转换到 XHTML 。 HTML 接着被*转换*。在最后一步，已处理的XHTML通过适当的*Output 插件*转换为指定的输出格式。根据输入格式的不同，转换的结果可能会有很大的差异。 有些格式的转换效果要好于其他格式。 `这里<best-source-formats>`提供了最佳的转换源格式列表。

en: The transforms that act on the XHTML output are where all the work happens. There are various transforms, for example, to insert book metadata as a page at the start of the book, to detect chapter headings and automatically create a Table of Contents, to proportionally adjust font sizes, et cetera. It is important to remember that all the transforms act on the XHTML output by the *Input plugin*, not on the input file itself. So, for example, if you ask calibre to convert an RTF file to EPUB, it will first be converted to XHTML internally, the various transforms will be applied to the XHTML and then the *Output plugin* will create the EPUB file, automatically generating all metadata, Table of Contents, et cetera.
zh_CN: 所有工作都发生在作用于HTML输出的转换上。有各种转换，例如，在书籍开头插入书籍元数据作为页面、检测章节标题并自动创建目录、按比例调整字体大小等。重要的是要记住，所有的转换都作用于*Input插件*的XHTML输出，而不是作用于输入文件本身。因此，例如，如果您要求calibre将RTF文件转换为EPUB，它将首先在内部转换为XHTML，各种转换将应用于XHTML，然后*Output插件*将创建EPUB文件，自动生成所有元数据、目录等。

en: You can see this process in action by using the debug option |dbgi|. Just specify the path to a folder for the debug output. During conversion, calibre will place the XHTML generated by the various stages of the conversion pipeline in different sub-folders. The four sub-folders are:
zh_CN: 您可以通过使用调试选项 |dbgi| 查看此过程的实际情况。只需指定调试输出文件夹的路径即可。在转换过程中，calibre会将转换通道各个阶段生成的HTML放置在不同的子文件夹中。四个子文件夹是：

en: Debug icon
zh_CN: 调试图标

en: Stages of the conversion pipeline
zh_CN: 转换通道的阶段

en: Folder
zh_CN: 文件名

en: Description
zh_CN: 描述

en: input
zh_CN: 输入

en: This contains the HTML output by the Input plugin. Use this to debug the Input plugin.
zh_CN: 其中包含输入插件输出的HTML。使用此来调试输入插件。

en: parsed
zh_CN: 已解析

en: The result of pre-processing and converting to XHTML the output from the Input plugin. Use to debug structure detection.
zh_CN: 对输入插件的输出进行预处理并将其转换为 XHTML 的结果。用于调试结构检测。

en: structure
zh_CN: 结构

en: Post structure detection, but before CSS flattening and font size conversion. Use to debug font size conversion and CSS transforms.
zh_CN: 结构检测后，CSS 扁平化和字体大小转换之前。用于调试字体大小转换和 CSS 变换。

en: processed
zh_CN: 已处理

en: If you want to edit the input document a little before having calibre convert it, the best thing to do is edit the files in the :file:`input` sub-folder, then zip it up, and use the ZIP file as the input format for subsequent conversions. To do this use the :guilabel:`Edit meta information` dialog to add the ZIP file as a format for the book and then, in the top left corner of the conversion dialog, select ZIP as the input format.
zh_CN: 如果您想在进行Calibre转换之前对输入文档进行一点编辑，最好的做法是编辑“输入”子文件夹中的文件，然后将其压缩，并使用Zip文件作为后续转换的输入格式。为此，请使用“编辑Meta信息”对话框将Zip文件添加为书籍的格式，然后在转换对话框的左上角选择Zip作为输入格式。

en: This document will deal mainly with the various transforms that operate on the intermediate XHTML and how to control them. At the end are some tips specific to each input/output format.
zh_CN: 本文档主要介绍对中间 XHTML 进行的各种转换以及如何控制它们。最后会针对每种输入/输出格式提供一些技巧。

en: Look & feel
zh_CN: 界面外观

en: Fonts
zh_CN: 字体

en: One of the nicest features of the e-reading experience is the ability to easily adjust font sizes to suit individual needs and lighting conditions. calibre has sophisticated algorithms to ensure that all the books it outputs have a consistent font sizes, no matter what font sizes are specified in the input document.
zh_CN: 电子阅读体验最棒的特点之一是能够轻松调整字体大小以适应个人需求和照明条件。calibre有复杂的算法来确保它输出的所有书籍都有一致的字体大小，无论输入文档中指定了什么字体大小。

en: The base font size of a document is the most common font size in that document, i.e., the size of the bulk of text in that document. When you specify a :guilabel:`Base font size`, calibre automatically rescales all font sizes in the document proportionately, so that the most common font size becomes the specified base font size and other font sizes are rescaled appropriately. By choosing a larger base font size, you can make the fonts in the document larger and vice versa. When you set the base font size, for best results, you should also set the font size key.
zh_CN: 文档的基本字体大小是该文档中最常见的字体大小，即该文档中大部分文本的大小。当您指定“基本字体大小”时，Calibre会自动按比例重新缩放文档中的所有字体大小，以便最常见的字体大小成为指定的基本字体大小，并适当地重新缩放其他字体大小。通过选择更大的基本字体大小，您可以使文档中的字体更大，反之亦然。当您设置基本字体大小时，为了获得最佳效果，您还应该设置字体大小键。

en: The :guilabel:`Font size key` option lets you control how non-base font sizes are rescaled. The font rescaling algorithm works using a font size key, which is simply a comma-separated list of font sizes. The font size key tells calibre how many "steps" bigger or smaller a given font size should be compared to the base font size. The idea is that there should be a limited number of font sizes in a document. For example, one size for the body text, a couple of sizes for different levels of headings and a couple of sizes for super/sub scripts and footnotes. The font size key allows calibre to compartmentalize the font sizes in the input documents into separate "bins" corresponding to the different logical font sizes.
zh_CN: “字体大小键”选项允许您控制如何重新缩放非基本字体大小。字体重新缩放算法使用字体大小键工作，该键只是一个逗号分隔的字体大小列表。字体大小键告诉口径，给定字体大小与基本字体大小相比应该增大或减小多少个“台阶”。其想法是文档中的字体大小应该有限。例如，正文文本有一种尺寸，不同级别的标题有几种尺寸，超/子脚本和脚注有几种尺寸。字体大小键允许Calibre将输入文档中的字体大小划分为与不同逻辑字体大小相对应的单独“箱”。

en: Let's illustrate with an example. Suppose the source document we are converting was produced by someone with excellent eyesight and has a base font size of 8pt. That means the bulk of the text in the document is sized at 8pts, while headings are somewhat larger (say 10 and 12pt) and footnotes somewhat smaller at 6pt. Now if we use the following settings::
zh_CN: 让我们举个例子来说明。假设我们正在转换的源文档是由视力极佳的人生成的，基本字体大小为8pt。这意味着文档中的大部分文本大小为8pt，而标题稍大（比如10和12pt），脚注稍小，为6pt。现在，如果我们使用以下设置：

en: The largest headings will now become 18pt, while the footnotes will become 9pt. You can play with these settings to try and figure out what would be optimum for you by using the font rescaling wizard, which can be accessed by clicking the little button next to the :guilabel:`Font size key` setting.
zh_CN: 最大的标题现在将变为18pt，而脚注将变为9pt。您可以使用字体重新缩放向导来尝试使用这些设置，并找出最适合您的设置，单击“字体大小键”设置旁边的小按钮即可访问该向导。

en: A related setting is :guilabel:`Line height`. Line height controls the vertical height of lines. By default, (a line height of 0), no manipulation of line heights is performed. If you specify a non-default value, line heights will be set in all locations that don't specify their own line heights. However, this is something of a blunt weapon and should be used sparingly. If you want to adjust the line heights for some section of the input, it's better to use the :ref:`Extra CSS <extra-css>`.
zh_CN: 一个相关的设置是“行高度”。行高度控制线的垂直高度。默认情况下（线高度为0），不执行行高度操作。如果指定非默认值，则将在所有未指定自己的行高度的位置设置行高度。然而，这是一种钝器，应该谨慎使用。如果你想调整输入的某些部分的行高，最好使用“Extra CSS <extra-css>”。

en: Text
zh_CN: 文本

en: Text can be either justified or not. Justified text has extra spaces between words to give a smooth right margin. Some people prefer justified text, others do not. Normally, calibre will preserve the justification in the original document. If you want to override it you can use the :guilabel:`Text justification` option in this section.
zh_CN: 文本可以是合理的，也可以是不合理的。对齐的文本在单词之间有额外的空格，以提供平滑的右边距。有些人更喜欢合理的文本，而另一些人则不喜欢。通常，Calibre会保留原始文档中的理由。如果你想覆盖它，你可以使用本节中的“文本对齐”选项。

en: You can also tell calibre to :guilabel:`Smarten punctuation` which will replace plain quotes, dashes and ellipses with their typographically correct alternatives. Note that this algorithm is not perfect so it is worth reviewing the results. The reverse, namely, :guilabel:`Unsmarted punctuation` is also available.
zh_CN: 您还可以将calibre改为“智能标点符号”，这将用排版正确的替代品替换纯引号、破折号和省略号。请注意，此算法并不完美，因此值得查看结果。反过来，也可以使用“非智能标点符号”。

en: Finally, there is :guilabel:`Input character encoding`.  Older documents sometimes don't specify their character encoding. When converted, this can result in non-English characters or special characters like smart quotes being corrupted.  calibre tries to auto-detect the character encoding of the source document, but it does not always succeed. You can force it to assume a particular character encoding by using this setting.  `cp1252` is a common encoding for documents produced using Windows software. You should also read :ref:`char-encoding-faq` for more on encoding issues.
zh_CN: 最后是“输入字符编码”。旧文档有时不指定其字符编码。转换时，这可能会导致非英语字符或智能引号等特殊字符损坏。calibre尝试自动检测源文档的字符编码，但并不总是成功。您可以使用此设置强制它采用特定的字符编码`cp1252`是使用Windows软件生成的文档的常见编码。您还应该阅读“char encoding faq”以了解有关编码问题的更多信息。

en: Layout
zh_CN: 布局

en: Normally, paragraphs in XHTML are rendered with a blank line between them and no leading text indent. calibre has a couple of options to control this. :guilabel:`Remove spacing between paragraphs` forcefully ensure that all paragraphs have no inter paragraph spacing. It also sets the text indent to 1.5em (can be changed) to mark the start of every paragraph. :guilabel:`Insert blank line` does the opposite, guaranteeing that there is exactly one blank line between each pair of paragraphs. Both these options are very comprehensive, removing spacing, or inserting it for *all* paragraphs (technically <p> and <div> tags). This is so that you can just set the option and be sure that it performs as advertised, irrespective of how messy the input file is. The one exception is when the input file uses hard line breaks to implement inter-paragraph spacing.
zh_CN: 通常，XHTML中的段落之间会有一个空行，并且没有前导文本缩进。calibre有几个选项可以控制这一点`删除段落之间的间距，强制确保所有段落没有段落间间距。它还将文本缩进设置为1.5em（可以更改），以标记每个段落的开头`插入空白行则相反，保证每对段落之间只有一行空白。这两个选项都非常全面，可以删除空格，也可以为所有段落（技术上为<p>和<div>标签）插入空格。这样，无论输入文件有多乱，您都可以设置该选项并确保其按广告执行。一个例外是，当输入文件使用硬换行符来实现段落间间距时。

en: Another useful options is :guilabel:`Linearize tables`.  Some badly designed documents use tables to control the layout of text on the page.  When converted these documents often have text that runs off the page and other artifacts. This option will extract the content from the tables and present it in a linear fashion.  Note that this option linearizes *all* tables, so only use it if you are sure the input document does not use tables for legitimate purposes, like presenting tabular information.
zh_CN: 另一个有用的选项是“线性化表”。一些设计糟糕的文档使用表格来控制页面上文本的布局。转换后，这些文档通常会有溢出页面的文本和其他工件。此选项将从表中提取内容并以线性方式呈现。请注意，此选项将*所有*表线性化，因此只有在您确定输入文档没有将表用于合法目的（如显示表格信息）时才使用它。

en: Styling
zh_CN: 样式

en: The :guilabel:`Extra CSS` option allows you to specify arbitrary CSS that will be applied to all HTML files in the input. This CSS is applied with very high priority and so should override most CSS present in the **input document** itself. You can use this setting to fine tune the presentation/layout of your document. For example, if you want all paragraphs of class `endnote` to be right aligned, just add::
zh_CN: “Extra CSS”选项允许您指定将应用于输入中所有HTML文件的任意CSS。此CSS具有很高的优先级，因此应该覆盖**输入文档**本身中存在的大多数CSS。您可以使用此设置微调文档的演示文稿/布局。例如，如果你想让`endnote`类的所有段落都对齐，只需添加：

en: Transform styles
zh_CN: 改变样式

en: Page setup
zh_CN: 页面设置

en: The :guilabel:`Page setup` options are for controlling screen layout, like margins and screen sizes. There are options to setup page margins, which will be used by the output plugin, if the selected output format supports page margins. In addition, you should choose an Input profile and an output profile. Both sets of profiles basically deal with how to interpret measurements in the input/output documents, screen sizes and default font rescaling keys.
zh_CN: “页面设置”选项用于控制屏幕布局，如边距和屏幕大小。如果所选输出格式支持页边距，则有设置页边距的选项，输出插件将使用这些选项。此外，您应该选择输入配置文件和输出配置文件。这两组配置文件基本上都涉及如何解释输入/输出文档中的测量值、屏幕大小和默认字体缩放键。

en: If you know that the file you are converting was intended to be used on a particular device/software platform, choose the corresponding input profile, otherwise just choose the default input profile. If you know the files you are producing are meant for a particular device type, choose the corresponding output profile. Otherwise, choose one of the Generic output profiles. If you are converting to MOBI or AZW3 then you will almost always want to choose one of the Kindle output profiles. Otherwise, your best bet for modern E-book reading devices is to choose the :guilabel:`Generic e-ink HD` output profile.
zh_CN: 如果您知道要转换的文件是要在特定设备/软件平台上使用的，请选择相应的输入配置文件，否则只需选择默认输入配置文件。如果您知道您正在生成的文件是针对特定设备类型的，请选择相应的输出配置文件。否则，请选择一个通用输出配置文件。如果你正在转换为MOBI或AZW3，那么你几乎总是想选择一个Kindle输出配置文件。否则，您对现代电子书阅读设备的最佳选择是选择“通用电子墨水HD”输出配置文件。

en: Heuristic processing
zh_CN: 智能处理

en: Heuristic processing provides a variety of functions which can be used to try and detect and correct common problems in poorly formatted input documents.  Use these functions if your input document suffers from poor formatting. Because these functions rely on common patterns, be aware that in some cases an option may lead to worse results, so use with care.  As an example, several of these options will remove all non-breaking-space entities, or may include false positive matches relating to the function.
zh_CN: 启发式处理提供了各种功能，可用于尝试检测和纠正格式不佳的输入文档中的常见问题。如果您的输入文档格式不佳，请使用这些功能。由于这些函数依赖于常见模式，请注意，在某些情况下，选项可能会导致更糟糕的结果，因此请谨慎使用。例如，其中几个选项将删除所有不间断空格实体，或者可能包括与函数相关的误报匹配。

en: Enabling this option will cause calibre to attempt to detect and correct hard line breaks that exist within a document using punctuation clues and line length. calibre will first attempt to detect whether hard line breaks exist, if they do not appear to exist calibre will not attempt to unwrap lines. The line-unwrap factor can be reduced if you want to 'force' calibre to unwrap lines.
zh_CN: 启用此选项将导致calibre尝试使用标点符号线索和行长来检测和纠正文档中存在的硬换行。calibre将首先尝试检测是否存在硬线断裂，如果它们似乎不存在，calibre不会尝试解开线。如果你想“强制”口径打开线，可以降低线打开系数。

en: This option controls the algorithm calibre uses to remove hard line breaks. For example, if the value of this option is 0.4, that means calibre will remove hard line breaks from the end of lines whose lengths are less than the length of 40% of all lines in the document. If your document only has a few line breaks which need correction, then this value should be reduced to somewhere between 0.1 and 0.2.
zh_CN: 此选项控制用于删除硬换行符的算法口径。例如，如果此选项的值为0.4，则意味着calibre将从长度小于文档中所有行的40%的行的末尾删除硬换行符。如果你的文档只有几个需要更正的换行符，那么这个值应该减少到0.1到0.2之间。

en: This function will not create a TOC, but in many cases it will cause calibre's default chapter detection settings to correctly detect chapters and build a TOC.  Adjust the XPath under Structure detection if a TOC is not automatically created.  If there are no other headings used in the document then setting "//h:h2" under Structure detection would be the easiest way to create a TOC for the document.
zh_CN: 此函数不会创建目录，但在许多情况下，它会导致calibre的默认章节检测设置正确检测章节并构建目录。如果未自动创建目录，请调整“结构检测”下的XPath。如果文档中没有使用其他标题，那么在结构检测下设置“//h:h2”将是为文档创建目录的最简单方法。

en: This option will cause calibre to analyze blank lines included within the document.  If every paragraph is interleaved with a blank line, then calibre will remove all those blank paragraphs.  Sequences of multiple blank lines will be considered scene breaks and retained as a single paragraph. This option differs from the :guilabel:`Remove paragraph spacing` option under :guilabel:`Look and Feel` in that it actually modifies the HTML content, while the other option modifies the document styles.  This option can also remove paragraphs which were inserted using calibre's :guilabel:`Insert blank line` option.
zh_CN: 此选项将使calibre分析文档中包含的空白行。如果每一段都有一个空行，那么calibre将删除所有这些空行。多个空行序列将被视为场景分割，并保留为单个段落。此选项与“外观”下的“删除段落间距”选项不同，因为它实际上修改了HTML内容，而另一个选项修改了文档样式。此选项还可以删除使用calibre的“插入空白行”选项插入的段落。

en: With this option calibre will attempt to detect common scene-break markers and ensure that they are center aligned. 'Soft' scene break markers, i.e. scene breaks only defined by extra white space, are styled to ensure that they will not be displayed in conjunction with page breaks.
zh_CN: 使用此选项，calibre将尝试检测常见的场景中断标记，并确保它们居中对齐。”“软”场景打断标记，即仅由额外空白定义的场景打断，被设置样式以确保它们不会与分页符一起显示。

en: In general you should avoid using HTML tags, calibre will discard any tags and use pre-defined markup.  <hr /> tags, i.e. horizontal rules, and <img> tags are exceptions.  Horizontal rules can optionally be specified with styles, if you choose to add your own style be sure to include the 'width' setting, otherwise the style information will be discarded.  Image tags can used, but calibre does not provide the ability to add the image during conversion, this must be done after the fact using the 'Edit book' feature.
zh_CN: 一般来说，你应该避免使用HTML标签，calibre会丢弃任何标签并使用预定义的标记。<hr />标签，即水平规则，<img>标签是例外。水平规则可以选择与样式一起指定，如果您选择添加自己的样式，请确保包含“宽度”设置，否则样式信息将被丢弃。可以使用图像标签，但calibre不提供在转换过程中添加图像的功能，这必须在事后使用“编辑书籍”功能完成。

en: calibre will analyze all hyphenated content in the document when this option is enabled.  The document itself is used as a dictionary for analysis.  This allows calibre to accurately remove hyphens for any words in the document in any language, along with made-up and obscure scientific words.  The primary drawback is words appearing only a single time in the document will not be changed.  Analysis happens in two passes, the first pass analyzes line endings.  Lines are only unwrapped if the word exists with or without a hyphen in the document.  The second pass analyzes all hyphenated words throughout the document, hyphens are removed if the word exists elsewhere in the document without a match.
zh_CN: 启用此选项后，calibre将分析文档中的所有连字符内容。文档本身被用作分析词典。这使得calibre能够准确地删除任何语言文档中任何单词的连字符，以及虚构和模糊的科学单词。主要缺点是文档中只出现一次的单词不会被更改。分析分两次进行，第一次分析线尾。只有当单词在文档中存在连字符或不存在连字符时，才会展开行。第二步分析整个文档中的所有连字符单词，如果单词在文档的其他地方不匹配，则删除连字符。

en: Search & replace
zh_CN: 搜索并替换

en: These options are useful primarily for conversion of PDF documents or OCR conversions, though they can also be used to fix many document specific problems. As an example, some conversions can leaves behind page headers and footers in the text. These options use regular expressions to try and detect headers, footers, or other arbitrary text and remove or replace them. Remember that they operate on the intermediate XHTML produced by the conversion pipeline. There is a wizard to help you customize the regular expressions for your document.  Click the magic wand beside the expression box, and click the 'Test' button after composing your search expression.  Successful matches will be highlighted in Yellow.
zh_CN: 这些选项主要用于PDF文档的转换或OCR转换，尽管它们也可用于解决许多特定于文档的问题。例如，一些转换可能会在文本中留下页眉和页脚。这些选项使用正则表达式来尝试检测页眉、页脚或其他任意文本，并删除或替换它们。请记住，它们对转换管道生成的中间XHTML进行操作。有一个向导可以帮助您自定义文档的正则表达式。单击表达式框旁边的魔杖，在编写搜索表达式后单击“测试”按钮。成功的比赛将以黄色突出显示。

en: The search works by using a Python regular expression. All matched text is simply removed from the document or replaced using the replacement pattern. The replacement pattern is optional, if left blank then text matching the search pattern will be deleted from the document.  You can learn more about regular expressions and their syntax at :ref:`regexptutorial`.
zh_CN: 搜索是通过使用Python正则表达式来实现的。所有匹配的文本都会从文档中删除或使用替换模式替换。替换模式是可选的，如果留空，则将从文档中删除与搜索模式匹配的文本。您可以在`regexptutorial`了解更多关于正则表达式及其语法的信息。

en: Structure detection
zh_CN: 结构检测

en: Structure detection involves calibre trying its best to detect structural elements in the input document, when they are not properly specified. For example, chapters, page breaks, headers, footers, etc. As you can imagine, this process varies widely from book to book. Fortunately, calibre has very powerful options to control this. With power comes complexity, but if once you take the time to learn the complexity, you will find it well worth the effort.
zh_CN: 结构检测涉及calibre在输入文档中未正确指定结构元素时，尽最大努力检测这些元素。例如，章节、分页符、页眉、页脚等。可以想象，这一过程因书而异。幸运的是，calibre有非常强大的选项来控制这一点。权力带来复杂性，但如果你花时间学习复杂性，你会发现这是值得的。

en: calibre has two sets of options for :guilabel:`chapter detection` and :guilabel:`inserting page breaks`. This can sometimes be slightly confusing, as by default, calibre will insert page breaks before detected chapters as well as the locations detected by the page breaks option. The reason for this is that there are often location where page breaks should be inserted that are not chapter boundaries. Also, detected chapters can be optionally inserted into the auto generated Table of Contents.
zh_CN: calibre有两组选项用于“章节检测”和“插入分页符”。这有时会有点令人困惑，因为默认情况下，calibre会在检测到的章节之前插入分页符，以及分页符选项检测到的位置。这样做的原因是，通常应该插入分页符的位置不是章节边界。此外，检测到的章节可以选择性地插入到自动生成的目录中。

en: calibre uses *XPath*, a powerful language to allow the user to specify chapter boundaries/page breaks. XPath can seem a little daunting to use at first, fortunately, there is a :ref:`XPath tutorial <xpath-tutorial>` in the User Manual. Remember that Structure detection operates on the intermediate XHTML produced by the conversion pipeline. Use the debug option described in the :ref:`conversion-introduction` to figure out the appropriate settings for your book. There is also a button for a XPath wizard to help with the generation of simple XPath expressions.
zh_CN: calibre使用*XPath*，这是一种强大的语言，允许用户指定章节边界/分页符。XPath一开始似乎有点让人望而生畏，幸运的是，用户手册中有一个“XPath教程<xpath-tutorial>”。请记住，结构检测是在转换管道通道生成的中间XHTML上进行的。使用“转换介绍”中描述的调试选项，为您的书找出合适的设置。还有一个XPath向导按钮，用于帮助生成简单的XPath表达式。

en: This expression is rather complex, because it tries to handle a number of common cases simultaneously. What it means is that calibre will assume chapters start at either `<h1>` or `<h2>` tags that have any of the words `(chapter, book, section or part)` in them or that have the `class="chapter"` attribute.
zh_CN: 这个表达式相当复杂，因为它试图同时处理许多常见情况。它的意思是，calibre将假设章节以"<h1>"或"<h2>"标签开头，这些标签中包含任何单词“（章、书、节或部分）”，或者具有“class=“chapter”属性。

en: Miscellaneous
zh_CN: 杂项

en: Sometimes, the source document you are converting includes the cover as part of the book, instead of as a separate cover. If you also specify a cover in calibre, then the converted book will have two covers. This option will simply remove the first image from the source document, thereby ensuring that the converted book has only one cover, the one specified in calibre.
zh_CN: 有时，您正在转换的源文档将封面作为书籍的一部分，而不是单独的封面。如果你也在Calibre中指定了封面，那么转换后的书将有两个封面。此选项将简单地从源文档中删除第一张图像，从而确保转换后的书籍只有一个封面，即Calibre中指定的封面。

en: Table of Contents
zh_CN: 目录

en: When the input document has a Table of Contents in its metadata, calibre will just use that. However, a number of older formats either do not support a metadata based Table of Contents, or individual documents do not have one. In these cases, the options in this section can help you automatically generate a Table of Contents in the converted e-book, based on the actual content in the input document.
zh_CN: 当输入文档的元数据中有目录时，calibre将仅使用该目录。然而，许多旧格式要么不支持基于元数据的目录，要么单个文档没有目录。在这些情况下，本节中的选项可以帮助您根据输入文档中的实际内容，在转换后的电子书中自动生成目录。

en: Using these options can be a little challenging to get exactly right. If you prefer creating/editing the Table of Contents by hand, convert to the EPUB or AZW3 formats and select the checkbox at the bottom of the Table of Contents section of the conversion dialog that says :guilabel:`Manually fine-tune the Table of Contents after conversion`. This will launch the ToC Editor tool after the conversion. It allows you to create entries in the Table of Contents by simply clicking the place in the book where you want the entry to point. You can also use the ToC Editor by itself, without doing a conversion. Go to :guilabel:`Preferences->Interface->Toolbars` and add the :guilabel:`ToC Editor` to the main toolbar. Then just select the book you want to edit and click the :guilabel:`ToC Editor` button.
zh_CN: 使用这些选项可能有点难以做到完全正确。如果您更喜欢手动创建/编辑目录，请转换为EPUB或AZW3格式，并选中转换对话框目录部分底部的复选框，该复选框显示“转换后手动微调目录”。这将在转换后启动目录编辑器工具。它允许您在目录中创建条目，只需在书中单击条目指向的位置即可。您还可以单独使用目录编辑器，而无需进行转换。转到“首选项”->“界面”->“工具栏”，并将“目录编辑器”添加到主工具栏。然后，只需选择要编辑的书，然后单击“目录编辑器”按钮。

en: The default way that the creation of the auto generated Table of Contents works is that, calibre will first try to add any detected chapters to the generated table of contents. You can learn how to customize the detection of chapters in the :ref:`structure-detection` section above. If you do not want to include detected chapters in the generated table of contents, check the :guilabel:`Do not add detected chapters` option.
zh_CN: 创建自动生成的目录的默认方式是，calibre将首先尝试将任何检测到的章节添加到生成的目录中。您可以在上面的“结构检测”部分学习如何自定义章节的检测。如果您不想在生成的目录中包含检测到的章节，请选中“不添加检测到的章”选项。

en: If less than the :guilabel:`Chapter threshold` number of chapters were detected, calibre will then add any hyperlinks it finds in the input document to the Table of Contents. This often works well: many input documents include a hyperlinked Table of Contents right at the start. The :guilabel:`Number of links` option can be used to control this behavior. If set to zero, no links are added. If set to a number greater than zero, at most that number of links is added.
zh_CN: 创建自动生成的目录的默认方式是，calibre将首先尝试将任何检测到的章节添加到生成的目录中。您可以在上面的“结构检测”部分学习如何自定义章节的检测。如果您不想在生成的目录中包含检测到的章节，请选中“不添加检测到的章”选项。

en: calibre will automatically filter duplicates from the generated Table of Contents. However, if there are some additional undesirable entries, you can filter them using the :guilabel:`TOC Filter` option. This is a regular expression that will match the title of entries in the generated table of contents. Whenever a match is found, it will be removed. For example, to remove all entries titles "Next" or "Previous" use::
zh_CN: calibre将自动从生成的目录中过滤重复项。但是，如果有一些其他不需要的条目，您可以使用“目录过滤器”选项对其进行过滤。这是一个正则表达式，将与生成的目录中的条目标题相匹配。只要找到匹配项，它就会被删除。例如，要删除所有标题为“下一个”或“上一个”的条目，请使用：

en: The :guilabel:`Level 1,2,3 TOC` options allow you to create a sophisticated multi-level Table of Contents. They are XPath expressions that match tags in the intermediate XHTML produced by the conversion pipeline. See the :ref:`conversion-introduction` for how to get access to this XHTML. Also read the :ref:`xpath-tutorial`, to learn how to construct XPath expressions. Next to each option is a button that launches a wizard to help with the creation of basic XPath expressions. The following simple example illustrates how to use these options.
zh_CN: “1、2、3级目录”选项允许您创建复杂的多级目录。它们是XPath表达式，与转换管道生成的中间XHTML中的标签相匹配。有关如何访问此XHTML，请参阅“转换介绍”。还要阅读“xpath教程”，了解如何构造xpath表达式。每个选项旁边都有一个按钮，用于启动向导以帮助创建基本的XPath表达式。以下简单示例说明了如何使用这些选项。

en: You can also change settings in the conversion dialog for each book conversion. When you convert a book, calibre remembers the settings you used for that book, so that if you convert it again, the saved settings for the individual book will take precedence over the defaults set in :guilabel:`Preferences`. You can restore the individual settings to defaults by using the :guilabel:`Restore defaults` button in the individual book conversion dialog. You can remove the saved settings for a group of books by selecting all the books and then clicking the :guilabel:`Edit metadata` button to bring up the bulk metadata edit dialog, near the bottom of the dialog is an option to remove stored conversion settings.
zh_CN: 您还可以在转换对话框中更改每本书转换的设置。当你转换一本书时，calibre会记住你为那本书使用的设置，这样如果你再次转换它，为每本书保存的设置将优先于“首选项”中设置的默认值。您可以使用个人书籍转换对话框中的“恢复默认值”按钮将个人设置恢复为默认值。您可以通过选择所有书籍，然后单击“编辑元数据”按钮打开批量元数据编辑对话框来删除一组书籍的已保存设置，对话框底部附近有一个删除已存储转换设置的选项。

en: Note that the final settings for each book in a Bulk conversion will be saved and re-used if the book is converted again. Since the highest priority in Bulk Conversion is given to the settings in the Bulk conversion dialog, these will override any book specific settings. So you should only bulk convert books together that need similar settings. The exceptions are metadata and input format specific settings. Since the Bulk conversion dialog does not have settings for these two categories, they will be taken from book specific settings (if any) or the defaults.
zh_CN: 请注意，批量转换中每本书的最终设置将被保存，如果书籍再次转换，将重新使用。由于批量转换中的最高优先级赋予了批量转换对话框中的设置，因此这些设置将覆盖任何特定于书籍的设置。因此，您应该只批量转换需要类似设置的书籍。例外情况是元数据和输入格式特定的设置。由于“批量转换”对话框没有这两个类别的设置，因此将从特定于书籍的设置（如果有的话）或默认设置中获取。

en: Convert Microsoft Word documents
zh_CN: 转换Microsoft Word文档

en: For older .doc files, you can save the document as HTML with Microsoft Word and then convert the resulting HTML file with calibre. When saving as HTML, be sure to use the "Save as Web Page, Filtered" option as this will produce clean HTML that will convert well. Note that Word produces really messy HTML, converting it can take a long time, so be patient. If you have a newer version of Word available, you can directly save it as .docx as well.
zh_CN: 对于较旧的.doc文件，您可以使用Microsoft Word将文档另存为HTML，然后使用calibre转换生成的HTML文件。保存为HTML时，请务必使用“另存为网页，已过滤”选项，因为这将生成转换良好的干净HTML。请注意，Word生成的HTML非常混乱，转换它可能需要很长时间，所以请耐心等待。如果您有较新版本的Word可用，也可以直接将其另存为.docx。

en: Convert TXT documents
zh_CN: 转换文本文档

en: TXT documents have no well defined way to specify formatting like bold, italics, etc, or document structure like paragraphs, headings, sections and so on, but there are a variety of conventions commonly used.  By default calibre attempts automatic detection of the correct formatting and markup based on those conventions.
zh_CN: TXT文档没有明确的方式来指定格式，如粗体、斜体等，或文档结构，如段落、标题、章节等，但有各种常用的约定。默认情况下，calibre会尝试根据这些约定自动检测正确的格式和标记。

en: calibre also supports running TXT input though a transformation preprocessor known as Markdown. Markdown allows for basic formatting to be added to TXT documents, such as bold, italics, section headings, tables, lists, a Table of Contents, etc. Marking chapter headings with a leading # and setting the chapter XPath detection expression to "//h:h1" is the easiest way to have a proper table of contents generated from a TXT document. You can learn more about the Markdown syntax at `daringfireball <https://daringfireball.net/projects/markdown/syntax>`_.
zh_CN: calibre还支持通过名为Markdown的转换预处理器运行TXT输入。Markdown允许将基本格式添加到TXT文档中，如粗体、斜体、节标题、表格、列表、目录等。用前导#标记章节标题并将章节XPath检测表达式设置为“//h:h1”是从TXT文档生成正确目录的最简单方法。你可以在`daringfireball上了解更多关于Markdown语法的信息<https://daringfireball.net/projects/markdown/syntax>`_.

en: Convert PDF documents
zh_CN: 转换PDF文档

en: PDF documents are one of the worst formats to convert from. They are a fixed page size and text placement format. Meaning, it is very difficult to determine where one paragraph ends and another begins. calibre will try to unwrap paragraphs using a configurable, :guilabel:`Line un-wrapping factor`. This is a scale used to determine the length at which a line should be unwrapped. Valid values are a decimal between 0 and 1. The default is 0.45, just under the median line length. Lower this value to include more text in the unwrapping. Increase to include less. You can adjust this value in the conversion settings under :guilabel:`PDF Input`.
zh_CN: PDF文档是最难转换的格式之一。它们是固定的页面大小和文本放置格式。也就是说，很难确定一个段落在哪里结束，另一个段落从哪里开始。calibre将尝试使用可配置的“行解包因子”来解包段落。这是一个用于确定线应展开的长度的标尺。有效值是介于0和1之间的十进制数。默认值为0.45，刚好在中线长度下方。降低此值可在展开中包含更多文本。增加以包含更少。您可以在“PDF输入”下的转换设置中调整此值。

en: Also, they often have headers and footers as part of the document that will become included with the text. Use the :guilabel:`Search and replace` panel to remove headers and footers to mitigate this issue. If the headers and footers are not removed from the text it can throw off the paragraph unwrapping. To learn how to use the header and footer removal options, read :ref:`regexptutorial`.
zh_CN: 此外，它们通常有页眉和页脚作为文档的一部分，这些页眉和页脚将包含在文本中。使用“搜索和替换”面板删除页眉和页脚以缓解此问题。如果没有从文本中删除页眉和页脚，则可以取消段落展开。要了解如何使用页眉和页脚删除选项，请阅读“regexptutorial”。

en: Some limitations of PDF input are:
zh_CN: PDF输入限制:

en: Links and Tables of Contents are not supported
zh_CN: 链接和目录不支持

en: To enable automatic detection of chapters, you need to mark them with the built-in styles called :guilabel:`Heading 1`, :guilabel:`Heading 2`, ..., :guilabel:`Heading 6` (:guilabel:`Heading 1` equates to the HTML tag ``<h1>``, :guilabel:`Heading 2` to ``<h2>``, etc). When you convert in calibre you can enter which style you used into the :guilabel:`Detect chapters at` box. Example:
zh_CN: 要启用章节的自动侦测，您需要使用名为“标题 1”、“标题2”、…`标题6`的内置样式标记它们（“标题1”相当于HTML标签"<h1>"，“标题2”相当于"<h2>"，以此类推）。当你在Calibre中转换时，你可以在“检测章节”框中输入你使用的样式。例子：

en: In addition to this, you can specify the picture to use as the cover by naming it ``opf.cover`` (right click, Picture->Options->Name) in the ODT. If no picture with this name is found, the 'smart' method is used.  As the cover detection might result in double covers in certain output formats, the process will remove the paragraph (only if the only content is the cover!) from the document. But this works only with the named picture!
zh_CN: 除此之外，您还可以通过在ODT中将图片命名为“opf.cover”（右键单击，图片->选项->名称）来指定用作封面的图片。如果找不到具有此名称的图片，则使用“smart”方法。由于封面检测可能会导致某些输出格式出现双封面，因此该过程将从文档中删除该段落（仅当唯一内容是封面时！）。但这只适用于命名的图片！

en: Converting to PDF
zh_CN: 转换为PDF

en: The first, most important, setting to decide on when converting to PDF is the page size. By default, calibre uses a page size of "U.S. Letter". You can change this to another standard page size or a completely custom size in the :guilabel:`PDF Output` section of the conversion dialog. If you are generating a PDF to be used on a specific device, you can turn on the option to use the page size from the :guilabel:`output profile` instead. So if your output profile is set to Kindle, calibre will create a PDF with page size suitable for viewing on the small Kindle screen.
zh_CN: 转换为PDF时要决定的第一个也是最重要的设置是页面大小。默认情况下，calibre使用“U.S.Letter”的页面大小。您可以在转换对话框的“PDF输出”部分将其更改为另一个标准页面大小或完全自定义的大小。如果您正在生成要在特定设备上使用的PDF，则可以打开选项，使用“输出配置文件”中的页面大小。因此，如果您的输出配置文件设置为Kindle，calibre将创建一个页面大小适合在Kindle小屏幕上查看的PDF。

en: Headers and Footers
zh_CN: 页头和页脚

en: :code:`_SECTION_` is replaced by whatever the name of the current section is. These names are taken from the metadata Table of Contents in the document (the PDF Outline). If the document has no table of contents then it will be replaced by empty text. If a single PDF page has multiple sections, the first section on the page will be used. Similarly, there is a variable named :code:`_TOP_LEVEL_SECTION_` that can be used to get the name of the current top-level section.
zh_CN: `_SECTION_`替换为当前节的名称。这些名称取自文档中的元数据目录（PDF大纲）。如果文档没有目录，则将替换为空文本。如果单个PDF页面有多个部分，则将使用页面上的第一部分。同样，有一个名为“_TOP_LEVEL_SECTION_”的变量可用于获取当前顶级节的名称。

en: Printable Table of Contents
zh_CN: 可打印目录
