quarto-dev / quarto-dev/quarto-cli

Subtitles on computational generated tables remove tbl-colwidths execution option

Open
#10,236 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug docx tables
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

When I add table sub captions, it removes the column width execution option input.

Steps to reproduce

---
format:
  docx
---

```{python}
#| output: false
#| echo: false

import pandas as pd
import numpy as np
from IPython.display import Markdown, display
from tabulate import tabulate

# Create a 10x10 DataFrame with random integers between 0 and 100
data = np.random.randint(0, 100, size=(2, 2))
df = pd.DataFrame(data)
```

This removes the col-widths.
```{python}
#| echo: false
#| label: tbl-global-markets-tables
#| warning: false
#| tbl-cap: ""
#| tbl-subcap:
#|   - "Table 1"
#|   - "Table 2"
#|   - "Table 3"
#| layout-ncol: 3
#| tbl-colwidths: [80,15,15]

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

```

This keeps the col-widths.
```{python}
#| echo: false
#| warning: false
#| layout-ncol: 3
#| tbl-colwidths: [80,15,15]

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

display(Markdown(tabulate(
    df, headers=df.columns, showindex=True)))

```

Expected behavior

The colwidths should be the same for the last two cells.

Actual behavior

The col width in the first cell that displays the tables have a fixed width it looks like.

Your environment
  • IDE: VSCode
    Version: 1.90.2 (Universal)
    Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
    Date: 2024-06-18T22:37:41.291Z
    Electron: 29.4.0
    ElectronBuildId: 9728852
    Chromium: 122.0.6261.156
    Node.js: 20.9.0
    V8: 12.2.281.27-electron.0
    OS: Darwin arm64 22.5.0

  • OS: Ventura 13.4 (22F66)

Quarto check output
Quarto 1.4.554
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.554
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.06
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/user/Library/TinyTeX/bin/universal-darwin
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.6
      Path: /Users/user/Desktop/home/27_interns/gm_quant_intern_2024/env/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by rendering the supplied Quarto document to DOCX and compare the first table cell with the later cells, focusing on the interaction between tbl-subcap and tbl-colwidths. Done means the generated tables retain the requested [80,15,15] widths when subtitles are present, while the existing no-subtitle case remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.