Let me start off by saying I understand Scrivener is not intended as a formatting tool, like Vellum is. We’re looking for an answer to several specific, but related problems. They all relate to paperbacks.
Sub-section title on one page, opening paragraph of section on the next.
Embedded image on one page, image caption on next page.
Bullet points split across two pages.
It’s a combination of Keep With Next (KWN) and Do Not Split… is that a thing? The key is it’s not paragraphs I want to KWN, it’s a mixture of elements of different kinds.
My question is this… is there ANY tool out there which will do this stuff automatically? We’re having to add Page Breaks manually and that means they all need to be checked whenever we revise the book.
chas$ gem install pandocomatic
Fetching optimist-3.0.1.gem
Fetching paru-0.4.1.2.gem
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
You may need to run gem under sudo, with the gem folder being located in global /Library. It’s something I have to do on Linux, but I don’t recall ever having the need to do so on Mac (maybe Apple changed things in 10.15? I don’t know, I’ve never upgraded to it).
Before you waste too much time installing different componenets: Keep-with-next is not natively supported by Pandoc. But as it knows about the document structure, if the target output supports some form of KWN mechanism, then a Pandoc filter may be able to insert the RAW commands to enable that. What output formats can you use? This will define the possibility or not. But each format deals with document structure in different ways. LaTeX normally automates “optimal” layout, though there are packages to help you to override the default layout. If I had to make books from Scrivener, I would be tempted to use HTML + CSS for publishing via PrinceXML: princexml.com/doc/prince-for-books
Personally I find CSS more understandable for layout, LaTeX is like the dark arts in comparison, though there are packages to do almost everything for you and impressive outputs (like Scrivener’s manual!)… You need to decide what your output will be, and what workflow you are able to support.
On a simpler question, to force a page break in different outputs, you can use the latex command \newpage and a Pandoc filter can convert this into the equivalent code for HTML/EPUB/DOCX/ODT: github.com/jgm/pandoc/issues/1934