Reputation: 796
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
Upvotes: 11
Views: 21582
Reputation: 5891
Another option: for a pdf document, I used:
output: pdf_document
fontfamily: arev
In my YAML header.
Upvotes: 7
Reputation: 131
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
---
Upvotes: 13