How to use landscape and portrait in same Rmardown word document

Viewed 538

I want to break my document in two sections, one in landscape view with some text content and another in portrait view with some data in table format.

I tried to break my main doc in two rmarkdown files with different "reference_docx", but when I use "r child" on my main Rmd looks like R ignore child's "reference_docx".

I looked for previous answers about this topic but I've just found some tips for pdf rmarkdown files.

1 Answers

Switching between landscape and portrait in Word is possible via officedown. But it's not yet on CRAN so you have to install it via devtools::install_github("davidgohel/officedown").

Example RMD:

---
title: "Officedown"
author: "Stefan"
date: "7 3 2020"
output: officedown::rdocx_document
---

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

## Portrait
Lorem ipsum

<!---BLOCK_LANDSCAPE_START--->

## Landscape
Lorem Impsum

<!---BLOCK_LANDSCAPE_STOP--->

## Portrait
Related