crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
649 stars 132 forks source link

attempt to index a nil value (pandoc error 83) #585

Open HenrikEckermann opened 5 months ago

HenrikEckermann commented 5 months ago

Describe the bug

If I try to include a table from the package table1, I receive the error printed below. I first convert the table to a kable object using as.data.frame(tbl1) %>% kable(). I can knit the document to word, pdf or html without any issues. Only when I knit using the index.Rmd file with papaja do I get the error. Other tables from a different format seem not cause the issue with papaja but only this specific table. Any ideas what could be causing this and how I can solve it?

Error running filter /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/papaja/lua/docx_fixes.lua:
...ns/4.3-arm64/Resources/library/papaja/lua/docx_fixes.lua:24: attempt to index a nil value (field 'integer index')
stack traceback:
Error: pandoc document conversion failed with error 83
Execution halted

Unfortunately, I cannot share this specific document for reproducibility.

crsh commented 5 months ago

Hi Henrik, can you share (a anonymized version of) the YAML front matter?

HenrikEckermann commented 5 months ago

Hi Frederik,

see below

---
title             : "A title"
shorttitle        : "A title"

author: 
  - name          : "Henrik Eckermann"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address        : "Donders Institute for Brain, Cognition and Behavior, Kapittelweg 29, 6525EN Nijmegen, The Netherlands" 
    email         : "myemail"
    role:         # Contributorship roles (e.g., CRediT, https://casrai.org/credit/)
      - "Original Draft Preparation"
      - "Data Analysis"
      - "Review & Editing"

  - name          : "name of colleague"
    affiliation   : "1"
    role:
      - "Conceptualization"
      - "Data Collection"
      - "Review & Editing"

  - name          : "Another colleague"
    affiliation   : "2"
    role:
      - "Supervision"
      - "Review & Editing"
  - name          : "Another colleguage"
    affiliation   : "1"
    role:
      - "Conceptualization"
      - "Review & Editing"
      - "Supervision"

affiliation:
  - id            : "1"
    institution   : "Radboud university medical center, Donders Institute for Brain, Cognition and Behaviour, Department of Cognitive Neuroscience, Nijmegen, The Netherlands"
  - id            : "2"
    institution   : "Institute of my colleague"

abstract: |
  my abstact

keywords          : "Some keywords"
wordcount         : "323"

csl               : "bib/gut-microbes.csl"
bibliography      : "bib/final.bib"

floatsintext      : no
linenumbers       : yes
draft             : no
mask              : no

figurelist        : yes
tablelist         : yes
footnotelist      : no

classoption       : "man"
output            : papaja::apa6_docx
---
sebsilas commented 5 months ago

I am also receiving this error when I try to knit to Word in the usual way that works for me.

I've knitted the same paper before many times with no issue. I made a few small updates today after leaving it in a drawer for a few months, and now I experience the error.

I suspect it is to do with a package update.

sebsilas commented 5 months ago

Yup, just to confirm I rolled back papaja to v 0.1.0 and I no longer experience the rendering error.