# RMarkdown Generation Fails

I upgraded my RStudio from v1.1.453 to v1.2.1335. After the update, I attempted to knit some of my standard .Rmd files but received the error under the Unsuccessful section. No code, filepaths, or filenames were changed between the different versions. I have confirmed that I am still able to run the .Rmd files on an older version of RStudio with the exact same packages.

None of the .Rmd files reference relative filepaths. Every read_() and write_() function explicitly declares the absolute filepaths.

Successful:

output file: file_name.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc"
+RTS -K512m -RTS file_name.utf8.md
--to html4
--output file_name.html
--smart
--email-obfuscation none
--self-contained
--standalone
--section-divs
--no-highlight
--variable highlightjs=1
--variable "theme:bootstrap"
--mathjax
--variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"

Output created: file_name.html


Unsuccessful:

output file: file_name.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc"
+RTS -K512m -RTS file_name.utf8.md
--to html4
--output file_name.html
--email-obfuscation none
--self-contained
--standalone
--section-divs
--no-highlight
--variable highlightjs=1
--variable "theme:bootstrap"
--mathjax
--variable "mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"

pandoc.exe: file_name.utf8.md: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
Execution halted


Try creating a brand new project and making a simple markdown file with no external content. Use some filler text like lorem ipsum just to have some content. Does that successfully generate an output html file?

I tried creating a brand new project on my company's network drive. I still receive the same error.

pandoc.exe: lorum_ipsum.utf8.md: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1
Execution halted


I then created a project on my local drive. I am able to knit the exact same Rmd file.

Here are the two different filepaths:

//networkdrive/folder/subfolder/folder-withDash

Doing one on a local and one on a network drive was a good idea.

So the project on your local drive functions and the project on the network drive does not. I wonder if this is an issue with the network paths being handled incorrectly. In the local and network drive projects, does the result of getwd() look different?

## Testing absolute path to templates

You can supply an absolute path to a template by calling knit2pdf directly. Is knitr able successful generate hmtl when you call it in this fashion?

library(knitr)

template_path <- file.path("path", "to", "input.Rmd")
output_path   <- file.path("path", "to", "generated.html")
report_env    <- new.env()

knitr::knit2html(input  = template_path,
envir  = report_env,
output = output_path)


I have had a similar issue with my Thesis which is a mix of RMarkdown and LaTeX https://github.com/davidhen/thesis_rmd

After updating RStudio it wouldn't knit - I re-installed a legacy version of RStudio 1.1.463 and it knits no problems.

I've been meaning to make a minimal reprex for a while but, well, thesis submission etc. etc.

David