For some rason, xaringan
is not modifying the size of the font in figures. I created figure p1
which looks like this (for the sake of the example, I am exaggerating the size of the text).
However, when I include it in the xaringan
presentation it looks like this. As you can see the font size if super small. I changed the fig.retina
option from 3 to 2 to increase a little the size, but it does not change much
.left-column[
- first thing
- secong thing
]
.right-column[
'''{r}
p1
'''
]
I even tried creating a separate css file (figs.css) for the figure and included it using the theme_xaringan()
funciton of the xaringanthemer
package. It is supposed to increase the size of the font, but it still does not work. Notice that I increased the --base-font-size
to 40px
(I don't know if this is the right way to do it). I see that the title of the axis is modified by the theme_xaringan()
function but the size of the labels of the axis are not.
this is the figs.css file
:root {
/* Fonts */
--base-font-size: 40px;
--text-font-size: 4rem;
--code-font-size: 0.9rem;
--code-inline-font-size: 1em;
--header-h1-font-size: 2.75rem;
--header-h2-font-size: 2.25rem;
--header-h3-font-size: 1.75rem;
}
This is the Rmarkdown code to include it.
.left-column[
- first thing
- secong thing
]
.right-column[
'''{r}
p1 +
theme_xaringan(css_file = here("figs.css"))
'''
]
I think this should be a very trivial thing to solve but I have not been able to find the problem.
Thank you so much.