0

I am using r-markdown, knitr, and pandoc to generate MS Word reports in RStudio. My tables require a data source line underneath each. The font size of this text needs to be 2 points smaller than the rest of the document. Is there a way to specify a smaller font size for a specific paragraph?

I have tried redefining Header 7 in a Word template, but using a header in this way causes it to show in the table of contents which is not acceptable.

Here is an example of what I need to do:

---
title: "Test Smaller Font"
output: word_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(pander)
```

## R Markdown
An example

```{r cars, echo=F, warning=F, message=F, error=F, results='asis'}
pandoc.p("This is a table about cars")
pander(cars)
# the following text should be smaller:
pandoc.p("Data source: some source.")
```
user2547973
  • 343
  • 2
  • 9
  • You should be able to modify the table of contents settings for the template so that it doesn't generate a TOC entry for level 7 headings. – Emily Kothe Feb 15 '19 at 21:48
  • Thanks for the suggestion. I was hoping to find a solution within the R ecosystem but maybe it's not possible. – user2547973 Feb 19 '19 at 20:46

0 Answers0