Setting up Pandoc scholar + Scrivener

Hello. I wonder whether anyone could help me set up Scrivener’s processor settings in Compile to use Pandoc Scholar.

What I’ve done so far:

  • I’ve downloaded and installed the Pandoc Scholar directory (pandoc-scholar-main) into ~/.local/share
  • I’ve added this directory into my ~/.bash_profile
  • In Scrivener’s Processing Path, I’ve put /Users/NAME/.local/share/pandoc-scholar-main/Makefile
  • In Scrivener’s Processing Argument, I’ve put make ARTICLE_FILE=<$inputfile>.md

Upon compiling, I’m getting a list of errors:

/Users/NAME/.local/share/pandoc-scholar-main/Makefile: line 4: MAKEFILE_LIST: command not found /Users/NAME/.local/share/pandoc-scholar-main/Makefile: line 4: lastword: command not found /Users/NAME/.local/share/pandoc-scholar-main/Makefile: line 4: realpath: command not found /Users/NAME/.local/share/pandoc-scholar-main/Makefile: line 4: shell: command not found

Many thanks in advance, and a good new year to you all.

Did you try to make the pandoc-scholar example in the terminal outside of scrivener, did that work? That way we can exclude a general installation issue, make sure make is installed properly etc… What if you make “Processing Path” in Scrivener empty?

Thanks for your help, Ian. Yes, the make command is working from the terminal.

I realise now that I should have mentioned: I am working on an M1 MacBook Air. Apparently (on my machine at least), the make command does not work with this newer architecture, but only if I prepend the make command as such: arch -x86_64 make

I should note that I have no experience with Make and Makefile before this. Part of what I’m trying to figure out is how to execute Pandoc Scholar from within Scrivener, but without having to pre-populate that directory with a makefile, the csl file, and the bibliography .bib file.

Update: I’ve now gotten it to execute properly from within Scrivener.

  1. In Compile’s Processing, I created a script into which I copied all the export paths for my TeX installation, then added a line: arch -x86_64 make.

  2. In Environment, I wrote the path of the directory in which the Makefile that includes that path to the main Makefile is found.

What I still don’t know how to do is to simplify this, so that the the whole Pandoc Scholar download can be installed somewhere, and I can still export .md files out of Scrivener to a directory of my choice, while still executing the correct Makefile and accessory files (csl, bib) through the compile. Many thanks for any help on this in advance.

I can’t test pandoc-scholar on my machines as it currently doesn’t support the new version of Pandoc I have installed. According to the readme:

… there are two environment variables that the local makefile uses, ARTICLE_FILE and PANDOC_SCHOLAR_PATH and as i understand it that enables you to keep pandoc-scholar in a single location and reference it from your compile folder:

So you should be able to edit your local makefile to reference the output file and the pandoc-scholar path?

Thanks, Ian. Yes I have this working fine.

What I’m trying to figure out is if there is a way to dispense with the local Makefile, and just have Scrivener output everything needed to then call upon the main Pandoc-scholar makefile. A bit like how using your Scrivomatic doesn’t require a pre-existing directory pre-populated with files needed to produce my article.

It appears not, and perhaps this is from my misunderstanding of how makefiles work.

I also don’t really understand, and have never used make, sorry I can’t be more help. The instructions for pandoc-scholar do suggest it can be kept in a central location, and the local make file doesn’t have to be in the same folder as the markdown file as you can use the variables to specify where files are? I suppose you do need an consistent path and name however for the markdown file, which could break if you change this in Scrivener… Perhaps post an issue on the pandoc-scholar issues page, the authors are quite friendly…

Thanks, Ian. I’ll do that. If I find a way to automate the creation of output using the post-processor, I’ll come back and share.