Use PowerPoint template with officedown

612 Views Asked by At

Basic question here - how do I get to create a powerpoint document with {officedown} using a template. The document is pretty much empty at this stage. I can create a Power Point file without a template, but when adding the following YAML header:

output: 
  officedown::rpptx_document:
    reference_doc: Template.pptx

I get

Error: `x` must be a string of length 1
In addition: Warning message:
In fortify_location.location_label(location, doc = x) :
  more than a row have been selected
Execution halted

I've tried changing "reference_doc" for reference "reference_docx" and "reference_pptx" with no avail.

Please note that:

  • I have no issues creating Word files with a template with {officedown}
  • The template has been used already with output:powerpoint_presentation: - it has all the bits and pieces required by markdown

Thanks! Carlos

My sessionInfo() output is

R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

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

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

other attached packages:
[1] officedown_0.2.3.001

loaded via a namespace (and not attached):
 [1] zip_2.1.1          Rcpp_1.0.6         RColorBrewer_1.1-2 compiler_4.1.0     pillar_1.6.1       remotes_2.3.0      tools_4.1.0       
 [8] uuid_0.1-4         digest_0.6.27      memoise_2.0.0      lubridate_1.7.10   evaluate_0.14      lifecycle_1.0.0    tibble_3.1.2      
[15] gtable_0.3.0       checkmate_2.0.0    lattice_0.20-44    pkgconfig_2.0.3    rlang_0.4.11       DBI_1.1.1          yaml_2.2.1        
[22] rgdal_1.5-23       xfun_0.23          fastmap_1.1.0      xml2_1.3.2         officer_0.3.18     metR_0.9.2         dplyr_1.0.6       
[29] knitr_1.33         systemfonts_1.0.2  gdtools_0.2.3      generics_0.1.0     vctrs_0.3.8        gtools_3.8.2       grid_4.1.0        
[36] tidyselect_1.1.1   glue_1.4.2         data.table_1.14.0  R6_2.5.0           rvg_0.2.5          fansi_0.5.0        rmarkdown_2.8     
[43] librarian_1.7.0    sp_1.4-5           ggplot2_3.3.3      purrr_0.3.4        magrittr_2.0.1     backports_1.2.1    scales_1.1.1      
[50] htmltools_0.5.1.1  ellipsis_0.3.2     assertthat_0.2.1   colorspace_2.0-1   utf8_1.2.1         munsell_0.5.0      cachem_1.0.5      
[57] crayon_1.4.1      

```
0

There are 0 best solutions below