Hi!
I am trying to customize the font size of my Rmarkdown in both body text and headers. I would like to specify that I'm using an Html output format and a theme from prettydoc package. Therefore, I tried, as suggested in the forum, to use a css file but it seems that it does not work.
Here's how I set the output: output:
prettydoc::html_pretty:
theme: cayman
highlight: github
toc: true
css: style.css
And here the code I wrote to define the font size of the document, in a file called style.css:
<style type="text/css">
body, td {
font-size: 14px;
}
code.r{
font-size: 12px;
}
pre {
font-size: 12px
}
</style>
Does anyone know why the code doesn’t seem to work? Thanks in advance!
1 answer
One simple reason might be that you for sure need to omit the style tags in your style.css. The <style type="text/css"> ... </style> notation is only required if you embed the CSS directly into the HTML.
Other than that, it might be that the style definitions provided by your theme take precedence over your own stylesheet. Use the Inspector/Developer Tools in your Browser to see which CSS definitions are applied in which order and inheritance.
Log in to answer this question.
How is this related to bioinformatics? You may want to post this on an appropriate forum.