Officedown: `rpptx_document`λŠ” μ—΄ 수 μ—†λŠ” pptx νŒŒμΌμ„ μƒμ„±ν•©λ‹ˆλ‹€.

에 λ§Œλ“  2020λ…„ 06μ›” 21일  Β·  6μ½”λ©˜νŠΈ  Β·  좜처: davidgohel/officedown

@davidgohel

officedown::rpptx_document λ₯Ό μ‚¬μš©ν•˜μ—¬ Rmd νŒŒμΌμ„ νŽΈμ§ν•˜λ©΄ 이 ν•¨μˆ˜λŠ” λ‹€μŒ 였λ₯˜ λ©”μ‹œμ§€μ™€ ν•¨κ»˜ μ—΄ 수 μ—†λŠ” pptx νŒŒμΌμ„ μƒμ„±ν•©λ‹ˆλ‹€.

PowerPoint found a problem with content in xxxx.pptx.
PowerPoint can attempt to repair the presentation.

Rmd의 λ‚΄μš©μ΄ eaxample의 경우 bookdown::powerpoint_presentation2 둜 편직 κ°€λŠ₯함을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ officedown::rpptx_document 에 일뢀 버그가 μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€.

MWE

---
title: "Untitled"
author: "CLRR"
date: "2020/6/20"
output: 
  officedown::rpptx_document:
    keep_md: TRUE
  bookdown::powerpoint_presentation2:
    keep_md: TRUE
  ---

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

## R Markdown

This is an R Markdown presentation. Markdown is a simple formatting syntax for     authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see     <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both     content as well as the output of any embedded R code chunks within the document.

## Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

## Slide with R Output

```{r cars, echo = TRUE}
summary(cars)
```

## Slide with Plot

```{r pressure}
plot(pressure)
```

μ„Έμ…˜ 정보

rmarkdown::pandoc_version()
[1] β€˜2.9.2.1’
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

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     

loaded via a namespace (and not attached):
Rcpp_1.0.4.6      
packrat_0.5.0     
digest_0.6.25     
R6_2.4.1          
magrittr_1.5      
officedown_0.1.0  
evaluate_0.14     
zip_2.0.4         
gdtools_0.2.2     
rlang_0.4.6       
uuid_0.1-4        
xml2_1.3.2        
rmarkdown_2.2    
tools_4.0.0       
officer_0.3.11    
xfun_0.14         
yaml_2.2.1        
compiler_4.0.0    
systemfonts_0.2.3 r
vg_0.2.4         
memoise_1.1.0     
htmltools_0.4.0   
knitr_1.28

λͺ¨λ“  6 λŒ“κΈ€

μ‹ κ³ ν•΄ μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€.

Windows용 Rμ—μ„œλ§Œ λ°œμƒν•˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. μ–΄λ””κ°€ λ¬Έμ œμΈμ§€ 아직 λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€.

κ°€μž₯ λ¨Όμ €:
멋진 νŒ¨ν‚€μ§€μ— κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€ - 정말 μ’‹μŠ΅λ‹ˆλ‹€! 특히 flextableκ³Ό κ΄€λ ¨ν•˜μ—¬ μž‘μ—…/μ‚¬μš©ν•˜λŠ” 것이 μ¦κ²μŠ΅λ‹ˆλ‹€.

λ‚΄ κ΄€μ μ—μ„œ Windows의 λ¬Έμ œλŠ” reference_doc κ°’μœΌλ‘œ 인해 λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.
μž₯κ΅μ—μ„œ pptx-ν…œν”Œλ¦Ώμ„ μ‚¬μš©ν•˜λŠ” 것이 Windowsμ—μ„œ μž‘λ™ν•˜μ§€ μ•ŠλŠ” κ²ƒμ²˜λŸΌ λ³΄μ΄μ§€λ§Œ(μ•„λž˜ μ°Έμ‘°), μ½”λ“œλŠ” pandoc μ°Έμ‘° ν…œν”Œλ¦Ώμ„ μ‚¬μš©ν•˜μ—¬ μž‘λ™ν•©λ‹ˆλ‹€.

---
title: "Untitled"
author: "CLRR"
date: "2020/6/20"

