Struggling with page spanning liine

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.

Help!

Why not insert a link to an image of a line and designate a width percentage for epub purposes which would adjust to different readers.

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:

  1. Create a new blank project and in the initial document, type one, press Return, type <hr/>, Return, and then type two
  2. 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
  3. Choose File ▸ Compile...
  4. Set the Compile For dropdown to epub
  5. Double-click the “Default” format and choose to Duplicate & Edit
  6. Select the Styles pane, then click the dropdown + button in the upper right and select the “Raw HTML” character style
  7. With that style selected in the pane, tick Treat as raw markup
  8. Give the compile format a name and click Save
  9. 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).

3 Likes

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… :upside_down_face: