manual font control when kniting rmarkdown to MS Word

You mean one markdown syntax that would do the job for MS word, html output and pdf output ?

For MS word, there is the pandoc feature to apply custom style to some block of text. This custom style refer to your docx template. So you could have a BigFont style in your reference doc and use it in your markdown text.

Here an example, with a template where I set up the text style BigFont to size 24

---
title: "R Notebook"
output: 
  word_document:
    reference_docx: reference_doc.docx
---

Here I have a sentence with a r [freaking big bit]{custom-style="BigFont"} right in the middle.

This will output

This is only working for word output as custom-styles is only a word pandoc feature.
However the bracketed spans syntax is also working for other format (ex for html : [This is *some text*]{.class key="val"})

4 Likes