I gave up. I can't find any working solution to change font type in my R Markdown document. I tried a lot of stuff, for example:
---
output: word_document
sansfont: Calibri Light
---
But RStudio just ignores it. Can you help me? I need Times New Roman font in my pdf/word document.
Regards
Another option: for a pdf document, I used:
output: pdf_document
fontfamily: arev
In my YAML header.
This worked for me. Try using mainfont
instead of sansfont
,
and set latex_engine
to either xelatex
or lualatex
.
---
output:
pdf_document:
latex_engine: xelatex
mainfont: Times New Roman
---
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With