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

112 views Asked by At

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)
```
1

There are 1 answers

0
DaveArmstrong On

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.