Skip to content

Error when trying to render with multiple subfigures with APA-style figure note #158

Description

@isaactpetersen

I'm trying to render a Quarto manuscript that has multiple subfigures with an APA-style figure note. However, I am running into some issues. I believe I am using the latest version of apaquarto.

Here are my findings when trying to render to various formats (when including a figure that has multiple subfigures, each of which has an APA-style figure note):

  • apaquarto-docx: works fine
  • apaquarto-html: works fine
  • html (i.e., commenting out apaquarto-html in _quarto.yml): doesn't work; i.e., doesn't show APA-style figure notes
  • apaquarto-pdf: error (see below)
Error running filter C:/PROGRA~1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:
Block, list of Blocks, or compatible element expected, got table
	while retrieving function argument content
	while retrieving arguments for function Div
stack traceback:
	...toReprex\_extensions\wjschne\apaquarto\apafloatlatex.lua:254: in local 'filter_fn'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:655: in function <...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:645>
	(...tail calls...)
	[C]: in ?
	[C]: in method 'walk'
	...\RESOUR~1\app\bin\quarto\share\pandoc\datadir\_utils.lua:607: in function '_utils.walk'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:574: in function <...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:552>
	(...tail calls...)
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1317: in local 'callback'
	[string "if pandoc.system.os == "mingw32" then..."]:778: in field 'withScriptFile'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1333: in upvalue 'run_emulated_filter_chain'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1371: in function <...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1368>
stack traceback:
	...\RESOUR~1\app\bin\quarto\share\pandoc\datadir\_utils.lua:607: in function '_utils.walk'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:574: in function <...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:552>
	(...tail calls...)
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1317: in local 'callback'
	[string "if pandoc.system.os == "mingw32" then..."]:778: in field 'withScriptFile'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1333: in upvalue 'run_emulated_filter_chain'
	...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1371: in function <...1/RStudio/RESOUR~1/app/bin/quarto/share/filters/main.lua:1368>
WARN: Error encountered when rendering files

In case it's helpful, here is a minimal reproducible example:

This works and gives no error (@fig-exampleA):

![Sample Image 1.](Figures/sampleImage1.png){
  #fig-exampleA
  fig-alt="Insert description here."
  apa-note="Variable A indirectly causes Variable C."
  }

This results in an error and/or no figure note (@fig-exampleB):

::: {#fig-exampleB layout-ncol=2}
![Sample Image 1.](Figures/sampleImage1.png){
  #fig-sampleImage1
  fig-alt="Insert description here."
  apa-note="Variable A indirectly causes Variable C."
  }

![Sample Image 2.](Figures/sampleImage2.png){
  #fig-sampleImage2
  fig-alt="Insert description here."
  apa-note="The distribution of a variable."
  }

:::

This results in no error but doesn't show the APA-style figure note (@fig-exampleC):

::: {#fig-exampleC layout-ncol=2}
![Sample Image 1.](Figures/sampleImage1.png){
  #fig-sampleImage1
  fig-alt="Insert description here."
  }

![Sample Image 2.](Figures/sampleImage2.png){
  #fig-sampleImage2
  fig-alt="Insert description here."
  }

**Panel A**: Insert description here.
**Panel B**: Insert description here.
:::

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions