In an r notebook viewed in RStudio, I can have the following yaml, setup, r chunk, and text:
---
title: "R Notebook"
output:
html_notebook:
fig_height: 2
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.height=2, fig.width=2, out.height=2, out.width=2)
```
```{r fig.height=2, fig.width=2, out.height=2, out.width=2}
rmarkdown::html_notebook_output_html(
"<div style='border:1px solid red'>hello</div>"
)
```
goodbye
Note the variety of ways I'm trying to establish the height for the html object. For the .nb.html file, this outputs just fine. 'Goodbye' is right after a red bordered 'hello'.
However, for the in-document output that follows immediately after the code chunk, the output is quite tall (I believe the default is 7 inches, and that's about what it seems to be), and certainly outsizes its contents. The size directives (fig.height, out.height) are ignored.
Is there a more appropriate way to set the size?
I ran into the issue when using kable:
```{r fig.height=2, fig.width=2, out.height=2, out.width=2}
knitr::kable(data.frame(col1 = c('hello')), 'html')
```
Though I don't think it's a kable issue, based on the first example, I believe it's an rmarkdown issue.