Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying existing corporate powerpoint template for use in rmarkdown: Could not find shape for Powerpoint content

I have an existing corporate powerpoint template that I must use. What must I change in the template so that I can use it in rmarkdown? I'm currently getting "Could not find shape for Powerpoint content".

edit: I get this error when I run

pandoc --to pptx --reference-doc breed_wit_met_dianummering.potx --output ScrumIntro.pptx ScrumIntro.md

The template I use is at https://company-122895.frontify.com/api/attachment/download/FBcAVUTBYwQUa6UUQtF03Eqt1qDCsN0zgI_LVSjKW85J1PXf4e7m3HRWI-OBE_UYgsjGK2uXc2yLCwDYxzAiMQ, but I already know it doesn't conform to the expectations of pandoc; I'm looking for information on what I should do to create a template that will conform (not necessarily starting with this one, just in general). I'm OK with starting from scratch, but I don't know exactly what must be in place in a template to meet pandoc's expectations.

like image 764
retorquere Avatar asked Aug 29 '19 18:08

retorquere


People also ask

How do you make a PowerPoint in R markdown?

You can create a new *. pptx file from the PowerPoint menu File -> New with your desired template, save the new file, and use it as the reference document (template) through the reference_doc option. Pandoc will read the styles in the template and apply them to the PowerPoint presentation to be created from R Markdown.

How do I find custom PowerPoint templates?

You can search for thousands of templates at templates.office.com.

How do you knit a PowerPoint in R?

To create a PowerPoint presentation, open a new R Markdown PowerPoint presentation or specify powerpoint_presentation as an output format in the YAML header. When you knit an R Markdown document, RStudio renders your document in the PowerPoint output format.

How do I see all templates in PowerPoint?

Open PowerPoint, and you'll see a set of standard templates in the gallery. If you're already working in PowerPoint, click File > New from Template to see the templates.


1 Answers

The required structure in the powerpoint template + a script which will report deviations can be found at https://gist.github.com/retorquere/9053b3dee7b2ce62382e005c73592391 . The rules are:

  • There must be at least 4 slides in the slide masters, named ppt/slideLayouts/slideLayout[1-4].xml
  • ppt/slideLayouts/slideLayout1.xml is a title slide, and must:
    • have a p:ph element with type="ctrTitle"
    • have a p:ph element with type="subTitle"
    • have a p:ph element with type="dt"
  • ppt/slideLayouts/slideLayout2.xml is a title + content slide, and must:
    • have a p:ph element with type="title"
    • have a p:ph element without a type attribute
  • ppt/slideLayouts/slideLayout3.xml is a section header slide, and must:
    • have a p:ph element with either type="title" or type="ctrTitle"
  • ppt/slideLayouts/slideLayout2.xml is a title + two-content slide, and must:
    • have a p:ph element with type="title"
    • have at least two p:ph elements without a type attribute

you can upload your template to https://rmarkdown-office-template.herokuapp.com/ and it will test against these rules, and report what is missing in these slides if they don't comply with the rules.

like image 63
retorquere Avatar answered Jan 04 '23 05:01

retorquere