I too have now run into this problem, where I would like to include some TIFF files and have them auto-converted to PNG files. When I try typesetting the provided 'mwe.Rmd' from within the latest version of RStudio on a MacBook Air, it dies:
! Package pdftex.def Error: File `image-tif-converted-to.png' not found: using
draft setting.
Error: Failed to compile mwe.tex. See mwe.log for more info.
Execution halted
Note that I changed the line to:
pandoc_args: "--latex-engine-opt=-shell-escape"
and it looks like it is generating a pandoc command that contains the requested 'latex-engine-opt' option:
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS mwe.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output mwe.tex --template /Library/Frameworks/R.framework/Versions/3.5/Resources/library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine pdflatex --variable graphics=yes --latex-engine-opt=-shell-escape --variable 'geometry:margin=1in'
But the mwe.log indicates that the 'sips' command was not executed, and so the needed png file was not created:
runsystem(sips -s format png image.tif --out image-tif-converted-to.png)...disabled (restricted).
Would be nice to have a solution to this.
Thank you.