I have one .Rmd file (named loop.Rmd), in which i have some text outside che chunks with special simbols(accents, apostrophe). If I generate the PDF by Knit, in the output this symbols are correct.
My problem is that I have another file main_loop.R in which I use a loop to generate some PFDs based on loop.Rmd file. I use the render function to produce them. My problem is that in these PDF the symbols are wrong (è as è, ' as ’ and so on)..
I try to solve the problem including the following latex codes in the loop.Rmd file:
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
But it doesent't work...
I also try by adding encoding = "UTF-8" in render function and options(encoding = 'UTF-8') but it doesn't work
anyone has any ideas???
I try to create a script easier to share share with you.. and now it worked, I also add the other lines of code and it works... I don't understard, maybe I only change the order of che command at the beginning of the Rmd file.