davidgohel / flextable

table farming
https://ardata-fr.github.io/flextable-book/
561 stars 81 forks source link

Problem when rending a flextable to Beamer presentation #555

Closed dr-phuong closed 1 year ago

dr-phuong commented 1 year ago

Hi,

I encountered similar issues in this post when rendering a flextable in a Beamer presentation.

The problem:

Surprisingly, it worked fine in knitting all other document formats like Word, PDF, PPTX, and HTML, except for Beamer. And I can also knit everything to beamer (text, figure, tables by kable), except a flextable. So the problem is only knitting a felxtable to beamer presentation.

Note: I tried this Rmd file on three computers, 2 Mac Pro (1 intel, 1 M1) and 1 Dell, and they all showed the same error below.

So I was wondering if there is a bug either in flextable or TinyTex.

I also tried to seek public support in Stack in this post Still, I would appreciate it if you could have a chance to check if there is any bug/issue in flextable. Thank you in advance!

Example codes:

---
output:
  beamer_presentation: default
  pdf_document: default
  powerpoint_presentation: default
  ioslides_presentation: default
  word_document: default
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(flextable)
```

## Slide
```{r echo=FALSE, results='asis'}
example_ft <-
  iris |> head() |> 
  flextable()
example_ft
```

Error:

processing file: test2.Rmd

/usr/local/bin/pandoc +RTS -K512m -RTS test2.knit.md --to beamer --from markdown+autolink_bare_uris+tex_math_single_backslash --output test2.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --highlight-style tango --pdf-engine pdflatex --embed-resources --standalone output file: test2.knit.md

! Undefined control sequence.

\Oldarrayrulewidth Error: LaTeX failed to compile test2.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See test2.log for more info. Execution halted

Debug tried:

Every attempt to debug the problem was unsuccessful, despite trying the following steps:

  1. Re-installing/Updating R.
  2. Re-installing/Updating R Studio.
  3. Re-installing/Updating all the packages.
  4. Restarting the R session.
  5. Following the debugging instructions provided in this link https://yihui.org/tinytex/r/#debugging

My session information:

sessionInfo()

R version 4.3.1 (2023-06-16) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.3

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Asia/Tokyo tzcode source: internal

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] gtsummary_1.7.1 kableExtra_1.3.4.9000 lubridate_1.9.2 forcats_1.0.0 stringr_1.5.0
[6] dplyr_1.1.2 purrr_1.0.1 readr_2.1.4 tidyr_1.3.0 tibble_3.2.1
[11] ggplot2_3.4.2 tidyverse_2.0.0 flextable_0.9.2

loaded via a namespace (and not attached): [1] tidyselect_1.2.0 viridisLite_0.4.2 fastmap_1.1.1 xaringan_0.28 fontquiver_0.2.1
[6] broom.helpers_1.13.0 promises_1.2.0.1 digest_0.6.33 timechange_0.2.0 mime_0.12
[11] lifecycle_1.0.3 ellipsis_0.3.2 gfonts_0.2.0 processx_3.8.2 magrittr_2.0.3
[16] compiler_4.3.1 sass_0.4.6 rlang_1.1.1 tools_4.3.1 gt_0.9.0
[21] utf8_1.2.3 yaml_2.3.7 data.table_1.14.8 knitr_1.43 askpass_1.1
[26] prettyunits_1.1.1 htmlwidgets_1.6.2 pkgbuild_1.4.2 curl_5.0.1 xml2_1.3.5
[31] rsconnect_0.8.29 pkgload_1.3.2.1 httpcode_0.3.0 miniUI_0.1.1.1 withr_2.5.0
[36] grid_4.3.1 fansi_1.0.4 urlchecker_1.0.1 profvis_0.3.8 gdtools_0.3.3
[41] xtable_1.8-4 colorspace_2.1-0 scales_1.2.1 crul_1.4.0 tinytex_0.45
[46] cli_3.6.1 rmarkdown_2.23 crayon_1.5.2 ragg_1.2.5 generics_0.1.3
[51] remotes_2.4.2 rstudioapi_0.15.0 httr_1.4.6 tzdb_0.4.0 sessioninfo_1.2.2
[56] cachem_1.0.8 rvest_1.0.3 vctrs_0.6.3 devtools_2.4.5 webshot_0.5.5
[61] jsonlite_1.8.7 fontBitstreamVera_0.1.1 xaringanthemer_0.4.2 callr_3.7.3 hms_1.1.3
[66] systemfonts_1.0.4 jquerylib_0.1.4 glue_1.6.2 ps_1.7.5 DT_0.28
[71] stringi_1.7.12 gtable_0.3.3 later_1.3.1 munsell_0.5.0 pillar_1.9.0
[76] htmltools_0.5.5 openssl_2.0.6 R6_2.5.1 textshaping_0.3.6 evaluate_0.21
[81] shiny_1.7.4.1 memoise_2.0.1 bslib_0.5.0 fontLibera

davidgohel commented 1 year ago

Yesterday you cross posted this on 3 diff websites and tagged me when possible. This is spam

The original issue already states it is not working, it is open, it states also 'help needed', can't you read?

Insisting does not make things done and is irritating. If you go on, you will be banned from this repo

dr-phuong commented 1 year ago

Update:

A partial solution is posted in Stack

By using the older version of flextable (ver 0.6.6) I can knit it into beamer presentation.

davidgohel commented 1 year ago

OK I am banning you

davidgohel commented 1 year ago

The previous version is using an image as written in the original post

github-actions[bot] commented 10 months ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.