Hi there,
I’ve been using Scrivomatic on my old notebook and recently moved to a new one. Now I am having trouble setting it all up again, and don’t know why. In particular, when compiling and running pandocomatic (I’m just using an adapted version of the sample project so far, which is not even drawing on the .local/share/pandoc folder), I get an error saying:
/Library/Ruby/Gems/2.6.0/gems/paru-0.4.3/lib/paru/pandoc.rb:226:in `throw’: uncaught throw #<Paru::Error: Unable to run pandoc via command ‘pandoc --version’: No such file or directory - pandoc> (UncaughtThrowError)
This seems strange to me as pandoc and pandocomatic are installed… Any advice or if you can point me where to better post this issue would be much appreciated. Thank you
Hi, I assume from the error you are using the built-in version of Ruby. Given the potential for Apple to remove ruby as it has been suggesting for a while, and it recently did to Python, my general preference is to install the latest Ruby (V3.1.2) yourself and use that[1]. However I just tried to run pandocomatic (V0.2.8 & paru 0.4.3) using my system Ruby (ruby 2.6.8p205 2021-07-07 revision 67951, on macOS 12.3.1) and it ran just fine so it isn’t a recent regression with the old version of Ruby shipped with macOS.
Can you try to run pandocomatic using a minimal doc:
Save it to a test.md file and run it with pandocomatic -b test.md — does that work? Are you sure that pandoc is in a path location that is accessible, what does which pandoc return? It is possible that the path is not handled by scrivomatic, if for example you are using homebrew on an M1 mac?
Hello,
so yes I’m using the built-in Ruby and yes, pandoc and pandocomatic are installed, so converting the test file works just fine. But probably pandoc is in a wrong location… Which pandoc tells me → /opt/homebrew/bin/pandoc… No idea how it ended up there? Do you suggest I delete it there and create the directory in. ./local/share first? And: I am using homebrew on an M1! Any help is much appreciated.
Yes, this is most likely an issue with homebrew installing to a new location on Apple Silicon machines: /opt is I believe the new location for this.
Is pandocomatic working on the simple file from your terminal? What is the output of echo $PATH?
If it is working then the simple solution will be to add this path to the scrivomatic wrapper (Scrivener itself runs with a very spartan path, why the scrivomatic wrapper exists). This is on line 152:
You could try to rewrite it to add /opt/homebrew/bin/ like so:
Yes, pandocomatic was working on the simple file from my terminal. And yes, I believe you’re right, /opt is the new location to which homebrew is installing on M1 machines. The output of echo $PATH is thus /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
Thank you for updating the scrivomatic script. It now works like a charm again after I copied and pasted it into the ,edit script’ field when compiling from scrivener. (Is that how you recommend doing it or is there a better way to keep my local version of the script up to date with your changes on GitHub?)
The scrivomatic script is not really updated very often, so you should be OK. Having said that, you can use git to clone the repo from github, then make a soft link to link scrivomatic from the repo to a folder in the path; then whenever you git pull that softlink will remain up-to-date. You then use the path to the command in the Scrivener post-processing panel.
Yes, and I’m sorry it doesn’t work so well with Windows; I think there are only a couple of small issues to resolve for Windows (I did get it working with WSL for example), but I don’t have the time to manhandle a Windows VM to test…
I was able to get it to work on Windows with MSYS2 for the dependencies. I used MSYS2 as I did not want to have multiple installations for Ruby, gcc etc. on my PC. I documented the process on getting it to work (lots of rough workarounds), I can share it for those who are interested.
I am getting ready to take the Scrivomatic plunge on my M1 MacBook, so it’s reassuring to see these prompt responses from the developer, @nontroppo.
(I used Madoko.net for my previous manuscript, and loved it, but alas, it isn’t being supported anymore by the developer at Microsoft — it was only his side-gig, I guess. Also, I hope to benefit from Scrivener’s strength in document organization, for which the browser-based Madoko was somewhat deficient.)
Welcome, and good luck! I recently (see above) made tweaks for Apple Silicon systems (basically due to path changes of homebrew) so AFAIK scrivomatic is working fine there. But I’m still stuck on Intel (waiting for the dust to settle on the M2, the first time since the black macbook I’ve considered an Air rather than a Pro)…
Note, Quarto will have a visual editor mode, and is very much a spiritual successor to madoko. As it is based on Pandoc and has a CLI it can also be run from Scrivener. As long as you follow the “spirit” of scrivomatic (scrivener styles > pandoc markdown), you will be able to flexibly switch between pure pandoc and quarto easily…
As you say, Scrivener and its flexibile binder has by far the best writing experience, nothing comes close for academic research so when combined with pandoc markdown, it covers [almost] all bases!
It is the case that, as of now, typing gem install pandocomatic installs this V1.0.31 version, the latest version you created? I assume this is the case.
pandocomatic is not my tool, this was created by Hub de Beer to manage pandoc and its myriad settings. I merely use this wonderful tool. scrivomatic largely exists because Scrivener does not expose all the paths and tools available when it runs the post-processing command; it runs under a very restrictive path and therefore many tools cannot be found without it. Over time I added some extra functions, for example scrivomatic can build the PDF files for LaTeX outputs using latexmk as I found it worked better than using pandoc’s LaTeX>PDF trigger directly…
Oh, my mistake. And thanks so much for your responses, @nontroppo. What I should have asked is whether the sample project to be run from the desktop uses the latest version of scrivomatic.
The sample workflow embeds the script so you don’t need a standalone copy elsewhere, and it is usually up-to-date (well, when I remember to update it from the standalone script ).
The sample workflow itself doesn’t require the dotpandoc folder at all, everything is routed to the compile folder to minimise the install requirements, but as a result of this only includes a minimal set of filters and templates…