How to change the font color?

前端 未结 7 1794
轻奢々
轻奢々 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:53

    For PDF and HTML, to get colored text which you can modify with markdown highlighting : see the rmarkdown book. Pandoc filter is the best choice.

    For Microsoft word, you have to create first a Template_MS.docx with custom styles. Warning: create different styles for coloring paragraphs (paragraph style) and for colorings few words (character style). It is an option when you made a new style.

    Add in th YAML:

    ---      
    output:   
     word_document:   
        reference_docx: Template_MS.docx   
    ---   
    

    And next:

    For few words of colored text.
    

    For paragraph.

    Paragraph of colored text. Blabla. Blabla.

    Nota Bene:
    + Do not use the same style for Paragraph and a few words, it is bugging.
    + If it is not working, check that your style is for paragraph ou character in MS.
    + If it is not working, install an updated version of pandoc.

提交回复
热议问题