change font size in HTML5 using knitr only
Asked Answered
M

1

7

I am using knitr to generate HTML5 slides, and use the following codes:

library(knitr)
knit("file.Rmd")
pandoc("file.md", format="dzslides") 

However, the font sizes (for normal text and R codes) are larger so I hope to make them smaller. I know there is a way of using slidify to convert .Rmd file to HTML5, but I wonder if there is an easier way to make the adjustment only using knitr? For some reason, I don't want to use slidify for now.

Currently I put the following codes at the end of my .Rmd file:

<!--pandoc
s:
S:
i:
mathjax:
-->
Maraca answered 12/8, 2013 at 13:43 Comment(0)
S
0

I have a dirty way to solve this issue:just use raw HTML5 in your RMD document and it always works.

Check How to change font size in html? and just define your font size in a custom chuck at the beginning of your RMD files.

<style>
p {
   color: red;
  }
.paragraph {
   font-size: 18px;
  }
</style>

Then use<p class="paragraph">Paragraph A</p> in your files.

I know this method actually discard the cons of markdown. However, when the default way has close the door, the only path might go to the raw.

Sennacherib answered 6/9, 2015 at 6:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.