quarto-dev / quarto-cli

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

Can not render markdown tables in pptx format. #6529

Open phongphuhanam opened 11 months ago

phongphuhanam commented 11 months ago

Bug description

Hello, Quarto couldn't convert markdown with tables to PPT/PPTX format. However, the conversion is working fine for docx/pdf/html.

Steps to reproduce

Example

---
title: "Tables"
format: 
  pdf: default
  docx: default
  pptx: default
---

| Col1 | Col2 | Col3 |
|------|------|------|
| A    | B    | C    |
| E    | F    | G    |
| A    | G    | G    |

: My Caption {#tbl-letters}

Expected behavior

The markdown table should be converted in pptx format.

Actual behavior

Table is missing in the PPTX output format. test_table_preview.pptx Here is the working conversion to DOCX and PDF format. test_table_preview.pdf test_table_preview.docx

Your environment

Quarto check output

quarto check
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /opt/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.4
      Path: /usr/bin/python3
      Jupyter: 5.3.0
      Kernels: python3

(|) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
rgaiacs commented 11 months ago

I confirm the bug (Quarto 1.4.268). This issue here is that PowerPoint does not support tables with captions. Drop the table caption like in

---
title: "Tables"
format: 
  pptx: default
---

| Col1 | Col2 | Col3 |
|------|------|------|
| A    | B    | C    |
| E    | F    | G    |
| A    | G    | G    |

produces the expected output.

Screenshot of table in Microsoft Office PowerPoint

Quarto can have a filter to drop the caption but it will break the cross references.

cscheid commented 11 months ago

Cf #4944

cderv commented 9 months ago
---
title: "Tables"
format: 
  pptx: default
---

| Col1 | Col2 | Col3 |
|------|------|------|
| A    | B    | C    |
| E    | F    | G    |
| A    | G    | G    |

: My Caption {#tbl-letters}

This now produces a table, however no caption image

quarto pandoc -t pptx -o test.pptx index.qmd does produce a caption image

So still something to fix.