Markdown: Change default font size of code chunks in ioslides

北战南征 提交于 2019-12-04 03:20:36

问题


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?


回答1:


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/



来源:https://stackoverflow.com/questions/29564352/markdown-change-default-font-size-of-code-chunks-in-ioslides

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!