title: knitr and beamer presentation cannot open connection
body: <p>In RStudio when I open a new markdown file for a pdf presentation the demo script appears. If I knit this I get the following error message:-</p>
  
  <p>Error in file(con, "r") : cannot open the connection
  Calls:  ...  -> patch_beamer_template -> readLines -> file
  In addition: Warning message:
  In file(con, "r") :
    cannot open file 'C:\Users\noblea\AppData\Local\Temp\RtmpmS8rOd\file347c4edc5edc.tex': No such file or directory
  Execution halted</p>
  
  <p>I have not edited the demo script at all. If I make it a pdf document rather than a presentation it produces the pdf document correctly. I am guessing it is due to something in the beamer template but how do I check it?</p>