Page breaks removed when compiling to PDF

When I compile my draft, all the page breaks that I inserted manually in the middle of a document are simply ignored by the compiler. All my section are of type “N/A” and no special compile options set.

My use case is a kind of a big quiz document. On one page is an assignment or question and on the next page the solution. Without having the possibility of setting page breaks manually, I would have to artificially split up each document into two parts and assign a section type to the solution part such that a page break will be placed at its beginning in the compile process. A lot of complexity for a relatively simple task.

I know that this subject has already been discussed in the forum, e.g. here
I am just wondering, why we can place page breaks in the first place, when they are finally being ignored by the compiler.

Also: I noticed that some of the manual page breaks mysteriously disappear over time. I can’t reproduce that yet, but will keep an eye for finding what exactly caused them to disappear. Did anybody run into that yet?

(Scrivener V3.0.1, Windows 10)

This appears to be working fine for me, and I have attached a simple test to demonstrate what I am doing. This test project uses extremely simple settings, really all we are doing here that is unusual is adding a heading to the section that is printing text. No formatting override is being performed. The zip file also includes the two output files as compiled on my system.

…I would have to artificially split up each document into two parts and assign a section type to the solution part such that a page break will be placed at its beginning in the compile process. A lot of complexity for a relatively simple task.

I suppose you could look at it that way. To my mind anything so large as a page break makes sense in its own outline node, because it is a decidedly different thing than anything around it. I would have a setup like this, with section types denoted in brackets:

Draft/
	Quiz Section A [Quiz Section]
		What is the price of tea in China? [Question]
		The pot calling the kettle black. [Solution]
	Quiz Section B [Quiz Section]
		...

Now one could create a document template folder structure that is the quiz section group, with the two subdocuments nested within it, section types all set up and ready to go, and the group view mode on the container locked to Scrivenings. Click on the quiz section; see text in editor just like you’d normally be working.

Only difference being you wouldn’t have invisible codes somewhere in the file to carefully work around in order to not accidentally delete them.

Just a thought! We do put the command in there for those that prefer a less structural approach to document design—but I would say the above is definitely more aligned with the design intent of the software.

The attached project demonstrates how I would approach this. You’ll find that if you click on the “Quiz Section” template folder the two subsections will appear in the main editor, ready to edit. If you wanted to test this, you could select the draft and insert this folder from the Project ▸ New from Template ▸ submenu.

manual_page_break_test.zip (177.7 KB)

Also: I noticed that some of the manual page breaks mysteriously disappear over time. I can’t reproduce that yet, but will keep an eye for finding what exactly caused them to disappear. Did anybody run into that yet?

Haven’t seen that happen, but I’m definitely the wrong person to ask.

1 Like

Thank you @AmberV for going through all that and preparing that little demo project. As expected, this project worked on my side as well.
In the next step, I started to look for the differences to my own project. What appears to be the difference is: In your demo, the page break stands on a paragraph with no style assignment, while in my project it is part of the heading for the next page and thus the paragraph does have a style assigned. When I remove that style from the paragraph, the page break is being compiled correctly. So that seems to be a compiler bug.

I noticed two more strange things in this regard:

(1) When I remove the style from my heading paragraph and set it to “no-style”, the manual page break is removed as well. (Btw. that gives a hint to what might be the compiler bug above: It appears that the page break is part of the style and hence being removed when switching to no-style. When deciding whether to put in a page break, the compiler looks at the style’s data structure first (and only there) and doesn’t find the page break flag set. Instead the page break flag is only set in the text paragraph, not it’s style).

(2) When switching “Show Invisibles” on, we can see the paragraph marks. What’s strange is that the paragraph mark of the previous paragraph is formatted to the settings of the current paragraph. Here is an example: We have the following contents:

<no-style-paragraph>¶
<styled paragraph with big font>¶

In this case the the first ¶ mark will appear in big font. I would have expected the second paragraph mark to appear in big font, while the first one be normal.

1 Like

Thanks for the details! I can confirm the two issues you describe with page breaks that directly precede styled paragraphs.

It looks like the best functional workaround at this point is to leave an empty line between the styled paragraph and the page break. That is not at all ideal for a word processing document (you may have noted my example was double-spaced, that’s my mistake for using a Markdown starter project to test with), but if you definitely must have page breaks and styles together in the text, I think that’s the only way to do it.

In this case the the first ¶ mark will appear in big font. I would have expected the second paragraph mark to appear in big font, while the first one be normal.

Yeah, setting aside for the moment whether the whitespace markers should even be using the font settings of the text around them (I find that a bit off-putting), there are longstanding issues with paragraph styles “consuming” the paragraph break they follow rather than staying contained within the one line. It’s possibly why the page break is being destroyed when changing the style assignment, but it causes other problems as well—particularly in plain-text workflows where you might be using styles to insert syntax around paragraphs. Having the prefix start on the end of the previous line can make a mess of things. So that one is documented, but it might be related to the other issues.

By the way, while I was checking the ticket database to see if these issues were already recorded, I noticed there is a bug where using the command to convert formatting to default settings will wipe page breaks. If you think you might have run that command in the past, that would explain the disappearance.

Thanks again!

Great job, @AmberV. To fix those little bugs should not be a big deal, as far as I can see. So I hope the fixes will be included in the next release.
Btw.: Is there a way for us normal users to check the ticket database? I don’t want to be ignorant, when I check myself if something has already been reported.

Unfortunately there is no public ticket database. I agree it would make things easier in some ways, but it would also increase complexity as you’d then need a second setup where personal data (used in reproductions) be used in testing and so forth. As a very small team, it would be a lot of overhead moderating a public database.

I totally understand. I just was wondering if I had been overlooking it.

Great Manual by the way. Together with the tutorial it brings you up to speed in a relatively short time. I love that you used the Biolinum Keyboard font to even show the keys in a very intuitive way; something I immediately added to my treasure box :slight_smile:

Many thanks! It’s always good to hear when the documentation is effective. I had a lot of fun getting the keyboard shortcut stuff working.