yihui / knitr-examples

A collection of knitr examples
488 stars 586 forks source link

Modifying powerpoint templates on Windows results on corrupt pptx file, aka "Powerpoint found a problem" #89

Closed JanaJarecki closed 1 year ago

JanaJarecki commented 1 year ago

Hi,

this concerns using a custom powerpoint template. Steps to reproduce

This results in a corrupted pptx with the error "Powerpoint found a problem with content in ...".

OS

Edition Windows 10 Business OS build 19045.3448

sessionInfo

R version 4.3.0 (2023-04-21 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Example Code

---
title: Results
author: Rewoso
date: "`r format(Sys.time(), '%d/%m/%y')`"
output: 
  officedown::rpptx_document:
    reference_doc: test-template - Copy.pptx
editor_options: 
  chunk_output_type: console
---

```{r, setup, echo=0, warning=0, message=0}
pacman::p_load(ggplot2)
knitr::opts_chunk$set(
  results = "asis",
  echo = FALSE,
  warning = FALSE,
  error = FALSE,
  message = FALSE
)
```

## Test

```{r, fig.width=10, fig.height=4}
   ggplot(iris) + geom_histogram(aes(Sepal.Length))
```
cderv commented 1 year ago

I am on windows and I can't reproduce this unfortunately.

Can you send me the pptx you are generating ?

Are you modifying it with Powerpoint or another tool ?

JanaJarecki commented 1 year ago

Hi,

yes sure, find attached an example-master.pptx.

Actually here's what caused the issue:

Attached is the ppt that results in the corruption

I edited the issue to be truthful

Does the issue make sense? It may be that powerpoint is re-numbering or re-naming the elements in the xml file when the box [ ] Footer is un-checked...

Jana

example-master.pptx

cderv commented 1 year ago

Thanks for the detailed report. I think you found an issue with Pandoc, when date field is present. If you remove the date in your YAML it should work correctly.

cderv commented 1 year ago

I opened an issue upstream to track

Thanks for the report!

JanaJarecki commented 1 year ago

Thank you for the patience and the initiative! Be well ;)

On Mon, Oct 16, 2023, 10:28 Christophe Dervieux @.***> wrote:

I opened an issue upstream to track

Thanks for the report!

— Reply to this email directly, view it on GitHub https://github.com/yihui/knitr-examples/issues/89#issuecomment-1763980693, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACK23H4AN7X27X2L2IUJQFDX7TV2RANCNFSM6AAAAAA5XYODXQ . You are receiving this because you authored the thread.Message ID: @.***>