cannot knit PDF in R studio

二次信任 提交于 2021-01-27 17:51:16

问题


I am totally new to RStudio and I was working on an RMarkdown document. When I click on Knit PDF, and I keep getting the result like this:

output file: A1-soln-template__2__molly.knit.md

! Package inputenc Error: Unicode char μ (U+3BC)

(inputenc) not set up for use with LaTeX.

See the inputenc package documentation for explanation.

Type H for immediate help.

... l.142 null hypothesis: Ho:μ

Try running pandoc with --latex-engine=xelatex.

pandoc: Error producing PDF

Error: pandoc document conversion failed with error 43

Execution halted

How can I solve this and get things to work?

Thank you


回答1:


Try:

install.packages('jsonlite', dependencies=TRUE, repos='http://cran.rstudio.com/')

Also, you might need to install MiKTeX.




回答2:


The issue here is related to encoding. You are trying to include ASCII characters where they should not be.

In particular, you have typed:

Ho:μ

This needs to be changed to:

$H_0: \mu$

You will need to learn some LaTeX.



来源:https://stackoverflow.com/questions/39939775/cannot-knit-pdf-in-r-studio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!