pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
611 stars 166 forks source link

"Could not find executable" error with multiple-bibliographies.lua #127

Closed the-solipsist closed 4 years ago

the-solipsist commented 4 years ago

Hi. I've git cloned the lua-filters repo to ~/.local/share/pandoc/filters on my system. I try to run multiple-bibliographies.lua as a filter using this command:

pandoc ~/documents/notes/2020-10-23-20201023230707.md -o ~/documents/output/bibliography.pdf --citeproc \
--pdf-engine=lualatex --filter=multiple-bibliographies/multiple-bibliographies.lua

I get the following error:

Error running filter /home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua:
Could not find executable /home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua

I try ls -al, and it shows the file is very much present:

ls -al /home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua
-rw-rw-r-- 1 sol sol 4590 Oct 26 02:00 /home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua

If I make the file executable (which I shouldn't need to do), I get this error instead:

Error running filter /home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua:
/home/sol/.local/share/pandoc/filters/multiple-bibliographies/multiple-bibliographies.lua: createProcess: runInteractiveProcess: exec: invalid argument (Exec format error)
tarleb commented 4 years ago

Try --lua-filter instead of --filter. The latter is for JSON filters only.

the-solipsist commented 4 years ago

Sorry for the hassle! Momentary lapse of thinking on my part. Because in defaults files the field filters: can be used — with the assumption that it is lua if the extension is .lua — and I kinda got used to that. :confused: