Overview Generating personalized documents is often useful. Since this is a very common task, programs like Word or similar software can do this. But I like to use R if I can. And the whole R Markdown system is perfectly suited for repeat generation of customized documents.
I’m certainly not the first one to have the idea of using R, and in fact my initial approach is based on this prior post.
Background A good while back (around 2 years as of this writing), I needed the feature to turn an R Markdown document into a Word document (that’s easy) and to apply custom styles to specific parts of the Word document (that was trickier). I found some good information in this RStudio article, but it didn’t quite address everything I was looking for.
Specifically, I wanted to find a way to format certain parts of the R Markdown document in a specific style.