Different Rmd-to-HTML behavior across platforms


#1

I'm not sure whether this belongs in RStudio or R Markdown, but I think it belongs here. First, the obligatory information: I'm running RStudio 1.1.423 on both macOS (10.13.4) and Windows 10 (17133.1), and R 3.4.4.

When knitting an R Markdown file (I use slidify) to HTML on macOS, the HTML file shows up in the Viewer tab as it's supposed to, complete with Google webfonts.

However, when I knit the same file to HTML on Windows 10, RStudio opens a new window with the HTML file (unlike on macOS, the file doesn't show up in the Viewer), and the fonts are all wrong. To get what the actual HTML file looks like, I have to click on Open in Browser in the new window.

Has anyone encountered this issue, and know why this is the case? Or is this a difference between Windows and macOS versions of RStudio?


#2

I've seen similar behaviour (in a different context) and this was fixed once I upgraded my pandoc installation to pandoc v2.x.


#3

Thanks @andrie! Unfortunately, I just upgraded my pandoc installation and the problem remains.

It's not really a big deal but it hinders my workflow on WIndows if I have to keep opening the html file in the browser to see if it knit correctly.


#4

My problem only went away once I discovered that Anaconda was masking the pandoc installation I wanted.

I discovered this by using:

Sys.which("pandoc")

and found that the result pointed to Anaconda pandoc, not the pandoc I thought I had updated.

Of course this meant I had to edit the Windows path and try again.

HTH.


#5

You might also try installing one of the latest daily builds of RStudio, as the issue may be resolved there.


#6

And indeed it is! Thanks, @andrie and @kevinushey!

I did check to make sure it was the right pandoc (I have Anaconda as well) to no avail, but the daily build did the trick.