Editing a RMD document on pdf keeping special characters (french accentuation on letters

Dear Braintrust,
I'm relatively new user of RMD and I've tried to edit some programmation coding with it to make interactive analyses reports.
I'm using french language for commenting the codes and outputs where accents on a and e letters are very common...

I've starting my program using:

title: "x_doc"
author: "me"
date: "r Sys.Date()"
output:
pdf_document: default
html_document:
df_print: paged

and the special letters are transformed by different characters. Also when reopenning my RMD file on an other session the special characters are changed again.
I went to the net and found that tinytex package could help but the following command did not change anything.

tinytex::install_tinytex()
options(tikzDefaultEngine = "xetex")

Do you have a specific recommendation / advices to keep the specific speaking language punctuation on both RMD files when saved as well as for editing the pdf and html files?
many thanks for your advices...

RMarkdown will render accented characters correctly in text, although it's awkward. For example, \grave{a} is coded $grave{a}$

To read in, and preserve, accented characters

A <- readLines(con <- file("~/projects/demo/input.txt"))
close(con)
A
#> [1] "liberté égalité fraternité"

Created on 2019-11-22 by the reprex package (v0.3.0)

(May @jennybryan forgive me, for some reason reprex doesn't play well with here.)

Be sure to save your Rmd file with UTF-8 encoding

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