Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change font sizes with style sheets for RStudio presentation

I am using RStudio Presentation and I'd like to change the font size for the main elements (e.g.: header, bullet, and sub bullet). I was able to add a style sheet to my rmd file but I do not know what to change in the css file. I have tried changing the font size in various places in the css file but nothing worked.

## Slide with Bullets

- Bullet 1
    + Sub bullet
- Bullet 2
- Bullet 3
like image 411
Wariya Erez Avatar asked Jan 29 '15 06:01

Wariya Erez


People also ask

How do I change the font size in RStudio?

Then, you can further adjust the font of code window, console, terminal, environment, and history panels via Tools >> Global Options >> Appearance >> Editor font size.

Can you change font in RStudio?

Go to the menu in RStudio and click on Tools and then Global Options. Select the Appearance tab on the left. Again buried in the middle of things is the font size. Change this to 14 or 16 to start with and see what it looks like.

How do I increase font size in Rmarkdown?

To change the font size, you don't need to know a lot of html for this. Open the html output with notepad ++. Control F search for "font-size". You should see a section with font sizes for the headers (h1, h2, h3,...).


Video Answer


1 Answers

The default style sheet for rstudio presentations is here

You can of course have a style sheet, but you can also change the settings on the fly like below.

Untitled
========================================================

Slide title
========================================================

<style>

/* slide titles */
.reveal h3 { 
  font-size: 100px;
  color: blue;
}

/* heading for slides with two hashes ## */
.reveal .slides section .slideContent h2 {
   font-size: 40px;
   font-weight: bold;
   color: green;
}

/* ordered and unordered list styles */
.reveal ul, 
.reveal ol {
    font-size: 50px;
    color: red;
    list-style-type: square;
}

</style>

## Slide with Bullets

- Bullet 1
    + Sub bullet
- Bullet 2
- Bullet 3

Gives me this

enter image description here

The #, ##, ###, etc correspond to h1, h2, h3, etc. Apparently the h3 goes with the slide titles. It is also important to put the .reveal in front of each item if you are changing the rstudio stylesheet.

like image 157
rawr Avatar answered Oct 10 '22 10:10

rawr