I am trying to change the font size of a code chunk (more precisely I want to use a smaller font). Take the following basic example:
---
title: "Example"
output:
ioslides_presentation:
toc: yes
widescreen: yes
---
## Code
```{r, eval=FALSE}
print(mtcars)
```
Anyone an idea? Is there a YAML option like code-font-size or something like that?
Code chunks in an R Markdown document contain your R code. All code chunks start and end with ``` – three backticks or graves.
ioslides is one of the presentation format that can be easily put together using R Markdown. It has good compatibility with html, and very easy set-up.
You can change the default font size document wide using
<style>
pre {
font-size: 20px;
}
</style>
which you can put right underneath your YAML header or in a seperate stylesheet (CSS file) that you can include in your YAML.
You may want to change the settings for padding
and margin
as well in order to prettify chunk layout.
Modify single chunks
It is possible to add a class to the code chunks you want to modify (if not all of them). Check out the answer here: stackoverflow.com/questions/37944197/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With