我的电子书中有章节和章节。第 1 节有一个概述页面,然后是第 1 章。当我从 Amazon 下载我的书时,它从第 1 章的开头开始,因此用户错过了前言和章节文本。
在 Amazon Kindle 发布指南 (https://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf) 的第 5.3 节中
它说“指南项是 EPUB 格式的可选功能,但强烈推荐。Kindle 提供对封面、TOC 和开始阅读位置(“转到开头”)指南项的支持。
我想指定“开始阅读”位置,但找不到如何执行此操作的示例。
这是怎么做的?
最佳答案
EPUB 图书只是一个 ZIP 文件,因此您可以解压缩它并查看里面的文件。我使用 bookdown
创建的示例 EPUB包含一个文件 content.opf
有了这个 <guide>
元素:
<guide>
<reference type="toc" title="A Minimal Book Example" href="nav.xhtml" />
</guide>
根据 https://ebookflightdeck.com/handbook/guide
cover
和 text
指南看起来像这样,其中 text
对应于“开始阅读位置”:<guide>
<reference type="cover" title="Cover Image" href="cover.xhtml"></reference>
<reference type="toc" title="Table of Contents" href="toc.xhtml"></reference>
<reference type="text" title="Startup Page" href="chapter1.xhtml"></reference>
</guide>
当然,显式
href
必须根据 EPUB 中的内容进行调整。或者,您可以使用 EPUB3 规则并添加
landmark
项目到nav.xhtml
,参见https://ebookflightdeck.com/handbook/landmarks .这里bodymatter
可能是需要的。这可能更合适,因为 bookdown
默认使用 EPUB3。在我使用 pandoc 2.2.1 生成的 EPUB 示例中,我再次获得了目录,但没有其他内容:<nav epub:type="landmarks" hidden="hidden">
<ol>
<li>
<a href="#toc" epub:type="toc">Table of contents</a>
</li>
</ol>
</nav>
为了让它工作,我必须使用:
bookdown::epub_book:
toc: yes
pandoc
>= 2.3 支持更好地支持指定电子书的不同部分 using the epub:type
attribute .不过,鉴于上述链接发布指南中的引用,我不确定这与 Kindle 产品的相关性:
Publishers do not need to define a start reading location because Amazon does this during the upload process.
关于r - 如何控制bookdown书的起始页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52321963/