quarto-dev / quarto-dev/quarto-cli
Problem parsing raw LaTeX table environment with option (like H position)
@cscheid is already working on this.
Since Apr 29, 2024.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
I am using Quarto to prepare a document. I want to render it as PDF/Latex document. In this document, I need some tables, which I am formatting using kableExtra package. I want to HOLD the position of the table, so that they don't appear on the next page. But when I add "HOLD_position" option in the kable_styling, it adds an extra [H] above the table. Interestingly, even if I have set tbl-cap-position below the table, this [H] remains above the table instead of moving with the caption.
A minimal example is given below.
I created an issue with the repository of kableExtra, thinking that it is an issue with the package. But from the comment in that issue, I realized that this issue doesn't happen if I use R Markdown document instead of Quarto. Therefore, I am creating a bug report here.
Steps to reproduce
---
title: "Exp_KableExtra"
author: "Maulik"
date: "`r Sys.Date()`"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse) #optional
library(knitr)
library(kableExtra)
```
Now I am adding some data.
```{r}
#| echo: false
#| label: tbl-cars
#| tbl-cap: "Some cars"
head(mtcars) |> kableExtra::kbl(booktabs = TRUE) |> kable_styling(latex_options = c("striped", "bordered","HOLD_position"),full_width = FALSE) %>% column_spec(2, width = "30em")
Expected behavior
There should not be [H] in the table caption.
Actual behavior
There is an [H] written above the table.
Your environment
RSudio Version: 2024.04.0 Build 725, OS: Windows 11
Quarto check output
$ quarto
$ quarto check
Quarto 1.5.31
[>] Checking versions of quarto bin
ary dependencies...
Pandoc version 3.1.13: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dep
endencies......OK
[>] Checking Quarto installation...
...OK
Version: 1.5.31
Path: C:\Users\Hp\AppData\Loc
al\Programs\Quarto\bin
CodePage: 1252
[>] Checking tools.................
...OK
TinyTeX: (external install)
Chromium: (not installed)
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
(-) Checking LaTeX.................
...
() Checking LaTeX.................
...
(|) Checking LaTeX.................
...
(/) Checking LaTeX.................
...
[>] Checking LaTeX.................
...OK
Using: TinyTex
Path: C:\Users\Hp\AppData\Roa
ming\TinyTeX\bin\windows
Version: 2024
(|) Checking basic markdown render.
...
(/) Checking basic markdown render.
...
(-) Checking basic markdown render.
...
() Checking basic markdown render.
...
(|) Checking basic markdown render.
...
(/) Checking basic markdown render.
...
(-) Checking basic markdown render.
...
() Checking basic markdown render.
...
(|) Checking basic markdown render.
[>] Checking basic markdown render.
...OK
[>] Checking Python 3 installation.
...(None)
Unable to locate an installed
version of Python 3.
Install Python 3 from https:/
/www.python.org/downloads/
(|) Checking R installation........
...
(/) Checking R installation........
...
(-) Checking R installation........
...
[>] Checking R installation........
...OK
Version: 4.4.0
Path: C:/PROGRA1/R/R-441.0
LibPaths:
- C:/Users/Hp/AppData/Local
/R/win-library/4.4
- C:/Program Files/R/R-4.4.
0/library
knitr: 1.46
rmarkdown: 2.26
(|) Checking Knitr engine render...
...
(/) Checking Knitr engine render...
...
(-) Checking Knitr engine render...
...
() Checking Knitr engine render...
...
(|) Checking Knitr engine render...
...
(/) Checking Knitr engine render...
...
(-) Checking Knitr engine render...
...
() Checking Knitr engine render...
...
(|) Checking Knitr engine render...
...
(/) Checking Knitr engine render...
...
(-) Checking Knitr engine render...
...
() Checking Knitr engine render...
...
(|) Checking Knitr engine render...
...
(/) Checking Knitr engine render...
[>] Checking Knitr engine render...
...OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.