Formatting h1, h2 in rmd/rmarkdown

Viewed 1602

With an external css file, I can change many items in an Rmd/html document, but some basic ones are overridden by inline css inserted by markdown (?).

.main-container {
....
h1 {
  font-size: 34px;
}
h2 {
  font-size: 30px;
}

So the only way to change h2 font size is by inserting the code directly into the document, which is ugly:

---
output: 
  html_document:
    theme: cosmo
   # css: whatever.css # adding h2 here does not work
---

<style type = "text/css">
h2 {color: red;}
</style>

## R Markdown

Any better solution? Is it possible to suppress the above inline chunk?

1 Answers
Related