output: 
   officedown::rpptx_document:
     # not working:
     # reference_doc: C:/R/lib/officer/template/template.pptx
     # set reference_doc to standard pandoc layout:
     # system2(rmarkdown::pandoc_exec(), args = c("--print-default-data-file", "reference.pptx"), stdout = "C:/R/pandoc_layout.pptx")
     reference_doc: C:/R/pandoc_layout.pptx
     keep_md: TRUE

---


## R Markdown

Test


ν…œν”Œλ¦Ώ 선택(pandocs μ°Έμ‘° λ¬Έμ„œ λŒ€μ‹  μž„μ› λ‚΄λΆ€ ν…œν”Œλ¦Ώ μ‚¬μš©)은 officedown:::get_default_pandoc_data_file ν•¨μˆ˜ λ‚΄μ—μ„œ 트리거될 수 μžˆμŠ΅λ‹ˆλ‹€.
Pandoc-pptx-reference λ¬Έμ„œ μ‚¬μš© ν™œμ„±ν™”λ₯Ό μ°Έμ‘°ν•˜μ‹­μ‹œμ˜€.

@mtkerbeR

μ œμ•ˆν•œ R μ½˜μ†”μ—μ„œ λ‹€μŒ λͺ…령이 μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

> system2(rmarkdown::pandoc_exec(), args = c("--print-default-data-file", "reference.pptx"), stdout = "C:/R/pandoc_layout.pptx")
pandoc.exe: <stdout>: hPutBuf: invalid argument (Bad file descriptor)

pandoc_layout.pptxλŠ” 본질적으둜 μ–΄λ””μ—μ„œ μ’…λ£Œλ˜μ–΄μ•Ό ν•©λ‹ˆκΉŒ? μ•„λ‹ˆλ©΄ 직접 pptx νŒŒμΌμ„ λ§Œλ“€μ–΄μ•Ό ν•˜λ‚˜μš”? $#$ C R 디렉토리가 μ—†μŠ΅λ‹ˆλ‹€. 즉, C:/R/ 이 μ—†μŠ΅λ‹ˆλ‹€. λ‚˜λŠ” C:\Program Files\R , C:\Program Files\RStudio , C:\Users\my-user-name\AppData\Local\RStudio , C:\Users\my-user-name\AppData\Local\RStudio κ°€ μžˆμŠ΅λ‹ˆλ‹€.

@davidgohel κ³Ό @mtkerbeR

이제 pptx νŒŒμΌμ„ μ–»λŠ” 데 μ„±κ³΅ν–ˆμŠ΅λ‹ˆλ‹€!

(1) νŠΉμ • 디렉토리( C:/Users/my-user-name/Documents/R )에 pandoc_layout.pptx λ₯Ό μƒμ„±ν•˜κ³ 

(2) @mtkerbeR 이 μ œμ•ˆν•œ λŒ€λ‘œ λ‹€μŒ μ½”λ“œλ₯Ό μ‹€ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

system2(rmarkdown::pandoc_exec(), args = c("--print-default-data-file", "reference.pptx"), stdout = "C:/Users/my-user-name/Documents/R/pandoc_layout.pptx")

(3) 그런 λ‹€μŒ YAMLμ—μ„œ reference_doc: C:/Users/my-user-name/Documents/R/pandoc_layout.pptx μ˜΅μ…˜μ΄ μžˆλŠ” Rmd νŒŒμΌμ„ νŽΈμ§ν–ˆμŠ΅λ‹ˆλ‹€.

감사 ν•΄μš”

이것은 이제 github λ²„μ „μ—μ„œ μˆ˜μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

.exe 이 λˆ„λ½λœ μ°½κ³Ό reference_doc 둜 μ‚¬μš©λœ μž„μ‹œ νŒŒμΌμ— λŒ€ν•œ 두 가지 λ¬Έμ œκ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€. 도움을 μ£Όμ‹  @mtkerbeR μ—κ²Œ κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€.

github λ²„μ „μ˜ officedown::rpptx_document μ—μ„œ μ—΄ 수 μžˆλŠ” 파일이 μƒμ„±λ˜λŠ” 것을 ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€. 이것은 ν›Œλ₯­ν•˜λ‹€!! 버그 μˆ˜μ •μ— λŒ€ν•΄ @davidgohel μ—κ²Œ κ°μ‚¬ν•˜κ³  도움이 λ˜λŠ” 기여에 λŒ€ν•΄ @mtkerbeR 에 κ°μ‚¬λ“œλ¦½λ‹ˆλ‹€!

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