quarto-dev / quarto-dev/quarto-cli
Both figure and table captions are being converted to actual table structures within Word. This results in the captions being displayed as tables, not text, completely breaking the document layout and structure.
@cscheid is already working on this.
Since Dec 30, 2024.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
"I'm encountering a significant issue when converting Quarto documents to Word (.docx) format. Instead of correctly rendering figure and table captions as either "Image Caption" or "Table Caption" styles, Quarto is erroneously converting them into actual Word "Table" elements. This means that the captions are not displayed as text paragraphs but are instead rendered as full-fledged tables within the Word document. This is a very peculiar and serious error, as the captions should clearly be text content associated with figures and tables, not actual tables themselves.
To be more specific:
Expected behavior: Figure captions should be rendered using the "Image Caption" style in Word, and table captions should be rendered using the "Table Caption" style (or at least as normal paragraph text associated with table/figures ).
Actual behavior: Both figure and table captions are being converted to actual table structures within Word. This results in the captions being displayed as tables, not text, completely breaking the document layout and structure.
This is happening in all cases, regardless of whether the caption is for a figure or a table. I've checked for any potential configuration issues and verified that my Pandoc setup is correct, which leads me to believe that this might be a bug within Quarto itself.
I would be grateful if you could investigate this issue and provide a potential workaround or solution."
Steps to reproduce
---
title: "test"
execute:
keep-md: true
format:
docx:
df-print: kable
---
## Quarto
```{r}
#| echo: false
#| warning: false
#| tbl-cap: iris
#| table-style: CaptionStyle
#| label: notbl-iris
head(iris) |>
pander::pander()
```
```{r}
#| echo: false
#| warning: false
#| tbl-cap: hello
#| table-style: CaptionStyle
#| label: tbl-tcmdatapath
head(iris) |>
pander::pander()
```
Expected behavior
Figure captions should be rendered using the "Image Caption" style in Word, and table captions should be rendered using the "Table Caption" style (or at least as normal paragraph text associated with table/figures
Actual behavior
Both figure and table captions are being converted to actual table structures within Word. This results in the captions being displayed as tables, not text, completely breaking the document layout and structure.
Your environment
windows11 ,Rstudio ,quarto latest 1.6*
Quarto check output
$ quarto check
Quarto 1.6.39
[>] Checking environment information...
Quarto cache location: C:\Users\fanxf\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.6.39
Path: C:\ProgramData\chocolatey\lib\quarto\tools\bin
CodePage: 65001
[>] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\fanxf\AppData\Roaming\TinyTeX\bin\windows
Version: 2024
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.12.4
Path: C:/Python312/python.exe
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with py -m pip install jupyter
[>] Checking R installation...........OK
Version: 4.4.1
Path: C:/PROGRA1/R/R-441.1
LibPaths:
- C:/Users/fanxf/AppData/Local/R/win-library/4.4
- C:/Program Files/R/R-4.4.1/library
knitr: 1.48
rmarkdown: 2.28
[>] 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.