Closed strimmerlab closed 3 years ago
When you use a theme with bs4_book()
, it will use the boostwatch theme bundled in bslib. Here you are asking for litera
and it seems this theme specifically set serif font for <p>
element
https://github.com/rstudio/bslib/blob/39976d51f07d3b30998a13a0a4ebed9dc36c49ac/inst/lib/bsw/dist/litera/_bootswatch.scss#L29-L31
But it does not change the default which is to use sans-serif font for all body. https://getbootstrap.com/docs/4.0/content/reboot/#native-font-stack
$font-family-base: $font-family-sans-serif !default;
So it seems it is something related to bootstrap directly. ~I believe this has been fixed for litera theme specifically in v5 has sans serif fonts seems to be used for all body element.~
~https://github.com/thomaspark/bootswatch/blob/v5/dist/litera/bootstrap.css#L55~
~bslib does not support v5 yet so in the meantime~ I think you would need to customize yourself the theme if you want this change. Maybe this could be tweaked in bslib directly also.
Hope it helps.
Many thanks, that's indeed very helpful! I think for me as end user it is probably best to wait until v5 is supported.
I noticed this because I am using bs4_book + litera in my lecture notes in statistics, and in these there are lots of lists. So see MATH2082 Statistical Methods and MATH38161 Multivariate Statistics and Machine Learning for real life examples.
I am very happy about bookdown, bs4_book and the related packages, so many thanks for developing! So I thought the little I can do is to report back if there are (small) problems. Thanks!
I think for me as end user it is probably best to wait until v5 is supported.
In fact I am not sure that litera changed this in V5. it seems the theme still uses serif for p element and sans serif for the rest. https://bootswatch.com/litera/
sorry for misleading you.
Anyway, if there is something not correct in litera theme in bslib compare to bootswatch original, this is to be reported in bslib.
I'll close this here.
Thanks for the report!
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
I enountered the following issue with bookdown + bse_book + litera theme: the main text is set in a serif font (such as Times) but the text in a list is set in a sans-serif font (such as Arial).
Too me this appears not to be intentional as this looks odd typographically. Ideally, the text in the list should be set in serif font if the main text is also in serif font.
Here is an example file "index.Rmd":
Compiling this in R using
yields the following HTML output:
xfun::session_info() yields: