0

I'm using R 3.3.2 and Rstudio Version 1.0.44, here's the format of my RMarkdown file

---
title: "Sentiment Analysis"
output: 
   rmdformats::material:
    highlight: kate
---

When I try to knit, I got the following error

pandoc: Could not fetch /tabsets.js /tabsets.js: openBinaryFile: does not exist (No such file or directory) Error: pandoc document conversion failed with error 67 In addition: Warning messages: 1: In sink() : no sink to remove 2: In sink() : no sink to remove 3: MathJax doesn't work with self_contained when not using the rmarkdown "default" template. Execution halted

I read some questions on Stack Overflow and added self contained: no. I was able to knit the file and everything looks good on RStudio, but now I have new problems.

  1. When I publish it on Rpubs, all the images were gone.

  2. When I click on knit button, I'm only give the option to knit to material... is there a way for me to knit it to pdf?

I'm a little desperate to fix this problem, any tips/advice is greatly appreciated.

LenaLD
  • 85
  • 2
  • 11

4 Answers4

3

I had the same problem but this solution below worked for me. Just change your markdown top to below and it should work:

---
title: "Test Document"
output: 
  html_document:
    self_contained: no
---

This is a temporary fix, which had been discussed here and given by one of the RStudio guys himself. [Here] (https://github.com/rstudio/rmarkdown/issues/228)

Scott Grammilo
  • 1,229
  • 4
  • 16
  • 37
1

First, instead of self contained: no, self_contained: no allowed me to knit to material locally.

However when publishing the RPubs the images and CSS are gone.
THis is because of how RPubs works, which is to put the document into an iframe.

If you push both a default html_document and a material document from the same Rmd to RPubs and View Source for the frame, you will see that they are completely different. The material page looks like pretty normal HTML and you can see that the image links will be broken because the path to the images are incomplete. For the standard html document on the other hand it has a massive amount of minified javascript that is handling all of these details.

I'm sure there is probably a way to make it work but it would involve reproducing a lot of code from the default html document.

Elin
  • 6,507
  • 3
  • 25
  • 47
  • I actually successfully posted Material Design on RPubs before so I think RPubs supports JS. I think it's probably because I added `self contained: no`? – LenaLD Dec 22 '16 at 14:53
  • Oh interesting, I'm not totally sure what self contained does but it does at least sound like it would be a problem for rpubs. – Elin Dec 22 '16 at 14:55
  • yeah I deleted `self contained: no` and put pdf_document: default html_document: default instead... it won't knit lol – LenaLD Dec 22 '16 at 14:58
  • Using one of the rmdformat templates without self contained mentioned I get "n addition: Warning message: MathJax doesn't work with self_contained when not using the rmarkdown "default" template. Execution halted" So same as you – Elin Dec 22 '16 at 15:49
  • mmm but weeks ago I knitted a Material Design without adding "self_contained:no" and it was successfully published on RPubs lol – LenaLD Dec 22 '16 at 15:57
  • ANy updates since then? Are you using the CRAN version of rmdformats or the dev version? – Elin Dec 22 '16 at 15:58
  • I just updated all the packages a few days ago lol I think I'm using the dev version – LenaLD Dec 22 '16 at 16:01
  • I was looking at thishttps://github.com/rstudio/rmarkdown/blob/master/R/html_document.R#L188 and wondering if all of those settings in the default document are doing something the rmdformats is not e.g. dealing with the mathjax. – Elin Dec 22 '16 at 16:38
  • Since I'm on the same versions as you I'm wondering if there was a change in RStudio that is breaking something. – Elin Dec 22 '16 at 17:15
  • I read about this earlier, and there's line saying, `There was an RProfile file that had one line in it rpubs.upload.method="internal" I deleted that file and things are working now.` – LenaLD Dec 23 '16 at 05:47
  • Interesting. I think it is related to the url for the Mathjax CDN or maybe that is a separate problem. Most of the issues for that error message seem to involve non standard location of files. – Elin Dec 23 '16 at 14:41
  • I think the problem is here: pandoc: Could not fetch /tabsets.js /tabsets.js: openBinaryFile: does not exist (No such file or directory) /tabsets.js is missing its path. – Elin Dec 23 '16 at 20:54
  • FYI I'm going to completely rewrite this answer. – Elin Dec 23 '16 at 22:06
0

I got the same error when running devtools::build_readme().

The reason must have been that I had an old Pandoc/RStudio version installed. Since Pandoc is built into RStudio, I upgraded to the newest version of RStudio (1.4). The error disappeared and I was able to knit/build the readme.

I tried several things first that did not work, like just cleaning the environment and restarting the computer, as was suggested other places.

I am updating here in this question as it seems like one of the most relevant places to post an answer that may quickly help others.

madsR
  • 95
  • 6
-1

I fixed this issue by removing the rmarkdown package and reinstalling it into my C drive at C:/Program Files/R/R-3.6.1/library. R was having issues going out to a drive starting with the characters \\.

Dale Townsend
  • 671
  • 3
  • 13
  • 25