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

typst: table captions dont work #247

Closed aghaynes closed 6 months ago

aghaynes commented 6 months ago

Table captions don't seem to work for typst at the moment whether entered via tbl-cap nor the caption argument.

Here's an example using kable and two variations with tt:

---
title: "Untitled"
format: typst
execute:
  echo: false

---

```{r}
#| tbl-cap: MTCARS
mtcars |> head() |> knitr::kable()
#| tbl-cap: MTCARS
mtcars |> head() |> tinytable::tt()
#| tbl-cap: MTCARS
mtcars |> head() |> tinytable::tt(caption = "mtcars")


![image](https://github.com/vincentarelbundock/tinytable/assets/6594028/47eb4d77-dd2d-4b71-be82-35a6739dae46)
vincentarelbundock commented 6 months ago

You need to specify the label chunk option as well, not just tbl-cap. This is a Quarto quirk discussed here: https://github.com/quarto-dev/quarto-cli/issues/9369

aghaynes commented 6 months ago

Ah, OK, thanks!

On a different note, maybe it would be nice to center align the table, as with kable?

Also, how about support for rotating tables? image

typst doesnt handle tables that are too wide (when rotated) for the page then though :( but maybe there's something that they can do

vincentarelbundock commented 6 months ago

Closing because I added a point of information in the FAQ document.