From 2dcd3cbf21428c15e88e67ed39a4f5b64509f28f Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 16 Nov 2024 14:23:00 -0500 Subject: [PATCH 1/2] bump --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index cb1e2811..c4224568 100644 --- a/NEWS.md +++ b/NEWS.md @@ -18,6 +18,7 @@ Bugs: * Typst notes returned an error since the last release. Thanks to @DominikVogel for report #357. * Duplicate group labels are allowed in LaTeX with `group_tt()`. Thanks to @eeemda for report #362. + ## 0.5.0 New: From 9191d5199ff75749f27a1d2624ca0eb3052eb4cd Mon Sep 17 00:00:00 2001 From: Vincent Arel-Bundock Date: Sat, 16 Nov 2024 16:07:18 -0500 Subject: [PATCH 2/2] Typst & Quarto --- R/finalize_typst.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/finalize_typst.R b/R/finalize_typst.R index 5309905a..6f1de15a 100644 --- a/R/finalize_typst.R +++ b/R/finalize_typst.R @@ -19,10 +19,11 @@ setMethod( # Quarto cross-references if (isTRUE(check_dependency("knitr"))) { - quarto_caption <- isTRUE(knitr::pandoc_to("typst")) && - isFALSE(getOption("tinytable_quarto_figure", default = FALSE)) - (!is.null(knitr::opts_current$get()[["label"]]) || - !is.null(knitr::opts_current$get()[["tbl-cap"]])) + flag_typst <- isTRUE(knitr::pandoc_to("typst")) + flag_option <- isTRUE(getOption("tinytable_quarto_figure", default = FALSE)) + flag_chunk_label <- isTRUE(grepl("^tbl-", knitr::opts_current$get()[["label"]])) + flag_chunk_caption <- !is.null(knitr::opts_current$get()[["tbl-cap"]]) + quarto_caption <- flag_typst && flag_option && (!flag_chunk_label || !flag_chunk_caption) if (quarto_caption) { out <- lines_drop_between(out, regex_start = "// start figure preamble",