quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.6k stars 294 forks source link

Issues with PowerPoint templates #8312

Open carlganz opened 6 months ago

carlganz commented 6 months ago
---
title: "MVP"
format:
  pptx:
    reference-doc: Evolent_Quarto_Template.pptx
---

## Quarto

Quarto enables you to weave together content and executable code into a finished presentation. To learn more about Quarto presentations see <https://quarto.org/docs/presentations/>.

## Bullets

When you click the **Render** button a document will be generated that includes:

-   Content authored with markdown
-   Output from executable code

## Code

When you click the **Render** button a presentation will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1


[Evolent_Quarto_Template.pptx](https://github.com/quarto-dev/quarto/files/13955160/Evolent_Quarto_Template.pptx)

Nothing from template is included in output and no error message is generated. 

Attached is a second template that generates an output without any error messages, but the file is corrupted when you open it, and the layout is wrong (although the template is right)

[BrokenTemplate.pptx](https://github.com/quarto-dev/quarto/files/13955170/BrokenTemplate.pptx)

It would be helpful if it was documented somewhere what features in PowerPoint are respected from the templates in Quarto.
cderv commented 6 months ago

First, I edited your post to make it readable. Please next time to follow guidelines: https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us

Then about the reference doc, better documentation is needed for sure; I'll add the documentation tag to remember it.

Though our doc do explain the main things to known:

Slide layouts are what need to be customized. If I open your reference doc, they are not

image image

So the style you expect won't get picked up.

Regarding the corrupted output, how did you create the template ? It is known limitation of Pandoc that it is best for full support to create it using Pandoc directly: https://quarto.org/docs/presentations/powerpoint.html#creating-a-template This way, it insures that the reference-doc contains the minimum required elements.

Hope it helps

We'll do a better documentation for PPTX has we've done for DOCX. Thanks for the report!

carlganz commented 6 months ago

Thanks for your guidance I had never even heard of slide master until now. The broken template was created by generating the reference doc from the command line and then imported our company PPT template to it. I don't know exactly how the PPT template was generated but it should be contained with the BrokenTemplate file I shared

cderv commented 6 months ago

I believe your BrokenTemplate.pptx have indeed your company PPT template imported in it, but doing so broke support for Pandoc.

As explained briefly in the doc and Pandoc's Manual, the support of template is made possible through the naming of the slide masters' slide. It must be named a certain way, which will be associated with a certain type of content created through the rendering.

PPTX customization in Quarto is limited by what Pandoc is supporting. So really creating a template PPTX to use is about adapting the default pandoc template to an existing one, and not just copy-pasting / importing because this could lead to unsupported names of the layout.

So the way to go is really adapting the default template to your company one by mimicking the template while being sure to keep the layout names in slide Master