How to get linestretch option to not impact table generation? #9128
-
DescriptionI would like to include tables in my pdf document that has different line spacing compared to rest of the document. I noticed while writing a report that quarto linestretch will override flextable's ---
title: "Untitled"
format:
pdf:
linestretch: 2
---
```{r}
library(flextable)
```
```{r}
#| tbl-cap: This is a table
dat<- iris[1:5,]
flextable(dat) |>
line_spacing(space = .5)
```
```{r}
#| tbl-cap: This is a table
#| results: asis
dat<- iris[1:5,]
flextable(dat) |>
line_spacing(space = .5) |>
flextable_to_rmd()
``` I am on quarto verison 1.4.534, Windows 11. In the meantime, I save the flextable separately and import them as high quality png in my reports. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can't (pretty sure but not 100 %). |
Beta Was this translation helpful? Give feedback.
-
Using the setstretch command it will work but will impact the spacing of the code block as well. Which is fine for my needs. I tried manipulating the line-height directly with CSS and that did not work if I did it correctly. ---
title: "Untitled"
format:
pdf:
linestretch: 2
engine: knitr
---
```{css}
.table_format {
line-height: .5;
}
```
```{r}
library(flextable)
```
```{r}
#| tbl-cap: This is a table
dat<- iris[1:5,]
flextable(dat)
```
\setstretch{1.0}
```{r}
#| tbl-cap: This is a table
flextable(dat)
```
\setstretch{2}
```{r}
#| class-output: table_format
#| tbl-cap: This is a table
dat<- iris[1:5,]
flextable(dat)
```
|
Beta Was this translation helpful? Give feedback.
Using the setstretch command it will work but will impact the spacing of the code block as well. Which is fine for my needs. I tried manipulating the line-height directly with CSS and that did not work if I did it correctly.