Rmarkdown font
1
0
Entering edit mode
20 months ago
ilaria • 0

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!

theme font Rmarkdown • 587 views
ADD COMMENT
0
Entering edit mode

How is this related to bioinformatics? You may want to post this on an appropriate forum.

ADD REPLY
0
Entering edit mode
20 months ago

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.

ADD COMMENT

Login before adding your answer.

Traffic: 2572 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6