Search code examples
rr-markdownpdf-generationflextablepdfdocument

How to split a FlexTable across more than 1 page? PDF output, RMarkdown


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.

Solution

  • 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,])