Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphs/Charts are not showing up in the epub format #481

Closed
jerrythomas opened this issue Nov 8, 2017 · 8 comments
Closed

Graphs/Charts are not showing up in the epub format #481

jerrythomas opened this issue Nov 8, 2017 · 8 comments
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@jerrythomas
Copy link

Generated epub using the sample here https://github.com/rstudio/bookdown-demo.
I opened the epub using iBooks and I could not see the images. I extracted the generated files from the epub and noticed that the generated code expects the media folder to be within the EPUB folder but it is at the same level as the EPUB folder.

Changing

<img xmlns="http://www.w3.org/1999/xhtml" alt="Here is a nice figure!" width="80%" src="media/file0.png" />

to

<img xmlns="http://www.w3.org/1999/xhtml" alt="Here is a nice figure!" width="80%" src="../media/file0.png" />

resolves the issue.

Session info --------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.2 (2017-09-28)
 system   x86_64, darwin16.7.0        
 ui       RStudio (1.0.153)           
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       Asia/Kolkata                
 date     2017-11-08                  

Packages ------------------------------------------------------------------------------------------------------------
 package   * version    date       source                            
 backports   1.1.1      2017-09-25 CRAN (R 3.4.2)                    
 base64enc   0.1-3      2015-07-28 CRAN (R 3.4.2)                    
 bitops      1.0-6      2013-08-17 CRAN (R 3.4.2)                    
 bookdown    0.5        2017-08-20 CRAN (R 3.4.2)                    
 caTools     1.17.1     2014-09-10 CRAN (R 3.4.2)                    
 digest      0.6.12     2017-01-27 CRAN (R 3.4.2)                    
 evaluate    0.10.1     2017-06-24 CRAN (R 3.4.2)                    
 graphics  * 3.4.2      2017-09-29 local                             
 grDevices * 3.4.2      2017-09-29 local                             
 highr       0.6        2016-05-09 CRAN (R 3.4.2)                    
 htmltools   0.3.6      2017-04-28 CRAN (R 3.4.2)                    
 jsonlite    1.5        2017-06-01 CRAN (R 3.4.2)                    
 knitr       1.17       2017-08-10 CRAN (R 3.4.2)                    
 magrittr    1.5        2014-11-22 CRAN (R 3.4.2)                    
 markdown    0.8        2017-04-20 CRAN (R 3.4.2)                    
 methods   * 3.4.2      2017-09-29 local                             
 mime        0.5        2016-07-07 CRAN (R 3.4.2)                    
 Rcpp        0.12.13    2017-09-28 CRAN (R 3.4.2)                    
 rmarkdown   1.6.0.9009 2017-11-08 Github (rstudio/rmarkdown@6e68143)
 rprojroot   1.2        2017-01-16 CRAN (R 3.4.2)                    
 stats     * 3.4.2      2017-09-29 local                             
 stringi     1.1.5      2017-04-07 CRAN (R 3.4.2)                    
 stringr     1.2.0      2017-02-18 CRAN (R 3.4.2)                    
 tools       3.4.2      2017-09-29 local                             
 utils     * 3.4.2      2017-09-29 local                             
 yaml        2.1.14     2016-11-12 CRAN (R 3.4.2)                    
> rmarkdown::pandoc_version()
[1] ‘2.0.1.1’
> system('pdflatex --version')
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04
@yihui
Copy link
Member

yihui commented Nov 8, 2017

Duplicate of rstudio/bookdown-demo#21. I'll take a look this week. Thanks for the report!

BTW, when you cross-post a question, please mention it: https://stackoverflow.com/q/47173705/559676

@yihui yihui added this to the v0.6 milestone Nov 8, 2017
@yihui yihui added the bug an unexpected problem or unintended behavior label Nov 8, 2017
@yihui yihui closed this as completed in 25b94a8 Nov 8, 2017
@yihui
Copy link
Member

yihui commented Nov 8, 2017

This might be a bug of Pandoc: jgm/pandoc#4055 but I have provided a fix in bookdown anyway. Please test the devel version of bookdown here. Thanks!

@yihui
Copy link
Member

yihui commented Nov 9, 2017

Re-open this issue just to remind myself of keeping an eye on the next Pandoc release that will fix jgm/pandoc#4055: https://github.com/jgm/pandoc/releases

@yihui yihui reopened this Nov 9, 2017
@jerrythomas
Copy link
Author

Thanks Yihui, I tested the devel version and this issue has been resolved. I was able to generate the epub correctly with pandoc 2 and devel version of bookdown.

@jerrythomas
Copy link
Author

I am sorry, I shouldn't have closed this. I just read the note in the pandoc#4055. Reopening as you have mentioned that the fix will need to be revisited when pandoc fixes.

@jerrythomas jerrythomas reopened this Nov 9, 2017
@yihui
Copy link
Member

yihui commented Nov 9, 2017

No worries.

@yihui yihui closed this as completed in 1479a4a Nov 13, 2017
@yihui
Copy link
Member

yihui commented Nov 13, 2017

Pandc 2.0.2 has fixed the root issue and been released.

@github-actions
Copy link

github-actions bot commented Nov 6, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants