Quarto生成docx时minibar在knit_print()中不显示但预览正常
Quarto生成Docx文档时flextable表格minibar不显示问题
使用Quarto制作Word文档报告时,遇到以下问题:表格中的minibar元素在通过knit_print()生成的最终docx报告中无法显示,但调用print(preview="docx")生成的临时预览文档里,该表格能正常显示minibar。
示例代码
--- format: docx ---
#| label: my_test #| tbl-cap: "" #| echo: false #| warning: false library(flextable) library(magrittr) library(knitr) ft <- flextable(head(iris, n = 10)) ft <- compose(ft, j = 1, value = as_paragraph( minibar(value = Sepal.Length, max = max(Sepal.Length))), part = "body" ) ft %>% autofit() %>% #knit_print() print(preview="docx")
注:启用
knit_print()时,Word文档不显示minibar;使用print(preview="docx")则临时docx中显示正常。
sessionInfo()信息
> sessionInfo() R version 4.2.2 (2022-10-31) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS 14.1 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] knitr_1.40 magrittr_2.0.3 flextable_0.9.4 loaded via a namespace (and not attached): [1] zip_2.3.1 Rcpp_1.0.9 fontBitstreamVera_0.1.1 [4] pillar_1.9.0 compiler_4.2.2 later_1.3.1 [7] gfonts_0.2.0 tools_4.2.2 uuid_1.1-0 [10] digest_0.6.30 jsonlite_1.8.3 evaluate_0.18 [13] lifecycle_1.0.3 tibble_3.2.1 pkgconfig_2.0.3 [16] rlang_1.1.3 shiny_1.8.0 cli_3.6.2 [19] rstudioapi_0.14 curl_4.3.3 crul_1.3 [22] yaml_2.3.6 fontLiberation_0.1.0 xfun_0.39 [25] fastmap_1.1.1 xml2_1.3.3 officer_0.6.3 [28] askpass_1.1 systemfonts_1.0.4 gdtools_0.3.5 [31] vctrs_0.6.5 grid_4.2.2 glue_1.6.2 [34] httpcode_0.3.0 data.table_1.14.4 R6_2.5.1 [37] textshaping_0.3.7 fansi_1.0.3 rmarkdown_2.18 [40] fontquiver_0.2.1 ellipsis_0.3.2 promises_1.2.0.1 [43] htmltools_0.5.7 mime_0.12 xtable_1.8-4 [46] httpuv_1.6.11 ragg_1.2.7 utf8_1.2.2 [49] openssl_2.0.4 crayon_1.5.2
内容的提问来源于stack exchange,提问作者rvidal
相关产品推荐
相关产品推荐

