0

How to fix Float too large for page by 281.56999pt on input line 453?

Here's an example rmarkdown file:

---
output:
  pdf_document:
    latex_engine: xelatex
---

```{r, results='asis'}
library(flextable)
data <- mtcars[1:50,1:8]
ft <- flextable(data)
autofit(ft)

>LaTeX Warning: Float too large for page by 281.56999pt on input line 453.

2 Answers2

1

It looks like I haven't fully explained what I mean. The end part of the table generated by flextable::flextable() is not shown on the next page in the pdf file. Here is another example of the tables generated with KableExtra::kable() and FlexTable::flextable().

---

output:
  pdf_document:
    latex_engine: xelatex
---

```{r, results='asis'}
knitr::kable(iris[1:80,])
flextable::flextable(iris[1:80,])
0

Using set_table_properties(ft, layout = "autofit") will let latex do the column sizing:

---
output:
  pdf_document:
    latex_engine: xelatex
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

```{r}
library(flextable)
data <- mtcars[1:50,1:8]
ft <- flextable(data)
set_table_properties(ft, layout = "autofit")
```
David Gohel
  • 9,180
  • 2
  • 16
  • 34
  • Thanks a lot. It seems that I did not explain my problem correctly, so I have tried to explain it once more. You can find it here: https://stackoverflow.com/a/65253824/14807779 – Vasyl Mohytych Dec 11 '20 at 15:18