Pandoc throwing exception for --split-level

I have searched and found that when Pandoc 3 came out I guess it was initially tolerant of the issue but I’m finding its throwing an exception and failing out. I have the log window turned on and seeing the error. Is there a file to edit, or a setting to modify what Scrivener is send to Pandoc as the arguments?

Debug: Executed: “C:/Program Files/Pandoc/pandoc.exe”
Debug: Arguments: "–epub-metadata=metadata.xml --epub-chapter-level=1 -t epub -o

I haven’t installed 3.10 into my Wine setup yet, and am still using 3.9.x (which throws the warning about the deprecated function, but still creates an .epub file). Are you using 3.10?

yes pandoc is 3.10. and discord wants 20 characters so this is just filler

Well that’s annoying if support has been cut off before 4.x, but I guess it was bound to happen eventually. We actually already have this fixed in an internal build, but unfortunately that build was also unstable. It will definitely be using the modern flag in the next official build.

There is no really good workaround. The command line is hard-coded rather than something you can edit in a file somewhere, and while ordinarily the Processing compile format pane will let you do whatever you want—with ePub in particular there is a fair amount of automation we are doing to set metadata, CSS, cover page and so forth. These are all things that would not be produced when using the plain “MultiMarkdown” option where you can access the Processing pane and set the command line.

Honestly the best might be to downgrade to 3.9 for the time being if it is critical to be using Scrivener’s automation.

1 Like

I did downgrade to 3.9 and the error persists. I verified the older(3.9) executable is there.

I’m sorry so sound rude, but the ordinary compile options don’t work. You can not produce an epub file that actually works. It is impossible and I would challenge any one to do so. You need to look around at the market. Just google Scrivener alternatives because you need formatting tools that work. I’ve had two or three copies of Scrivener and I’m looking for alternatives because of compile. It doesn’t work.

I just double-checked, before posting the above, that 3.9.0.2 produces an ePub despite the warning dialogue. Are you certain no ePub is created at the target location?

As for the rest, I don’t know what you mean about “ordinary compile functions don’t work”, sorry.

1 Like

I have downgraded all the way to 3.8.3 and it does create an epub but its functionally empty.

I would suspect some other form of configuration issue at that point, then. What kind of result do you get if you set the Compile For dropdown to “MultiMarkdown”, and then select “Basic Pandoc” as the format, setting up some basic section layouts?

The extra files that I mentioned above aside, that should give you a pretty good idea of what Pandoc is being fed, when viewed in a Markdown editor or regular old text editor.

1 Like

I’m getting a plain text file, without any markdown

I unfortunately have no way to explain that; there shouldn’t even be a way of getting that result on purpose. But we might be talking about different things. Could you post a very simple sample project that demonstrates this result? I can take a look at it and see what might be going on.

1 Like

test [2026_06_24_17_31_10].zip (310.2 KB)

I don’t think this will accomplish anything. You’ll restore this and it will work in your environment but not address the environment that I have.

Perhaps, but perhaps not, we might as well try! :slight_smile: In this case, you have sent me an empty Novel template project. There is nothing in the Draft folder beyond the example starter items, and when I check compile, the Section Layouts column has not been addressed, which means the placeholder “Chapter” and “Scene” items in the draft folder are set to basically do nothing. So it is in this case, no surprise that the ePub is empty.

I do get the standard Pandoc metadata header block, so I wouldn’t necessarily call this a plain text file, but after that block, the file is of course empty.

To rectify this, I clicked Assign Section Layouts..., and set “Chapter Heading” to use the “Heading” layout, and “Scene” to use “Text Section”. The result is of course still not very interesting since nothing has been typed into the example “Scene” file, but I do at least now get one # Chapter # heading line to add some structure to the file.

So I type This is a *test*. into the starter “Scene” file, and this time I compile to Pandoc → ePub, sticking with the “Basic Pandoc” format, which is at this point already been set up. I get the warning, as expected, and cancel out.

I open the test.epub file in Sigil, and see the start of book. It’s not much, but it works. It has a table of contents, it has a “ch001.xhtml” file with my test line and chapter heading:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en" xml:lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <title>ch001.xhtml</title>
  <style>
  </style>
  <link rel="stylesheet" type="text/css" href="../styles/stylesheet1.css" />
</head>
<body epub:type="bodymatter">
<section id="chapter" class="level1">
<h1>Chapter</h1>
<p>This is a <em>test</em>.</p>
</section>
</body>
</html>
1 Like