I tried using
kbl(dat1, booktabs = TRUE) %>%
kable_styling(latex_options = "hold_position")
in Quarto and it is not working well. I am getting a [!h] at the toprule and it appears than Latex is interpreting * "hold_position"* as "bottom" rather than "here. **latex_options = "HOLD_position" ** works.
See screenshot:
My Quarto code is below. Note the lipsum text is just a copy and paste from another file.
---
title: "Exercise 2"
author: "Anon."
format: pdf
editor: visual
---
## Introduction
```{r}
#| label: setup
#| include: false
library(tidyverse); library(kableExtra)
dat1 <- data.frame(xx = 1:5, yy = 5:1)
This is an MWE of a problem I am having with using kableExtra. @tbl-booktable is not rendering correctly.
#| label: tbl-booktable
#| tbl-cap: Booktable Example
#| echo: false
kbl(dat1, booktabs = TRUE) %>%
kable_styling(latex_options = "hold_position")
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placeratac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices.
Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.