Marked does not read csl file

S's Avatar

S

29 Jun, 2017 05:09 PM

Hello everybody,

I am trying to run Pandoc in Marker to compile a Scrivener file.

I use the following commands:
-f markdown -t html5 -s -S --normalize --bibliography ~/Desktop/trial.bib --csl ~/Downloads/apa.csl

The csl file was being read without problems with the same commands when using Pandoc in the terminal.

Instead Marker gives me an error:

pandoc-citeproc: Error parsing XML file ~/Downloads/apa.csl: ~/Downloads/apa.csl: openBinaryFile: does not exist (No such file or directory)
pandoc: Error running filter pandoc-citeproc
Filter returned error status 1

Basically it compiles everything except the citations.
I would like to use Marker for controlling the citations output since I am new to pandoc and markdown.

  1. Support Staff 1 Posted by Brett on 29 Jun, 2017 05:28 PM

    Brett's Avatar

    Try using a full path instead of the ~ (e.g.
    /Users/somebody/Desktop...). Marked runs commands outside of your own
    shell environment, so the $HOME directory that the ~ references is
    different.

    -Brett

  2. 2 Posted by S on 29 Jun, 2017 06:00 PM

    S's Avatar

    Thanks, I tried but unfortunately I get the same error:

    pandoc-citeproc: Error parsing XML file ~/Users/S/Downloads/apa.csl: ~/Users/S/Downloads/apa.csl: openBinaryFile: does not exist (No such file or directory)
    pandoc: Error running filter pandoc-citeproc
    Filter returned error status 1

    I found the following alternative online, but honestly I don't know how to implement it; where should I write the bash script?

    "It’s possible (quite easy) to set up the excellent Marked 2 app with pandoc as a processor (you can choose the processor in Marked’s preferences). It requires a short bash script to call the pandoc command, since marked seems to struggle with arguments. You can make the script executable with a chmod +x and set it as Marked’s processor in the preferences. An example script would be thus, if you replace the CAPS with your own data (assuming you use ~/.pandoc/ as your repository for the above ‘useful little files’):"

    1 #!/bin/sh
    2 export HOME=/Users/YOUR_USER/
    3 pandoc -r markdown -w html -s -S --normalize --bibliography ~/.pandoc/YOUR_BIBLIOGRAPHY.bib --csl ~/.pandoc/YOUR_CITATION_STYLE.csl

  3. Support Staff 3 Posted by Brett on 29 Jun, 2017 06:05 PM

    Brett's Avatar

    You'd want to completely remove the tilde (~) and have the path begin
    with a /: `--csl /Users/S/Downloads/apa.csl`

    The bash script solution would work, you'd just want to create it as a
    text file in any location (I'd suggest a folder in your home directory
    called "scripts", so the path would be ~/scripts/pandoc.sh). Then just
    copy the path to the script into the custom processor field, replacing
    the whole pandoc command.

    -Brett

  4. 4 Posted by S on 29 Jun, 2017 06:11 PM

    S's Avatar

    Thank you! I removed the tilde and I also wrote the whole path for the bib file. It works now.

    This is the edited pandoc command:

    -f markdown -t html5 -s -S --normalize --bibliography /Users/S/Desktop/trial.bib --csl /Users/S/Downloads/apa.csl

  5. Support Staff 5 Posted by Brett on 29 Jun, 2017 06:36 PM

    Brett's Avatar

    Glad to hear it!

    -Brett

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac