Hi! I am very new to RStudio and pandoc. I am trying to convert demo markdown to docx using pandoc. The RStudio R Markdown console outputs the following command to execute the transformation: /usr/local/bin/pandoc +RTS -K512m -RTS abc.utf8.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output abc.docx --highlight-style tango --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua
However when I try to run it from the terminal I get:
pandoc: abc.utf8.md: openBinaryFile: does not exist (No such file or directory)
What do you want to achieve ? Why are you trying to execute this command from the terminal ?
Rmarkdown will use this command to generate the output document using intermediary files it created. Those files are cleaned after a render by default. So you can't just copy paste and run, you need to adapt the logic
You can use pandoc at the command line but you'll need to go through pandoc documentation.
You'll have to create the markdown input for pandoc or generate it from Rmarkdown, then pass any argument you need though command line.
there is a keep_md argument in rmarkdown::*_document function to keep the md document generated, and there is a clean argument to set to FALSE to keep the intermediary files.
Rmarkdown is not really designed to be used at 50% of its process. It happends that some argument to pandoc command are temp file created by rmarkdown. You'll however find some pandoc functions helps like pandoc_convert - maybe they can help.
basically, the issue you have is that the input file for pandoc (abc.utf8.md) does not exists - you'll need to keep it, or create a new one to pass to pandoc. Pandoc take md inputs not rmd inputs.