When I create an R Markdown file and knit HTML, the following is present:
<style type="text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
I would like to change the max-width attribute. How would I do that?
Thanks.
If you are only making HTML output you can put
<style>
body .main-container {
max-width: 500px;
}
</style>
at the beginning of the .Rmd file I put mine after the front matter.
There's no way to change that number specifically, but you can override it. Create your own style.css
file in the same directory as your document, and give it some content:
body .main-container {
max-width: 500px;
}
Then reference that CSS file in your YAML front matter:
---
...
output:
html_document:
css: style.css
---
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With