openjournals / openjournals-draft-action

Experimental GitHub Action
MIT License
52 stars 12 forks source link

Script fails with cryptic error message #14

Closed danielhatton closed 2 years ago

danielhatton commented 2 years ago

(Apologies if this is the wrong venue for this; can't see any other forum for seeking help with this software.)

I've been trying to use this script to validate a paper I'm intending to submit to JOSS. The compilation process fails with the error message

Error running filter /usr/local/share/openjournals/data/filters/inline-cited-references.lua: PandocBibliographyError "paper.bib" "(line 26806, column 1):\nunexpected end of input" stack traceback: ...re/openjournals/data/filters/inline-cited-references.lua:6: in function 'Pandoc'

Line 26806 is the end of the bibliographic database file paper.bib. That file passes validation with the bibtex-validate tool in Emacs' BibTeX mode just fine.

Can anyone shed any light on what the error message means, or suggest what my next move should be, please?

tarleb commented 2 years ago

This is a good place to ask. Must of the code for the publishing pipeline is in our inara project, but this repo here is as good as any. :slightly_smiling_face:

I suspect that this is a parsing error in pandoc; can you link to the bib file that's causing this? You could try to find the problematic entry by calling pandoc directly with pandoc -f biblatex -t biblatex paper.bib and see if you can remove the right entry to get the command to succeed.

danielhatton commented 2 years ago

Thanks @tarleb. I don't have a sufficiently bleeding-edge version of pandoc to do -f biblatex -t biblatex, but running pandoc paper.md -t markdown-citations -o compiled.md --bibliography paper.bib works fine.

tarleb commented 2 years ago

I'm assuming you are talking about paper.bib in leastsqtobayes. It seems that pandoc takes issue with some of the unescaped % characters. You can make sure that all % are preceded by a backslash by running the following command:

sed -i'' -e 's/[^\\]%/\\%/g'  paper.bib
tarleb commented 2 years ago

I'm closing this here, but if you can, please bring it up on the pandoc repo.

danielhatton commented 2 years ago

Thanks. Yes, escaping the % signs has solved the problem. (I used Emacs query-replace rather than sed.)