Jot eN
Jot eN

Reputation: 6396

How to change a font in RMarkdown2 presentation?

I'm using RStudio RMarkdown2 ioslides_presentation. When I'm using non-english letters, like 'ę', it's looking really bad:

enter image description here

How to easily change a font in RMarkdown2 presentation?

Upvotes: 3

Views: 1250

Answers (1)

juba
juba

Reputation: 49033

Rmarkdown presentation

When using the ioslides rmarkdown presentation, I think the only way to change the font family is to provide a custom CSS. So you have to add the following in your preamble :

output: 
  ioslides_presentation:
    css: style.css

And then create a style.css file in your presentation directory with something like that :

* {font-family: Helvetica !important}

RStudio R presentation

With RStudio R presentations, as explained here :

https://support.rstudio.com/hc/en-us/articles/200532307-Customizing-Fonts-and-Appearance

You can specify a font-family setting in the preamble of your rmarkdown file. Something like this :

Presentation title
========================================
author: My name
font-family: 'Helvetica'

This will define the font family for the whole document. If you want to customize only some elements such as headers, you will have to create and add a custom CSS file.

Upvotes: 5

Related Questions