user17050892
user17050892

Reputation:

The entire code does not fit on the slide. R markdown, Xaringan

I am using xaringan in r, when the code is executed it does not appear integer on the slide, it does not fit on the slide, what can I do to make it appear integer?

```{r, out.width=1200, out.height=300, out.width=1200, eval=FALSE}
beta_matrix[1:20, 1:6] %>% print(digits = 8)
```

Upvotes: 1

Views: 161

Answers (1)

DaveArmstrong
DaveArmstrong

Reputation: 22034

In your slides you can change the size of the code (and output) with CSS. Put this in your slides

```{css echo=FALSE}
.small-code .remark-code{
  font-size: 45%
}
```

Then, you can use that to change the size of code in your slides in the following way.

.small-code[
  ```{r, out.width=1200, out.height=300, out.width=1200, eval=FALSE}
  beta_matrix[1:20, 1:6] %>% print(digits = 8)
  ```
]      

You may have to change the size in the css from 45% to something else to suit your needs.

Upvotes: 1

Related Questions