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 
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash 
--output file_name.html 
--smart 
--email-obfuscation none 
--self-contained 
--standalone 
--section-divs 
--template "C:\Users\Username\Documents\R\win-library\3.5\rmarkdown\rmd\h\default.html" 
--no-highlight 
--variable highlightjs=1 
--variable "theme:bootstrap" 
--include-in-header "C:\Users\Username\AppData\Local\Temp\RandomAlphaNumeric\rmarkdown-RandomAlphaNumeric.html" 
--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 
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart 
--output file_name.html 
--email-obfuscation none 
--self-contained 
--standalone 
--section-divs 
--template "C:\Users\Username\Documents\R\win-library\3.5\rmarkdown\rmd\h\default.html" 
--no-highlight 
--variable highlightjs=1 
--variable "theme:bootstrap" 
--include-in-header "C:\Users\Username\AppData\Local\Temp\RandomAlphaNumeric\rmarkdown-RandomAlphaNumeric.html" 
--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

C:/Users/Username/Documents\Directory-With-Dash/Testing_RMarkdown.Rproj

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

I've just had another go and the error message reads

! File ended while scanning use of \textbf .

\par
<*> THESIS.tex

After some more exploration, it appears the issue stems from not having my network directories mapped to a drive. I was able knit the .Rmd files using RStudio v1.2.1335 after I mapped the network directory to a drive.

I reverted back to v1.1.453 as I would have to rewrite all my scripts to reference the newly mapped drive instead of absolute network filepaths.

Do we know if this is an active bug that RStudio is looking into fixing or if this difference is intentional? If it is a bug, where can I submit it?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.