R markdown compile error:

后端 未结 3 1840
你的背包
你的背包 2021-01-12 07:18

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.         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 07:44

    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)

提交回复
热议问题