Q:

Increase header levels of child documents

I want to create a single PDF document from many .Rmd child documents using pdf_document2().
I have a wrapper file pdf_wrapper.Rmd that looks as follows
---
title: "title"
author: "author"
output: 
  bookdown::pdf_document2:
  number_sections: true
---

# Header1

```{r child = 'child1.Rmd'}
```

With child1.Rmd having the following content
---
title: "Title2"
output: rmarkdown::html_document
---

## Title 3

Now when I render pdf_wrapper.Rmd, I get the following:
# Header 1
## Title 3

I want to end up with 
# Header 1
## Title 2
### Title 3

A:

I put all level 2 headers manually in the main document pdf_wrapper.Rmd, e.g. Title2.
Additionally, I decreased all remaining headers in all child documents by one level using the following bash call:
for i in *.Rmd; do
    sed -i '# /## /g' $i
done

The main document then looks as follows:
---
title: "title"
author: "author"
output: 
  bookdown::pdf_document2:
  number_sections: true
---

# Header1

## Title2

```{r child = 'child1.Rmd'}
```

Initially I though that the <title> fields in the YAML metadata of the child documents get processed as level 1 headers but this is not the case.

