rstudio / rmarkdown-book

R Markdown: The Definitive Guide (published by Chapman & Hall/CRC in July 2018)
https://bookdown.org/yihui/rmarkdown
Other
781 stars 518 forks source link

4.2.2 Adjusting font-size in ioslides using R Markdown #30

Closed jananiravi closed 6 years ago

jananiravi commented 6 years ago

Thanks for the detailed super-helpful book, @yihui Quick question. I read the sections on adjusting font-size in slides (R Markdown, ioslides presentation). Seems like I can use {.smaller} to change it for the whole slide. I also read that footers can be added (if included in the file definition 4.2.3).

Qn: Is there a way to adjust the font size of individual lines in a particular slide? I tried appending the line with {.smaller} and {.bigger} but that doesn't work within the slide. Thanks!

dr-harper commented 6 years ago

If you want to change the size of individual lines of text, you will have to delve into some custom HTML. Here are some examples based on this Stackoverflow question:

---
title: "Untitled"
output: ioslides_presentation
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)

Font Sizes

Hope that helps!


As a tip, Stackoverflow is a good place if you are looking for general guidance. GitHub issues are less monitored, and are better used if there is a suspected bug or issue with the package or software. You may also consider https://community.rstudio.com for questions.

jananiravi commented 6 years ago

Thanks, @mikey-harper True, I hadn't tried HTML tags yet. I was looking for Markdown-based shortcuts and skipped checking out the most obvious option!

dr-harper commented 6 years ago

Markdown by design only allows a limited amount of formatting. But its power comes from this simplicity :)

The cheatsheet sets out pretty much all the built-in formatting: http://www.rstudio.com/wp-content/uploads/2016/03/rmarkdown-cheatsheet-2.0.pdf .