When compiling a Scrivener document with parts and chapters, the parts are the chapters in ePUB

I’d like to confirm that the following is the expected behavior. I have a book with a structure like this.

Part A
Chapters 1 to 20

Part B
Chapters 21 to 40

When I compile this book to ePUB (using MultiMarkdown/Pandoc if it matters), in the resulting ePUB, there are only two chapter xhtml files (ch001.xhtml and ch002.xhtml) for parts A and B.

Is this the expected behavior-- that I should get two chapter files in the ePUB instead of 40?

Since each part contains 20 chapters, these files are huge and so performance is slow on old Kindles. So is there something I can do to use parts in Scrivener but still output an “xhtml file per chapter” instead of an “xhtml file per part” in the ePUB? Or do I need to stop using parts?

Scrivener 3.0.3, macOS 10.13.6

Are the parts folders, and the chapters text files?

If yes, it is likely that the separators being used (between folders and files; between files and files; between files and folders; i.e.between section layouts) aren’t giving Scrivener the delineation instructions it needs to break the text files into separate chapters.

Though in the Windows forum, the thread linked below has some ideas about changing separators or restructuring the binder in order to create discrete files. The template first used to create the project might well have been structured, by default, to regard folders as chapters and files as scenes…which would give the output you describe. But, with Scrivener, users are omnipotent, so you should be able to tweak the settings to achieve whatever you want.

literatureandlatte.com/foru … t=Chapters

If no, more information about the structure of the project would help.

Slàinte mhòr.

Thanks for the reply.

The parts are folders.
The chapters are text files.

My project settings:

Level 1 folders: Part
Root file groups: Chapter (With Text)
Level 1 file groups: Chapter (With Text)
Level 2 file groups: Chapter (With Text)
Level 3 file groups and deeper: Section with Title
Root files: Chapter (With Text)
Level 1 files: Chapter (With Text)
Level 2 files: Chapter (With Text)
Level 3 files and deeper: Section with Title

On the separator configuration screen, I tried setting everything to “Section break,” but that didn’t seem to help.

I recreated a sample project with two parts and four chapters here:
dropbox.com/s/3z4zbl9qix2tk … t.zip?dl=0

When I compile (Pandoc -> ePub), the ePub file has two xhtml files instead of four.

Convert the chapters to folders. That will make it easier to do what hou want.

In the document linked above, I converted the files to folders (right click -> convert to folder).

Then I compiled, but the resulting file only has two xhtml chapters (one for each part) instead of four (one for each chapter).

You need to tell Scrivener how to use the structure. It’s explained fairly well in both the i teractive tutorial and the manual. You have done the tutorial…?

If you’re using Pandoc > ePub, take a look at the “Base header level” and “Split chapters at level” settings right at the bottom of the metadata pane of Compile. These are what you need to adjust.

Thanks Keith, setting the “Base header level” to 1 and “Split chapters at level” to 2 fixed the problem for me when using “Pandoc -> ePub”.

Is there a way to also use this with the “MultiMarkdown” compile option?

When I select “MultiMarkdown,” I can choose the “Base header level” but there’s no longer an option for “Split chapters at level.”

“Split chapters at level” is just a convenient UI for setting Pandoc’s “–epub-chapter-level=” option, which is a specific option for ePub files, which is why this is not available for other formats.

All the best,

Thanks Keith, that’s exactly what I needed to know!