When I try to compile an Rmarkdown document to pdf, I get this error:
Error: Functions that produce HTML output found in document targeting latex output.
I ran into this problem when using Bookdown, and the accepted solution did not work in my context. I resolved it after figuring out what the "YAML front-matter of your RMarkdown file" is. With bookdown, there is a .travis.yml file and a _bookdown.yml file, but you want to leave these two alone and these are not what the error message is referencing.
The "front-matter" would be the top of your RMarkdown file (if using bookdown it would be the "index.Rmd" file), see screenshot below:
So just add it to the YAML header as its own line and it should work as expected (or give you a different error)