Search code examples
cssr-markdownmarkdownbookdown

Customising Colour / Boldness in Markdown with RMarkdown / Bookdown


I am using bookdown to write some maths lecture notes. I find myself very often using the > blockquote feature. Often, this is because my environments, such as remarks and exercises take multiple lines. It is then ambiguous where the theorem ends and where 'chat' begins after.1 I'm pretty happy with doing this. I like the fact that the blockquote singles out the environments so it's very easy to see when one is changing to another. The thing I don't like is that it "softens" the text colour.

See the following screenshot, comparing the boldness of the font in the first paragraph with that in the blockquote.

enter image description here

Is there any way of removing this "softening"?

1 LaTeX gets around this by adding extra white-space around something like \begin{example} ... \end{example}. Alternatively, one can configure them to add a \qedsymbol to indicate that they have come to an end. I don't feel the first option would look nice in bookdown and I don't think the second option is even possible. It would actually be great for my long examples if it did!


Solution

  • Per your request, you can change the styles in HTML outputted R Markdown scripts by adding styles. There are a few different ways you can add them. Typically, I just place this content in between chunks.

    <style>
    blockquote {
      font-color: black; 
      opacity: 1;}
    </style>
    

    You can attach an external style document or use a CSS chunk. I just find this easier for most projects.

    You can read more about this here.