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

Typst: table does not contain field cell #326

Closed
petermacp opened this issue Aug 22, 2024 · 3 comments
Closed

Typst: table does not contain field cell #326

petermacp opened this issue Aug 22, 2024 · 3 comments

Comments

@petermacp
Copy link

I also posted this on the quarto issues page, but wondered if this was actually a tinytable issue.

I have written a .qmd file containing typst code that I run in RStudio to compile my CV.

Recently I got a new computer, and now my .qmd file renders fine on the old machine, but not on the new machine.

I am now very wary about updating the old machine, in case I am not able to render the document at all.

Grateful for any suggestions about how to resolve.

New machine error:

[typst]: Compiling PM_CV_typst.typ to PM_CV_typst.pdf...error: function table does not contain field cell
┌─ PM_CV_typst.typ:352:14
│
352 │ #show table.cell: it => {
│ ^^^^```
@vincentarelbundock
Copy link
Owner

It will likely be impossible to help you without a fully reproducible minimal example. There are some tips on how to ask good software questions here:

https://marginaleffects.com/vignettes/help.html

Note that tables in tinytable require pre-release version of Quarto, which ships with a recent version of Typst.

@petermacp
Copy link
Author

Apologies for this. I have tried to add more information here to give a minimal example.

On my machine where rendering is not working, I have the following minimal file.

---
title: ""
format: 
  typst:
    keep-typ: true
    mainfont: "Source Sans Pro"
---



```{r}
library(tinytable)
dat <- mtcars[1:9, 1:8]
tt(dat) |> 
  group_tt(
    i = list("I like (fake) hamburgers" = 3,
             "She prefers halloumi" = 4,
             "They love tofu" = 7),
    j = list("Hamburgers" = 1:3,
             "Halloumi" = 4:5,
             "Tofu" = 7)) |>
  style_tt(
    i = c(3, 5, 9),
    align = "c",
    background = "black",
    color = "orange") |>
  style_tt(i = -1, color = "orange")

I can run the code chunk, and produce the table output in RStudio's viewer no problem.

However, when I press the render button, I get the following error:

[typst]: Compiling Untitled.typ to Untitled.pdf...error: function `table` does not contain field `cell`
    ┌─ Untitled.typ:445:14
    │
445 │   #show table.cell: it => {
    │               ^^^^

In case it is helpful.

> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.6.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

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

other attached packages:
[1] tinytable_0.4.0

loaded via a namespace (and not attached):
 [1] compiler_4.4.0    fastmap_1.2.0     cli_3.6.3         htmltools_0.5.8.1 tools_4.4.0       rstudioapi_0.16.0 yaml_2.3.10       fansi_1.0.6      
 [9] rmarkdown_2.28    knitr_1.48        xfun_0.47         digest_0.6.37     rlang_1.1.4       evaluate_0.24.0  

Many thanks.

@vincentarelbundock
Copy link
Owner

My guess is that you do not have the pre-release version of Quarto installed. You can get it here:

https://quarto.org/docs/download/prerelease.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants