Officedown: Error: 'rpptx_document2' is not an exported object from 'namespace:officedown'

Created on 13 Nov 2020  Â·  7Comments  Â·  Source: davidgohel/officedown

Although the manual of officedown states that 'rpptx_document2 also supports cross reference based on the syntax of the bookdown package', actually there is no function called rpptx_document2 and this halts the knitting a pptx document with an error: Error: 'rpptx_document2' is not an exported object from 'namespace:officedown'. Due to this problem, it is impossible to cross-refer a figure/table number.

  • [x] Provide the code that is producing the error, it has to be a minimal reproducible example.
---
title: "Week 8"
author: "CLRR"
output: 
  officedown::rpptx_document2:
    keep_md: TRUE
---

## test

Description
  • [x] Provide the results of R command sessionInfo().
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Japanese_Japan.932  LC_CTYPE=Japanese_Japan.932    LC_MONETARY=Japanese_Japan.932 LC_NUMERIC=C                   LC_TIME=Japanese_Japan.932    

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

other attached packages:
 [1] viridis_0.5.1     viridisLite_0.3.0 magrittr_1.5      forcats_0.5.0     stringr_1.4.0     dplyr_1.0.2       purrr_0.3.4       readr_1.4.0       tidyr_1.1.2      
[10] tibble_3.0.4      ggplot2_3.3.2     tidyverse_1.3.0  

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0     xfun_0.19            haven_2.3.1          colorspace_1.4-1     vctrs_0.3.4          generics_0.1.0       htmltools_0.5.0      yaml_2.2.1          
 [9] rlang_0.4.8          pillar_1.4.6         withr_2.3.0          glue_1.4.2           DBI_1.1.0            gdtools_0.2.2        dbplyr_2.0.0         modelr_0.1.8        
[17] readxl_1.3.1         uuid_0.1-4           lifecycle_0.2.0      munsell_0.5.0        gtable_0.3.0         cellranger_1.1.0     rvest_0.3.6          zip_2.1.1           
[25] memoise_1.1.0        evaluate_0.14        labeling_0.4.2       knitr_1.30           fansi_0.4.1          broom_0.7.2          Rcpp_1.0.5           backports_1.2.0     
[33] scales_1.1.1         jsonlite_1.7.1       farver_2.0.3         systemfonts_0.3.2    fs_1.5.0             gridExtra_2.3        hms_0.5.3            digest_0.6.27       
[41] stringi_1.5.3        officedown_0.2.0.002 grid_4.0.2           cli_2.1.0            tools_4.0.2          crayon_1.3.4         pkgconfig_2.0.3      ellipsis_0.3.1      
[49] xml2_1.3.2           rvg_0.2.5            reprex_0.3.0         lubridate_1.7.9      assertthat_0.2.1     rmarkdown_2.5        officer_0.3.15       httr_1.4.2          
[57] rstudioapi_0.11      R6_2.5.0             compiler_4.0.2 

The version of Pandoc available in my environment is good enough to produce the pptx output.

rmarkdown::pandoc_version()
[1] ‘2.10.1’
  • [x] Make sure you did checked you had the latest version of the package on CRAN (and on github if issue exists with CRAN version).
packageVersion("officedown")
[1] ‘0.2.0.2’
  • [x] Make sure you searched in the open and closed issues on the github repository.
bug

All 7 comments

thanks, this was a mistake and that text should not be there. It's fixed now

OK, but don't you support cross-referencing function in rpptx_document, or is there such a supplemental function already?

no, this is not a feature as it is not a possible feature with PowerPoint - you still can use bookdown cross-ref...

Do you mean \@ref(...)?
Actually, the following example fails to cross-refer the figure number.

image

---
date: "`r Sys.Date()`"
author: "Your Name"
title: "Untitled"
output: 
  officedown::rpptx_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)
library(ggplot2)
library(rvg)
```

## Slide with Plot

::: columns

:::: column

```{r plot1, fig.cap='pressure'}
plot(pressure)
```

::::

:::: column

\@ref(fig:plot1)

::::

:::

Actually, the following example fails to cross-refer the figure number.

This is not a feature as it is not a possible feature with PowerPoint - you still can use bookdown cross-ref.

`````

date: "r Sys.Date()"
author: "Your Name"
title: "Untitled"
output:
officedown::rpptx_document:

base_format: bookdown::powerpoint_presentation2

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.cap = TRUE)
library(officedown)


## Slide with Plot

::: columns

:::: column

```{r plot1, fig.cap='pressure'}
plot(pressure)

::::

:::: column

\@ref(fig:plot1)

::::

:::

`````

This is what has been implemented for PPT:

PowerPoint

The package also enhances PowerPoint productions with R Markdown by providing a
mechanism for placing results according to the slide template contained in the
PowerPoint document used as "reference_doc". It becomes easy to add several
contents in the same slide.

The package also offers the possibility to transform your graphic instructions
into editable vector graphics (with the rvg package) by simply wrapping your
call into a call to function dml.

Thank you for giving me a good example. base_format: bookdown::powerpoint_presentation2 does the trick...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CLRafaelR picture CLRafaelR  Â·  6Comments

hmeleiro picture hmeleiro  Â·  7Comments

evanmascitti picture evanmascitti  Â·  3Comments

madlogos picture madlogos  Â·  7Comments

hlherrera picture hlherrera  Â·  5Comments