gadenbuie / xaringanthemer

😎 Give your xaringan slides some style

Home Page:https://pkg.garrickadenbuie.com/xaringanthemer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

presentation notes font changes with base font

vrbiki opened this issue · comments

to reproduce this issue, create a new Rmd from xaringanthemer template and change base font to 32px

style_duo_accent( primary_color = "#1381B0", secondary_color = "#FF961C", inverse_header_color = "#FFFFFF", base_font_size = "32px" )

While the remark-slide font is precisely how I like it, the presentation notes are far too big. While they can be made smaller by clicking the "-" button in presentation mode, this is something that needs to be done on every slide (and gets reset to large font upon knitting).

I have tried duplicating the CSS file and adding the following (replacing xaringan-themer.css by the name of this edited duplicate in the YAML), however, it does not seemingly do anything.

.remark-notes-content {
  font-size: 0.5rem;
}

Thanks for this package. It sure beats creating custon CSS from scratch!

Can you try setting text_font_size instead of base_font_size? text_font_size should only affect the slide content text whereas base_font_size sets the root font size at the lowest level so it's inherited everywhere.

If that doesn't work for you, you can also set the font size of the notes area to a fixed base value with

.remark-notes-area {
  font-size: 16px;
}

From ?style_duo_accent:

base_font_size

Base Font Size for All Slide Elements (must be px). Defaults to 20px. Modifies the html element. The value of this variable is also stored as a CSS variable that can be referenced with var(--base-font-size) in any argument of a style function or in custom CSS.

text_font_size

Slide Body Text Font Size. Defaults to 1rem. Modifies the .remark-slide-content class. Accepts CSS font-size property values. The value of this variable is also stored as a CSS variable that can be referenced with var(--text-font-size) in any argument of a style function or in custom CSS.

Setting text_font_size instead of base_font_size did the trick! Sorry for my confusion - I was under the impression that text_font_size had to be relative to the base_font_size.

Glad to hear that worked for you!