EPUB output do not have figure and table identifiers while compiling bookdown-demo book #42
Closed
Description
Steps to reproduce
-
Have Ubuntu 18.04.2 LTS installed
-
Install latest
pandoc-2.7.2-1-amd64.deb
withcd ~/Downloads wget https://github.com/jgm/pandoc/releases/download/2.7.2/pandoc-2.7.2-1-amd64.deb sudo apt install ./pandoc-2.7.2-1-amd64.deb
-
Install R with
sudo apt-get install r-base-dev
-
Launch R console to install
bookdown
package:$ R install.packages('bookdown')
-
Clone
bookdown-demo
repositorysudo apt-get install git git clone https://github.com/rstudio/bookdown-demo.git cd bookdown-demo
-
Compile the demo book to EPUB format
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"
-
Install
epubcheck
withsudo apt-get install epubcheck default-jre
and launch it against the compiled epub document:epubcheck _book/bookdown-demo.epub
Expected result - the produced EPUB document is correct and do not have errors
Actual result - the produced EPUB document has errors:
Validating using EPUB version 3.0.1 rules.
WARNING(ACC-009): _book/bookdown-demo.epub/EPUB/text/ch001.xhtml(82,446): MathML should either have an 'alttext' attribute or 'annotation-xml' child element.
ERROR(RSC-005): _book/bookdown-demo.epub/EPUB/text/ch002.xhtml(87,74): Error while parsing file 'value of attribute "width" is invalid; must be an integer'.
ERROR(RSC-012): _book/bookdown-demo.epub/EPUB/text/ch002.xhtml(82,247): Fragment identifier is not defined.
ERROR(RSC-012): _book/bookdown-demo.epub/EPUB/text/ch002.xhtml(92,123): Fragment identifier is not defined.
ERROR(RSC-012): _book/bookdown-demo.epub/EPUB/text/ch002.xhtml(92,252): Fragment identifier is not defined.
Check finished with errors
epubcheck completed
and user can't click on table and image references.
The problematic lines may be determined by unzipping epub and showing its contents:
cd _book
unzip bookdown-demo.epub
pluma EPUB/text/ch002.xhtml
$ awk 'NR==82' EPUB/text/ch002.xhtml
<p>You can label chapter and section titles using <code>{#label}</code> after them, e.g., we can reference Chapter <a href="#intro">2</a>. If you do not manually label them, there will be automatic labels anyway, e.g., Chapter <a href="#methods">4</a>.</p>
$ awk 'NR==92' EPUB/text/ch002.xhtml
<p>Reference a figure by its code chunk label with the <code>fig:</code> prefix, e.g., see Figure <a href="#fig:nice-fig">2.1</a>. Similarly, you can reference tables generated from <code>knitr::kable()</code>, e.g., see Table <a href="#tab:nice-tab">2.1</a>.</p>
Notes:
- Issue persists with Pandoc 1.19 from the repository.
- I'm not sure about correct component to report bug. Should it be
bookdown
,rmarkdown
,knitr
orpandoc
?
Metadata
Assignees
Labels
No labels