Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure cross-reference divs not working for PowerPoint #10931

Closed
mcanouil opened this issue Sep 30, 2024 Discussed in #10911 · 1 comment · Fixed by #10932
Closed

Figure cross-reference divs not working for PowerPoint #10931

mcanouil opened this issue Sep 30, 2024 Discussed in #10911 · 1 comment · Fixed by #10932
Assignees
Labels
bug Something isn't working crossref figures pptx issue with pptx format
Milestone

Comments

@mcanouil
Copy link
Collaborator

I confirmed and can reproduce the float cross-ref issue for PowerPoint format in the current development version.

---
title: "Untitled"
format: pptx
---

## slide with fig div

::: {#fig-graph1}
{{< placeholder 600 400 >}}

A graph
:::
Error running filter /Users/mcanouil/Projects/quarto/quarto-cli/src/resources/filters/main.lua:
...i/src/resources/filters/./customnodes/floatreftarget.lua:1090: attempt to index a boolean value (local 'im')
stack traceback:
        ...quarto/quarto-cli/src/resources/filters/./ast/render.lua:46: in local 'filter_fn'
        ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:154: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:144>
        (...tail calls...)
        [C]: in ?
        [C]: in method 'walk'
        ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:76: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:65>
        (...tail calls...)
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:136: in function <.../quarto-cli/src/resources/filters/./ast/runemulation.lua:133>
stack traceback:
        ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:76: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:65>
        (...tail calls...)
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
        .../quarto-cli/src/resources/filters/./ast/runemulation.lua:136: in function <.../quarto-cli/src/resources/filters/./ast/runemulation.lua:133>
ERROR: Error
    at renderFiles (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:350:23)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-shared.ts:102:18)
    at async renderForPreview (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:428:24)
    at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:172:22)
    at async preview (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:189:18)
    at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/cmd.ts:424:7)
    at async Command.execute (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/vendor/deno.land/x/[email protected]/command/command.ts:1948:7)
    at async Command.parseCommand (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/vendor/deno.land/x/[email protected]/command/command.ts:1780:14)
    at async quarto (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/quarto.ts:163:5)

Discussed in #10911

Originally posted by d-morrison September 28, 2024

Description

I'm trying to insert a computation into a Figure Div:

---
title: "Untitled"
format: pptx
---

## slide with fig div

::: {#fig-graph1}

```{r}
plot(1:10)
```

A graph

:::

I'm getting the following error:

processing file: pptx-fig-div.qmd
                                                                                                            
output file: pptx-fig-div.knit.md

pandoc 
  to: pptx
  output-file: pptx-fig-div.pptx
  default-image-extension: png
  
metadata
  title: Untitled
  
Error running filter C:/Users/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:
...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:22497: attempt to index a boolean value (local 'im')
stack traceback:
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1233: in local 'filter_fn'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:635: in function <...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:625>
	(...tail calls...)
	[C]: in ?
	[C]: in method 'walk'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:557: in function <...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:546>
	(...tail calls...)
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1334: in local 'callback'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1352: in upvalue 'run_emulated_filter_chain'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1388: in function <...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1385>
stack traceback:
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:557: in function <...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:546>
	(...tail calls...)
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1334: in local 'callback'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1352: in upvalue 'run_emulated_filter_chain'
	...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1388: in function <...rs/Work/AppData/Local/Apps/Quarto/share/filters/main.lua:1385>

Using a figure chunk works fine:

---
title: "Untitled"
format: pptx
---

## slide with fig chunk

```{r}
#| label: fig-graph2
#| fig-cap: Another graph

plot(10:1)
```

Outputting the figure div version to .docx also works:

---
title: "Untitled"
format: docx
---

## slide with fig div

::: {#fig-graph1}

```{r}
plot(1:10)
```

A graph

:::

Am I doing something wrong? Thanks for any guidance.

@mcanouil mcanouil added bug Something isn't working crossref triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. figures pptx issue with pptx format labels Sep 30, 2024
@cderv cderv self-assigned this Sep 30, 2024
@cderv
Copy link
Collaborator

cderv commented Sep 30, 2024

PPTX testing is easier on Windows I guess. I'll submit a patch for this

@cderv cderv removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Oct 1, 2024
@cderv cderv added this to the v1.6 milestone Oct 1, 2024
@cscheid cscheid modified the milestones: v1.6, Future Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crossref figures pptx issue with pptx format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants