How do you change the font size in RMarkdown for Knitr

空扰寡人 提交于 2019-12-11 10:34:05

问题


I created a Knitr document and I want to adjust the font size for the text that is NOT in the chunks. It currently appears too small and want to increase it.

Currently I am just writing a line like this:

Example text
---------

And that will make it larger but I can't control the font size. This is for an HTML document


回答1:


For .Rmd files, you can affect the HTML header size using different numbers of # characters, instead of the alternative underlined form which only gives you H1 and H2 sizes in HTML. The # syntax gives you H1 - H6. Note that this is not a knitr issue, bur rather an attribute of Markdown. As explained here, these correspond in the following way:

# H1
## H2
### H3
#### H4
##### H5
###### H6

Alternatively, for H1 and H2, an underline-ish style:

Alt-H1
======

Alt-H2
------

Works in StackOverflow markdown too, at least until H3:

This is H2

This is H3, smaller "font size"



来源:https://stackoverflow.com/questions/32653557/how-do-you-change-the-font-size-in-rmarkdown-for-knitr

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