Rmarkdown to pdf

Hi,
I'm not able to use knit to pdf...
the error says
! Package inputenc Error: Unicode character ” (U+0094)
(inputenc) not set up for use with LaTeX.

Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. For R Markdown users, see https://bookdown.org/yihui/rmarkdown/pdf-document.html
Errore: Failed to compile treepdf.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See treepdf.log for more info.
Inoltre: Warning message:
In knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet, :

and every time nothing works.. I tried to switch in global options but still doesnt work... some one can help me?

Hi,

It means that you have a unicode character that latex cannot handle. I usually convert them to pure latex. For example \sigma instead of the sigma character.

I guess there could be way to let latex know and handle unicode character directly by adding some package in the template. Or to define the file encoding.

I am not litterate enough in Latex to give you better solution.

Regards,

jm

Try to install MikTex and install the package tinytex

Try using the xelatex engine by specifying it in the top level YAML metadata of your Rmd document.

---
title: "Your Title here"
output:
  pdf_document:
    latex_engine: xelatex
---

I think tinytex is meant as a lightweight alternative to MikTex, rather than an addition.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.