analytics
analytics

Reputation: 149

How do you change the font size in RMarkdown for Knitr

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

Upvotes: 1

Views: 8211

Answers (1)

Ken Benoit
Ken Benoit

Reputation: 14902

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"

Upvotes: 1

Related Questions