Knit Rmarkdown to PDF, latex issues

I can't manage to knit my Rmarkdown script to PDF because Latex does not support character as "é" or "è". It returns the following error message:
"! Package inputenc Error: Unicode character ́ (U+0301)
(inputenc) not set up for use with LaTeX."

Is there any way to avoid this issue?

Other question: When knitting my dataframe to PDF, it gots cut because latex isn't doing automatic linebreaks. Is there any option that enable the dataframe to fit to the page?

02

 dataframe %>%
        kable(format = "pandoc", escape = F,caption = "Individuals sampled") %>%
        kable_styling("striped", full_width = T)

Can you share some REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

Here, I think we need to know with Latex distribution you use. TinyTex is good one working with Rmarkdown:

I use TinyTex.

But actually I found why those characters weren't supported when knitting to PDF: it was because part of the text in the Rmd was pasted from another document and the character was oddly encoded.

For the second question here's what I have:

Anatomy <- read.delim("Anatomy.csv", sep=',',dec=".",stringsAsFactors = F) %>%

kable(Anatomy[1:6,], 
      format = "pandoc", escape = F,
      caption = "Table de données de la description anatomique (exemple des lignes 1 à 6)") %>%
  kable_styling(bootstrap_options = c("striped", "hover"),font_size = 7) 

What gives a cropped table once knitted:
07

Looking at the documentation for kableExtra, you should be able to scale down your table by specifying it within your latex_options:

kable(Anatomy[1:6,], 
      format = "pandoc", escape = F,
      caption = "Table de données de la description anatomique (exemple des lignes 1 à 6)") %>%
  kable_styling(bootstrap_options = c("striped", "hover"), font_size = 7, latex_options = c("scale_down")) 

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