How to change the font color?

前端 未结 7 1725
轻奢々
轻奢々 2020-11-29 00:30

In RMarkdown is there a way to specify the font color?

There doesn\'t seem to be an option while browsing through the chunk options

相关标签:
7条回答
  • 2020-11-29 00:58

    Others have provided answers for output other than Word. For Word, you can use the Pandoc custom-style syntax to accomplish this with the aid of a reference word document. First, inside your reference.docx template, create a new Word style with a short, distinct name. If you want your font color to apply to a full paragraph, you can use the default, “Linked Paragraph and Character” style type. If you only want to emphasize some words in a paragraph with color, you need to select the “Character” style type. Change the font color (and any other styling you need) and save the reference.docx file.

    Then, inside your .Rmd file, you can use the tag as follows:

    <div custom-style=“DivCol”>Whole paragraph of colored text</div>
    
    Just a <span custom-style=“SpanCol”>few words</span> of colored text
    

    A word regarding style names - for reasons I don’t understand, this process did not work with the style name “Span_Add” but “SpanAdd” was fine.

    0 讨论(0)
提交回复
热议问题