Help: Compiler Post-processing for Current Windows Release?

[caveat: I’m a macOS user with no Windows machine…]

I am helping a friend try to set up a Wine-Scrivener (under Ubuntu 22.04). It works well so far (we got a Scrivener+Zotero academic workflow working), but I am a bit lost with post-processing on Windows. We want to get Pandoc running via compile, so options are to install Pandoc in Wine or on Linux. For Windows I’m not sure what the default search path is for Windows or whether the $PATH env variable is respected by Scrivener on Windows etc. (at least on macOS the user path is not used at all)? What does the environment entry do on windows, and what is the path separator needed, does Scrivener use Windows one? How does one deal with paths with spaces in the name? Any and all tips appreciated. As a possible bonus I may try to get Scrivomatic / quarto workflows working if we don’t hit a hurdle, but I have very limited time and this is all indirect…

EDIT: Installing Pandoc to C:\Pandoc and using C:\Pandoc\pandoc for the file name does not work…

Well, duh, it seems i was missing .exe :laughing: so C:\Pandoc\pandoc.exe works. The cool thing is I can use Linux files (wine maps the linux folder to Z:), so in theory my Pandoc data files could be all kept in Linux. Anyway at least a plain scrivener > pandoc > ODT is working.

2 Likes

Yup! That’s exactly how I have things set up. You definitely do need to install any production tools you want into the Wine prefix so that Scrivener can access them, at least I have found no way to make native execution happen, but I have found that in practice this is not too big of an issue as almost everything you’d want is available on Windows in some form, and most of what you would want to run at this level is going to be command-line level or interpreters that don’t need a GUI, and thus work great with Wine. Mainly what I do miss is making little wrapper scripts. I suppose I just need to bite the bullet and dredge up childhood memories of making batch files. :laughing:

And yes, you can reference your standard Pandoc folder or whatever else you need if you have the home folder mapped to a drive, easy peasy and very tidy. I use X: drive for my home folder, so this works: --reference-doc="X:\.pandoc\reference.docx". I haven’t tried it, but I bet you could also symlink your .pandoc folder into wherever it is needed for Windows, looks like C:\Users\accountname\Application Data\pandoc.

The one thing I haven’t managed to get working well is opening the product after compiling. The flag to open the compiled file just hangs Scrivener for me. Could be some way of resolving that with MIME configurations somewhere, but I’ve yet to reach a point where it annoys me enough to bother looking into it. Could be that’s something .bat files could manage, as I suspect the problem is this request getting stuck somewhere in the Qt framework as it runs on Wine, but then, whether a .bat file running at the behest of a Qt process is also subject to its limitations may a limiter.

Paths with spaces: in my experience you don’t need to do anything special: C:\Program Files\pandoc\pandoc.exe works verbatim. I do double-quote spaces in my arguments, like -o "<$outputname>.docx" as I can’t imagine it would allow Test Me.docx to work without some kind of indication that its one phrase and not two arguments.

1 Like