rtables icon indicating copy to clipboard operation
rtables copied to clipboard

Numbering tt_to_flextable in Quarto

Open dmenne opened this issue 2 years ago • 2 comments

For my reporting, being able to number tables and figures is essential; my attempts to keep up with the working/non-working solutions for html and Microsoft word fills gists (https://gist.github.com/dmenne/f8eb291c9e71a5de44764d442e8bdefd).

When trying to update the gist, I noted that tt_to_flextable does not create table numbering, but flextable alone does. For ASCII tables, see Quatro-Team: "We are working on this" for one year now

---
title: "tabletest"
tbl-cap-location: bottom
echo: false
---
#| include: false
library(rtables)
library(kableExtra)
df = data.frame(a = 1:3, b = letters[1:3])
#| label: tbl-flex1
#| tbl-cap: Flextable caption
flextable::flextable(df)
#| label: tb-qtable
#| tbl-cap: ASCII Table
qtable(df)
#| label: tb-flex2
#| tbl-cap: rtable to flex
qtable(df) |> tt_to_flextable()

No table numbering

dmenne avatar Jan 03 '24 08:01 dmenne

tt_to_flextable() returns a flextable object, so you should be able to add it in post-processing, right? like with set_caption (https://davidgohel.github.io/flextable/reference/set_caption.html)

Melkiades avatar Jan 05 '24 15:01 Melkiades

It's a workaroun, but i would be much better if Quarto chunks would be honored.

dmenne avatar Jan 08 '24 10:01 dmenne

Closing this as it seems something more relevant to the quarto team than us. Feel free to reopen if there are updates

Melkiades avatar Jul 09 '24 15:07 Melkiades