vincentarelbundock / tinytable

Simple and Customizable Tables in `R`
https://vincentarelbundock.github.io/tinytable
GNU General Public License v3.0
211 stars 18 forks source link

Error related to Math part when rendering Quarto notebook to typst #350

Closed feuerblitz7 closed 1 month ago

feuerblitz7 commented 1 month ago

I tried to render Math inside a table in a Quarto notebook, but when rendering it to typst format (pdf), I get an error:

[typst]: Compiling test.typ to test.pdf...error: unknown variable: rac
    ┌─ \\?\test.typ:354:4
    │
354 │ [$\frac{1}{2}$   ],
    │     ^^^

Any idea what could be wrong? My Quarto version is 1.5.57.

My test.qmd file:

---
title: "Test"
format: typst
---
library(tinytable)

dat <- data.frame(Math = c(
  "$x^2 + y^2 = z^2$",
  "$\\frac{1}{2}$"
))

tt(dat) |> style_tt(j = 1, align = "c")
vincentarelbundock commented 1 month ago

You are trying to compile a Typst table with LaTeX math in it. The math syntax in those two languages is different.

You might want to take a look at MiTeX, but I have never tried it myself. See: https://github.com/vincentarelbundock/tinytable/issues/345