---
date: "`r Sys.Date()`"
author: "Your Name"
title: "Untitled"
output: 
  officedown::rpptx_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
library(ggplot2)
library(rvg)
```

## Table

```{r layout='Two Content', ph=officer::ph_location_left()}
head(cars)
```

```{r layout='Two Content', ph=officer::ph_location_right()}
head(iris)
```

## Slide with Plot

```{r plot1}
dml(plot(pressure))
```

## Slide with ggplot

```{r layout='Title and Content', ph=officer::ph_location_type(type="body")}
mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)
```

## Slide with ggplot

```{r ph=officer::ph_location_fullsize()}
mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)
``` 

## ggplot in left column

```{r ph=officer::ph_location_left()}
mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)
``` 

## ggplot in right column


- Some
- Bullets

```{r ph=officer::ph_location_right()}
mygg <- ggplot(pressure, aes(x = temperature, y = pressure)) +
  geom_point()
dml(ggobj = mygg)
``` 

## ggplot in both columns


```{r ph=officer::ph_location_left()}
dml(ggobj = mygg)
``` 

```{r ph=officer::ph_location_right()}
dml(ggobj = mygg)
``` 


## custom plot locations


```{r ph=officer::ph_location(width = 2, height = 2, left = 2, top = 2)}
dml(plot(pressure))
```

```{r ph=officer::ph_location(width = 3, height = 3, left = 4, top = 4)}
dml(plot(pressure))
```

## Non-editable plot


```{r}
dml(plot(pressure), editable = FALSE)
```

## officer block list

```{r}
library(officer)
fpt_blue_bold <- fp_text_lite(color = "#006699", bold = TRUE)
fpt_red_italic <- fp_text_lite(color = "#C32900", italic = TRUE)
value <- block_list(
  fpar(ftext("hello world", fpt_blue_bold)),
  fpar(ftext("hello", fpt_blue_bold), " ",
       ftext("world", fpt_red_italic))
)
value
```
