问题
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