Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtitles on computational generated tables remove tbl-colwidths execution option #10236

Open
rcyost opened this issue Jul 6, 2024 · 5 comments
Labels
bug Something isn't working docx Issues with the docx format tables Issues with Tables including the gt integration
Milestone

Comments

@rcyost
Copy link

rcyost commented Jul 6, 2024

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

@rcyost rcyost added the bug Something isn't working label Jul 6, 2024
@rcyost
Copy link
Author

rcyost commented Jul 6, 2024

custom-reference-doc.docx
Here is the custom reference doc.

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 6, 2024

Thank for the report, but is a custom reference doc needed? If so, then the issue is likely the source of the issue.

@mcanouil mcanouil added the docx Issues with the docx format label Jul 6, 2024
@rcyost
Copy link
Author

rcyost commented Jul 6, 2024

Simply giving for completeness. The bug occurs with or without custom doc.

@mcanouil
Copy link
Collaborator

mcanouil commented Jul 6, 2024

FYI, providing more than needed means more work because we need to remove things one at a time and rule out possibilities (weird options interactions, etc.).
For instance, I suspect the below options are not necessary:

toc: true
number-sections: true
dpi: 200
format:
  docx:
    reference-doc: custom-reference-doc.docx

The following is probably enough, isn't it?

format: docx

@rcyost
Copy link
Author

rcyost commented Jul 6, 2024

You are right, apologies. I have update the original post. I also checked on my end and the expected output is still not generated. Thank you.

@cscheid cscheid added the tables Issues with Tables including the gt integration label Jul 8, 2024
@cscheid cscheid added this to the Future milestone Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docx Issues with the docx format tables Issues with Tables including the gt integration
Projects
None yet
Development

No branches or pull requests

3 participants