kableExtra kable_styling(latex_options = "hold_position")

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.

Hi,

Can you format your Qmd content correctly so that I can copy paste without issue ?

FAQ: How to Format R Markdown Source

Also, please to try latest version Quarto available at quarto.org .

Problem solved. I had not realized that their was a new version of Quarto. Quarto 1.2.280 has cured the problem. Thanks.

Sorry about the formatting, I seem to have done something that screwed up the paste. I just reproduced it one and now cannot repeat it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.