I couldn’t find anything that made it plain for me in the Windows manual, so my question is how do I configure the Scrivener compile processing options for use with pandoc? This is what I have, but it does nothing except export a .md file. it works if I use it in a Windows cmd window:
At the time of writing this, my question has had 62 views, but no attempted answers. Does that mean the majority of Scrivener users are on MacOS? Or that most Windows users have little interest in exploring Pandoc and the compiler options?
On the positive side, it motivated me to read more about Pandoc and LaTeX. I switched from the Pandoc installer to the Pandoc zip file release, moving the installation to C:\Pandoc. I updated the Windows Path environment to reflect this change. And I created a set of Windows batch scripts to handle basic Pandoc conversions for me by “drag-n-drop”. Not as elegant as using the Scrivener compiler options but it works.
I am still working through the Scrivener manual. Getting Scrivener to compile a document to .docx with Heading Styles intact via compile to .docx or .rtf is “hit-and-miss” for me. Sometimes it works, and sometimes it doesn’t. And I don’t understand why. So, that means I haven’t found all the information I need in that beautiful manual yet. But compiling to MultiMarkdown and using Pandoc gives me .docx, .epub, .odt and .pdf files with bookmarks and heading styles every time. I’m satisfied I can get my writing out of Scrivener as I want it, and I can focus on and enjoy writing more.
I tested the compile options processing settings various ways, but with no result. I even tried adding batch scripts to the options to see if the processing options would trigger a CMD window to appear, but nada. Does that mean Scrivener suppresses the display of the CMD window, or that the processing options aren’t working yet? I can’t say. But I am having fun figuring this all out, I am enjoying Scrivener very much, and I am learning quite a bit.
I briefly tested porting my Pandoc workflow system to work on Windows, but during the beta the post-processing panel was completely broken…
Scrivener (at least on macOS) does not use the user path, but the default system path, so you need to ensure you specify an absolute path to the pandoc executable or put link in a known path location etc. Some technical details of how post-processing works in windows would be welcome, perhaps AmberV knows the details?
From this thread: https://forum.literatureandlatte.com/t/scrivener-win-2-9-9-7-beta-scrivomatic/50506/1 — my experience was that it was much easier to set up WSL workflow than using powershell/cmd — you can call WSL commands from the windows cmd interface…
To answer your question, I don’t think Scrivener 1 for Windows could work with Pandoc and I believe that Markdown compile wasn’t functional until late on in the Beta cycle for v.3, so yes, the majority of Pandoc users have been on Mac, with @nontroppo a key user.
Ah, that would explain it why it feels like Windows is an unloved stepchild.
I have some experience with Ubuntu Linux, but none with WSL. Perhaps I should look into that. I learned DOS batch scripting way back when I was an university, In those days, a PC with twin 360 Kb floppy drives and an orange monochrome monitor was state of the art. Nowadays we have more power in our phones. If somebody had shown me Scrivener 3 back in the early 80’s I would have been stunned speechless.
This is definitely an area that will need some focus – the manual for Windows v3 is sadly lacking any commentary on the post-processing panel (other than to basically point out it exists). There’s no description of the fields there or the kinds of values you need to put it. It would be nice if there were some examples.
Something that will help with making sure the command is actually running as intended, is to go into the General: Warnings options tab, and enable Show internal log console. This should also print any shell command errors.
I very briefly tested that it worked at all, and recalled that I got an output file (to the point that I sent notes on how the compiler incorrectly opened the .md file rather than the output file). But I’ll have to give it another test after a reboot, as what worked in the past doesn’t necessarily imply present-tense functioning.
Thanks for the note. I looked it up and indeed this area did not get its text switched back on nor fully proofed, after it was added to the beta, as the ticket itself is still marked as open.
Update: all right, so this does seem to be working, at least with an extremely simple test, just putting “C:\Program Files\Pandoc\pandoc.exe” into the path field, and “-t odt -o <$outputname>.odt” into the arguments field.
Thank you, the “Show internal log console” setting is helpful. And I tested compile post-processing with the options you specified. It worked, but the .md to .odt output produced isn’t clean. It produces a mixture of rich text and markdown, no matter how I set the options (see below) - turning the various options on or off just produces a different mix markdown and rich text.
But your reply gives me some helpful insights. I might try placing one of my batch scripts in the command path to see how that works.
OK, I tested the post processing options with a batch file command substituted for “pandoc.exe” and with <$inputfile> as the only argument. The batch script in this particular example takes a single .md file and converts it to a number of different output formats. All the output files were generated (pdf, txt, docx, rtf, epub, html and odt).
I must still be needing to learn something about the markdown format and Scrivener paragraphs, though, as some of my paragraph layouts changed somewhat in certain instances. DOCX and ODT generated this way were good, and also retained heading styles. PDF output produced had TOC bookmarks. All output files were clean, with no mix of markdown and rich text in the output like previously. This could be a good solution for me.
Thank you for the help!
The intended logic for that switch is that with it off, nothing should convert, not a single byte changed, unless it is listed in §21.4 in the user manual. And of those, lists, tables and links are all opt-in with additional checkboxes in the compile settings.
If you have a sample that produces otherwise, I’d be happy to take a look and file the necessary bug reports.
It’s really strange that changing the post-processing from pandoc.exe to a batch file that executes pandoc.exe would fundamentally change the type of Markdown that is being produced into the .md file. I can’t explain how that would be even theoretically possible. The only difference between those tests should be which string is sent to the shell. Needless to say I’d love to see a project demonstrating both result with different compile formats.
I’m also puzzled. Maybe it is something I am doing wrong? I attach a sample of my project . I compiled to DOCX and ODT using the built-in Pandoc options (no postprocessing) from the dropdown list. Then I compiled to ODT using the built-in multimarkdown option from the dropdown list. Then I used my batch script to convert the multimarkdown produced by scrivener to DOCX and ODT. Lastly, I did a compile straigh to DOCX and ODT suing the dropdown list in Scrivener. You will find the files in the CompileTest.zip and my project in the CompileTest.scriv.zip. My pandoc installation is in “C:\Pandoc”, and I also attach the batch script that I used.
Each way of compiling produced some differences.
On page 3 of the file “CompileTestUsingPandocToODTWithinScrivener.odt” you will see some multimarkdown that didn’t convert properly; the third bullet at the top of the page is **T.A.S.K.® **Tuned Assessment of Skills and Knowledge. But other instances of this line converted fine from the same Scrivener project.
In the file “CompileTestUsingMarkdownpostprocessingToODT.odt” on page 3, you will see the headings from 4 Background didn’t convert to headingst all and appear as paragraph text preceded by #.
In the files “CompileTestUsingBatchScript.odt” and “CompileTestUsingBatchScript.docx”, you will see everything compiled correctly. Even heading styles were transferred as headings within the ODT and DOCX.
Okay! I better understand what you mean, and in that case it makes more sense that you’d be getting different results at the ODT end result level. If you were to compile to Markdown as a plain file instead, you should see the results as identical whether using MultiMarkdown, Pandoc or additional post-processing.
Now as to why you would get three different ODT files from what you described, it’s simply because you are using three different conversion engines: Scrivener, Pandoc and MultiMarkdown. They all have their own quirks, limitations and pros and cons.
That all said, you are running into a bug that causes listed items to have any formatting within them also converted to Markdown. It should be that just the list aspect of the text all by itself is converted, not the bold and italic text. So I’ve got that filed as a bug.
Lastly, I’ve finished editing and proofing the Processing pane documentation, and have uploaded the PDF to the web site.
Woo-hoo! Looks good, thanks for the fast turn around!
Thank you, Ioa. I appreciate your help and insights.
Kind regards, Grant