6

Trying to knit a doc into html, RStudio would hang on the conversion to html part. I looked around and it looked like this happened to other folks when they were using an out of date pandoc version. I updated pandoc to 2.8. I received the error in the title. Looking around again, it appeared that v 2.5 seemed stable. I installed that, restarted my computer, and still get the same error.

repex is the default example when you create an RMarkdown file in RStudio: file -> New file -> R Markdown -> html.

---
title: "repexpandocerror23"
author: "Adam Korejwa"
date: "11/22/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for 
authoring HTML, PDF, and MS Word documents. For more details on using R 
Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that 
includes both content as well as the output of any embedded R code chunks 
within the document. You can embed an R code chunk like this:

```{r cars}
summary(cars)
```

## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}
plot(pressure)
```

Note that the `echo = FALSE` parameter was added to the code chunk to 
prevent printing of the R code that generated the plot.
akorejwa
  • 137
  • 7
  • 1
    Please make this question *reproducible*. This includes sample code (including listing non-base R packages), sample *unambiguous* data (e.g., `dput(head(x))` or `data.frame(x=...,y=...)`), and expected output. Refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Nov 22 '19 at 18:37
  • Some thoughts: if you have a system-wide installation of `pandoc`, then you might find a difference (on windows) if you run `system("pandoc --version")` and `system(paste(file.path(Sys.getenv("RSTUDIO_PANDOC"), "pandoc"), "--version"))` (as RStudio keeps its own version of pandoc installed). – r2evans Nov 22 '19 at 18:40
  • It appears the system wide pandoc is 2.8, despite installing 2.5. The other command returns status 127: system(paste(file.path(Sys.getenv("RSTUDIO_PANDOC"), "pandoc"), "--version")) Warning message: running command 'C:/Program Files/RStudio/bin/pandoc/pandoc --version' had status 127 – akorejwa Nov 22 '19 at 18:47
  • 1
    Oh, right, I hate R's `system`. Try `system(paste(shQuote(file.path(Sys.getenv("RSTUDIO_PANDOC"), "pandoc")), "--version"))` – r2evans Nov 22 '19 at 18:55
  • running that command, I get 2.5. Running rmarkdown::pandoc_version(), I get 2.8. – akorejwa Nov 22 '19 at 19:06
  • Your Rmd above gives no errors for me, btw. R-3.5.3, win10, pandoc-2.7.3, knitr-1.23. (Curious, does `rmarkdown::pandoc_version()` show you 2.5 or 2.8?) – r2evans Nov 22 '19 at 19:24
  • Since pandoc-2.5 ([changelog](https://pandoc.org/releases.html#revision-history-for-pandoc)), the only reference to `ascii_identifiers` is in version 2.8 is with `gfm_auto_identifiers` in the presence of emojis, so it doesn't seem like that is going to produce significantly different results. Sorry, I'm running into dead-ends, I just can't reproduce your problem to be able to troubleshoot its cause. – r2evans Nov 22 '19 at 19:27
  • 1
    R 3.4.4, win 10. rmarkdown::pandoc_version() gives 2.8. I updated markdown package with install.packages('rmarkdown') and it appears to be working now. pandoc_version() still gives 2.8. – akorejwa Nov 22 '19 at 19:30
  • Please provide session info (e.g. `xfun::session_info('rmarkdown')`) when reporting issues. My best guess is that you are using an old version of **rmarkdown**, but it will be much better if we don't have to guess. – Yihui Xie Nov 22 '19 at 22:05

1 Answers1

8

I have fixed this issue two months ago. Please make sure your rmarkdown version is at least v1.16. Once again, when in doubt, consider updating your packages:

update.packages(ask = FALSE, checkBuilt = TRUE)
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419