Create epub version 3.0 in bookdown?

Hi everyone! I'm in bookdown, trying to output an epub that is compatible with epub 3.0, and I'm totally stuck.

In my _output.yaml I have:

bookdown::epub_book:
epub_version: epub3

and it compiles and exports fine but the online publisher is rejecting the file, with the following errors:

ERROR(RSC-005): .tmp.tmpzwj5eul4.epub/EPUB.nav.xhtml(19,9): Error while parsing file: element "ol" incomplete; missing required element "li"

ERROR(RSC-005): .tmp.tmpzwj5eul4.epub/EPUB.text.ch003.xhtml(20,9): Error while parsing file: element "center" not allowed here; expected the element end-tag, text, element "a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "br", "button", "canvas", "cite", "code", "data", "datalist", "del", "details", "dfn", "dialog", "div", "dl", "em", "embed", "epub:switch", "epub:trigger", "fieldset", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "i", "iframe", "img", "input", "ins", "kbd", "label", "link", "main", "map", "mark", "menu", "meta", "meter", "nav", "ns1:math", "ns2:svg", "object", "ol", "output", "p", "picture", "pre", "progress", "q", "ruby", "s", "samp", "script", "section", "select", "small", "span", "strong", "sub", "sup", "table", "template", "textarea", "time", "u", "ul", "var", "video" or "wbr" (with xmlns:ns1="MathML Namespace" xmlns:ns2="SVG namespace") or an element from another namespace

I have also tried adding:

epub_book(fig_width = 5, fig_height = 4, dev = "png", 
  fig_caption = TRUE, number_sections = TRUE, toc = FALSE, 
  toc_depth = 3, stylesheet = NULL, cover_image = NULL, 
  metadata = NULL, chapter_level = 1, epub_version = c("epub3", 
    "epub"), md_extensions = NULL, pandoc_args = NULL, 
  template = "default")

in the .yaml and the index.rmd but it just creates errors, I assume because I am putting it in the wrong place? Thank you, community.

1 Like

Update: it looks like this is actually a problem with online epub validators becoming more strict about their processes. I found a blog post about it here: https://community.adobe.com/t5/indesign/fixed-layout-epub-exported-by-indesign-fails-validation-in-epub-checker-v4-1-1/td-p/10332976?page=1

To figure this out, I created a new bookdown project, rendered the book using the default values, and uploaded the epub to two different epub validator websites (like http://validator.idpf.org/application/validate), which both gave the same error shown in the blog post linked above: "Line 19, position 9: Error while parsing file: element "ol" incomplete; missing required element "li""

I also confirmed that the default version for the epub function is epub3, so that wasn't the problem at all.

Thanks for going with me on this journey.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.