Knit button works but error if use rmarkdown::render


#1

I used the sample rmarkdown file that is created when you select "File->new file->rmarkdown" in R studio and saved the file as "practice.R". I then used the "knit" button to create a PDF, no problems.

But if i call rmarkdown::render("practice.Rmd") i get the following error. i have read all the documentation with rmarkdown::render and i can't figure out how to address this issue.

output file: practice.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS practice.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output practice.pdf --template "C:\Users\shkacink\Documents\R\R-3.4.3\library\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"
pandoc.exe: pdflatex not found. pdflatex is needed for pdf output.

Error: pandoc document conversion failed with error 41
In addition: Warning message:
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS practice.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output practice.pdf --template "C:\Users\shkacink\Documents\R\R-3.4.3\library\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 41


#2

I am not sure what's causes this issue, but you might help out the rmarkdown folks by posting a reprex as a possible bug report to github issues;