I understand why the page spanning line construction doesn’t work in epub. I investigated a bit and it seems the solution is to create a style “Raw HTML”, use that to add an HTML divider, and set the compile option to treat the style as raw markup. So I did that and inserted the following line as a test of the solution:
<b>hello</b>
The result of this is the following
<b>hello</b>
which is obviously not what I want.
A second problem is that the PDF generation now includes the first string, which is also what I don’t want. I set the compile option to “delete text of this style”, which sounds as if it should do the job, but it has no effect.
Using a Raw HTML style for the <hr/> code is the way to do this, but given your test results it does look like something’s awry in the setup. It sounds like you followed all the steps, but just to make sure we’re working with the same basis, here are steps to set up a test from scratch:
Create a new blank project and in the initial document, type one, press Return, type <hr/>, Return, and then type two
Select the <hr/> and use Format ▸ Style ▸ New Style from Selection... to create a new style named “Raw HTML”
choose “Save character attributes” from the dropdown
deselect both font boxes
Choose File ▸ Compile...
Set the Compile For dropdown to epub
Double-click the “Default” format and choose to Duplicate & Edit
Select the Styles pane, then click the dropdown + button in the upper right and select the “Raw HTML” character style
With that style selected in the pane, tick Treat as raw markup
Give the compile format a name and click Save
Compile the document and open in Books
That works in my test, as does applying the Raw HTML style to <b>hello</b> in the project set up that way. If that also works in a new project for you, then it’s just a matter of isolating where wires are crossed in your main project (and that may then also address why the “delete” setting also failed); if that’s not working, we’ll need to probe elsewhere.
What Scrivener and OS versions are you running? I was checking this on Sequoia 15.6 and Books 7.6 (6387), Scrivener 3.5.2 (17487).
Thanks so much for the trouble you’ve taken to help me! I’m a little embarrassed to say that I’ve decided the solutions are bigger than my problem and I just created a separator out of a row of asterisks and tabs. Looks good enough for my purpose in PDF. The tabs disappear in epub, but it also looks good enough. Sorry to have put people to such a lot of effort to help me…