cannot knit PDF in R studio - r

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

Try:
install.packages('jsonlite', dependencies=TRUE, repos='http://cran.rstudio.com/')
Also, you might need to install MiKTeX.

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.

Related

LaTeX Error: Unicode character √ (U+221A) not set up for use with LaTeX

I am writing one R package where one of the output has an unit √(mg/√kg L). When I am submitting the package to CRAN it shows me the following error
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
! Package inputenc Error: Unicode character √ (U+221A)
(inputenc) not set up for use with LaTeX.
How can I solve the problem?

R markdown not knitting because of parse raw had been removed

I've been having problems on knitting Rmarkdown, and it's been frustrating that I have no idea what to do. Every time I knit them, it always ended up with an error like this
output file: -R--Pengenalan_R.knit.md
--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.
Unknown option ---Pengenalan_R.knit.md.
Try pandoc.exe --help for more information.
Error: pandoc document conversion failed with error 6
Execution halted
I've also tried to reinstall my Rstudio but it doesn't work either. Does anyone have a clue how to solve this? Thank you in advance!

! LaTeX Error: File `knitr.sty' not found

I am trying to knit a simple markdown file to a pdf using knitr and R Studio. The chunks all run fine and I have no problems knitting to an HTML document, but get the following error when trying to knit to a pdf:
! LaTeX Error: File `knitr.sty' not found.
I have reinstalled tinytex and made sure that the knitr and rmarkdown packages are up to date. I've looked around and while there are similar issue with other *.sty files, I can't find anything relating to this one.
Thanks in advance for any advice
Solved this: for some reason I had listed several R packages in the 'extra_dependencies' part of the YAML metadata. Once removed it worked.

Unicode hyphen causes error when building R documentation

I'm trying to put together my first package for R, and I'm unable to generate the PDF for the documentation using R CMD Rd2pdf. The error I get is
! Package inputenc Error: Unicode char ‐ (U+2010)
(inputenc) not set up for use with LaTeX.
I don't really understand what's going on here, since it seems absurd that the hyphen symbol would naturally throw an error in building documentation for an R package. I'm using roxygen2 to build the package, and the main file is saved with UTF-8 encoding.

experiencing issue with using texreg in R markdown

I'm experiencing issue with using texreg in R markdown to produce PDF.
I'm not sure if it's the new OSX or something about my set up. (I'm new to MAC and relatively new to R.)
So far...
I cannot run my old latex files.
I can run the old latex files if I rewrite them in a slightly different syntex (for example take out the \ )
I can run markdown files without texreg.
If I run markdown
with texreg in it, I get an error saying that pandoc cannot convert
the files. Here is the error:
! Misplaced \noalign.
\hline ->\noalign
{\ifnum 0=`}\fi \hrule \#height \arrayrulewidth \futurelet...
l.114 ...sh{}begin\{tabular\}\{l c c c c \} \hline
pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
In addition: Warning message:
In Ops.factor(left, right) : '<' not meaningful for factors
Execution halted
When I put in texreg function, the closest I have gotten is that it print out the latex code in the pdf.
I'm on OSX EL CAPITAN, newest version of R, MACTEX, PANDOC.
I think knitr, mactex are installed correctly since I can produce pdf from both markdown and latex. Comments?
So may be the problem is pandoc?
I did read a post about some issue with OSX EL CAPITAN and MACTEX but it should be fixed.

Resources