quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.82k stars 309 forks source link

Errant additional line in table caption is created when a second row of computationally generated tables is created #10237

Open rcyost opened 3 months ago

rcyost commented 3 months ago

Bug description

An additional line is created in the second row second column of a 3 col by 2 row set of tables is produced. This makes the tables in the second row sort of randomly unaligned. image

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)
#| 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)))

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 tables in the second row should be in the same line. There should be no additional space added.

### Actual behavior

There is an errant space added when putting tables in a second row.

### 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
mcanouil commented 3 months ago

Same as for your other issue.

Keep your example simple and small. If the custom reference document is required, then the issue is the reference document. If it is not required, then remove it.

rcyost commented 3 months ago

Apologies, have removed. Thought I was being complete, but added too much. Checked and the issue isn't with the reference doc.

rcyost commented 3 months ago

Also updated here to only have

---
format:
  docx
---