pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
614 stars 167 forks source link

error running filter #252

Closed pavilaalo closed 1 year ago

pavilaalo commented 2 years ago

Hi,

I am getting this error when rendering the filters (scholarly-metadata and author-info-blocks) that previously worked.

scholarly-metadata.lua:95: not a named object: List: 0x7fc1a771ecf0 stack traceback: ...d /scholarly-metadata.lua:95: in function 'to_named_object' [C]: in function 'pandoc.List.map' ...d /scholarly-metadata.lua:144: in upvalue 'canonicalize' ...d /scholarly-metadata.lua:176: in function <...d /scholarly-metadata.lua:175> Error: pandoc document conversion failed with error 83 Execution halted

I did not change the code, is the code I had and worked

output: bookdown::word_document2: pandoc_args:

SESSION INFO

R version 4.2.1 (2022-06-23) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 11.4

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] compiler_4.2.1 bookdown_0.29 fastmap_1.1.0 htmltools_0.5.3 tools_4.2.1
[6] yaml_2.3.5 rmarkdown_2.16 knitr_1.40 xfun_0.33 digest_0.6.29
[11] rlang_1.0.6 evaluate_0.16

Any suggestion? Is it possible to use these filters in Quarto?

Pablo

tarleb commented 2 years ago

It might be possible to get those filters to work in Quarto, but Quarto has its own mechanism for author names and affiliations. AFAIK it is partially based on the filters you mention, and I'd recommend to use that if possible. In fact, I'm planning to deprecate the two filters here in the future. Let us know if there a blockers that prevent you from using Quarto's default mechanism for this and we can try to find ways to make it work.

Cc @cderv

pavilaalo commented 2 years ago

Thank you for your response. I haven't switched to quarto yet but I have tried. There are templates for different journals that allow to include author affiliations but I haven't been able to get them printed and they are set for pdf or html output (not MS Word). Unfortunately, most of the journals I submit require that the manuscript be in MS word (and I have to say that the filters are great). Also, it is possible to include the filters in quarto as they are (so I hope you don't deprecate them) including the following in the YAML (see also https://github.com/quarto-dev/quarto-cli/issues/287)

filters:

but I get the same error as in Rmarkdown.

Any idea about this error? any idea on how to make them work (at least in Rmarkdown)?

scholarly-metadata.lua:95: not a named object: List: 0x7fc1a771ecf0 stack traceback: ...d /scholarly-metadata.lua:95: in function 'to_named_object' [C]: in function 'pandoc.List.map' ...d /scholarly-metadata.lua:144: in upvalue 'canonicalize' ...d /scholarly-metadata.lua:176: in function <...d /scholarly-metadata.lua:175> Error: pandoc document conversion failed with error 83 Execution halted

cderv commented 2 years ago

@pavilaalo can you open an issue in https://github.com/rstudio/bookdown/ and share an example I can use to reproduce ?

bookdown uses some filters too for some features, and maybe there is a conflict. Thank you

pavilaalo commented 2 years ago

Thank you very much for your interest and help. The issue is open, see https://github.com/rstudio/bookdown/issues/1390 However, I get the same error when using default word/pdf, bookdown or even quarto

On Mon, 3 Oct 2022 at 18:13, Christophe Dervieux @.***> wrote:

@pavilaalo https://github.com/pavilaalo can you open an issue in https://github.com/rstudio/bookdown/ and share an example I can use to reproduce ?

bookdown uses some filters too for some features, and maybe there is a conflict. Thank you

— Reply to this email directly, view it on GitHub https://github.com/pandoc/lua-filters/issues/252#issuecomment-1265699742, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASSGXE6QAL6FUYEHSTRU2RLWBMA4LANCNFSM6AAAAAAQ2TFK2M . You are receiving this because you were mentioned.Message ID: @.***>

tarleb commented 1 year ago

The problem has been identified in the linked issue. Closing here