Closed andrewheiss closed 3 months ago
I don't have as much time to diagnose because vacation, but I don't think the problem is \centering
. To illustrate, we can use the finalize
argument of style_tt()
to regex that bit out of the table, and it still breaks. In contrast, when using a raw tabular
environment (using the latest tinytable
0.3.0.20), things work fine.
So there seems to be a bad interaction between whatever fancy thing Quarto does and the tblr
environment from tabularray
. Not sure yet what it is...
Example:
```{r}
library(tinytable)
packageVersion("tinytable")
# Good
tt(head(mtcars)) |> theme_tt("tabular")
# Bad
clean <- function(x) {
if (x@output == "latex") {
x@table_string <- gsub("\\\\centering", "", x@table_string)
}
x
}
tt(head(mtcars)) |> style_tt(finalize = clean)
Requires tinytable
from Github as of this morning.
OK, I tracked down the problem, added a new feature to leverage as workaround, and documented all of this on the FAQ page:
https://vincentarelbundock.github.io/tinytable/vignettes/faq.html#quarto
Thanks for the report. This is an interesting use-case. I wasn't aware we could do things like that.
Great, thanks so much!
In Quarto, it's possible to create a custom crossref type for things like appendix tables. Here's a minimal reprex:
Caption goes here.
:::
ERROR: compilation failed- error LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help.
...
l.240 \centering
see testing.log for more information.