Skip to content

rendering a gt table with typst in R quarto #11610

@torven-schalk

Description

@torven-schalk

Bug description

I'm trying to create a quarto document and render it to pdf via typst. I have source notes for my gt tables which don't accept any line break via \ or <br>. It works fine if just run in R but once rendered the line break doesn't work and it keeps the table at the width the source note occupies, no matter what I specify in cols_width()
When rendered to html the line breaks. But I can't get the line to break (and more importantly to make cols_width() work) when rendering to typst. Any help would be much appreciated.

I'm sorry if this is the wrong place to post it but I'm not sure if this is for quarto, gt, or typst to solve...

Steps to reproduce

---
title: "Untitled"
format: typst
---

```{r}
library(tidyverse)
library(gt)

head(mtcars) %>% 
  select(1:4) %>% 
  gt() %>% 
  tab_source_note(md("*Bla*. hello i'm a footnote thats<br>too long for this table.")) %>%
  cols_width(everything() ~ px(50))
```

Expected behavior

A gt table in pdf with the source note accepting a line break.

Actual behavior

No line break accepted

Your environment

RStudio 2023.12.1
R 4.4.0
Windows 11

Quarto check output

Quarto 1.6.39
[>] Checking environment information...
      Quarto cache location: C:\Users\name\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:\Users\name\AppData\Local\Programs\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2024.04
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\name\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

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

[>] Checking Python 3 installation....OK
      Version: 3.12.3
      Path: C:/Users/name/AppData/Local/Programs/Python/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.0
      Path: C:/Users/name/AppData/Local/Programs/R/R-4.4.0
      LibPaths:
        - C:/Users/name/projectlibrary/renv/library/windows/R-4.4/x86_64-w64-mingw32
        - C:/Users/name/AppData/Local/R/cache/R/renv/sandbox/windows/R-4.4/x86_64-w64-mingw32/716d6ec8
      knitr: 1.46
      rmarkdown: 2.27

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtablesIssues with Tables including the gt integrationtypstupstreamBug is in upstream library

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions