I know this seems to be a question already answered in StackOverflow.
However, I am going to try to explain my situation clearly.
- I am writing 3 separate documents using RStudio and RMarkdown. In fact, I am not including any chunks, so it might be purely Markdown syntax.
- These three documents (
.Rmd) share some sections, which are identical in the three of them. - There are other sections that are different among them.
In order to write efficiently, I would like to write the common sections using Markdown syntax in separate files from the three documents I mentioned.
In this way, I would like to include and link those common sections in the three documents (in their respective places).
In this regard, I would like knitr, when converting to HTML PDF or DOCX, to take into consideration the syntax of the separate and common sections. I mean, if there are subheadings, bold, italics, etc, to be correctly identified and converted.
Any idea on how to do this?