vincentarelbundock / modelsummary

Beautiful and customizable model summaries in R.
http://modelsummary.com
Other
911 stars 75 forks source link

Typst Error with notes #788

Closed DominikVogel closed 3 months ago

DominikVogel commented 3 months ago

Sorry that I have to come back with Typst. It seems like the "notes" argument causes an error (Quarto 1.5.52).

Reproducible example

  ---
  title: "Test"
  format: typst
  ---

  ```{r}
  library(modelsummary)

  model1 <- lm(mpg ~ cyl, data = mtcars)

  modelsummary(
    model1,
    notes = "Standard Errors in Parentheses"
  )

## Error

==> quarto preview test.qmd --to typst --no-watch-inputs --no-browse

processing file: test.qmd

output file: test.knit.md

pandoc to: typst output-file: test.typ standalone: true shift-heading-level-by: -1 default-image-extension: svg wrap: none citeproc: false

metadata title: Test

[typst]: Compiling test.typ to test.pdf...error: cell's colspan would cause it to exceed the available column(s) ┌─ \?\C:\Git\test\test.typ:393:4 │ 393 │ table.cell(align: left, colspan: 5, [Standard Errors in Parentheses]), │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ │ = hint: try placing the cell in another position or reducing its colspan


## sessionInfo

R version 4.4.1 (2024-06-14 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8 LC_MONETARY=German_Germany.utf8 [4] LC_NUMERIC=C LC_TIME=German_Germany.utf8

time zone: Europe/Berlin tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] modelsummary_2.1.1.2

loaded via a namespace (and not attached): [1] vctrs_0.6.5 cli_3.6.3 gt_0.10.1 knitr_1.47
[5] rlang_1.1.4 xfun_0.45 generics_0.1.3 data.table_1.15.4
[9] glue_1.7.0 backports_1.5.0 performance_0.12.0.4 htmltools_0.5.8.1
[13] parameters_0.22.0.1 sass_0.4.9 datawizard_0.11.0 fansi_1.0.6
[17] grid_4.4.1 tibble_3.2.1 fastmap_1.2.0 lifecycle_1.0.4
[21] insight_0.20.1.10 compiler_4.4.1 dplyr_1.1.4 pkgconfig_2.0.3
[25] rstudioapi_0.16.0 digest_0.6.36 R6_2.5.1 tidyselect_1.2.1
[29] utf8_1.2.4 pillar_1.9.0 magrittr_2.0.3 checkmate_2.3.1
[33] withr_3.0.0 tools_4.4.1 xml2_1.3.6 bayestestR_0.13.2
[37] tables_0.9.28

vincentarelbundock commented 3 months ago

Thanks, those issues are super useful. I don't use Typst a ton myself, so I'm always happy when people test it.

This should be fixed using version 0.3.0.12 of tinytable from Github:

remotes::install_github("vincentarelbundock/tinytable")

Make sure you restart R before trying again.

DominikVogel commented 3 months ago

Thanks! It works now! What an incredible service!

DominikVogel commented 3 months ago

btw: the tables look awesome now!