Preserve format behavior help

I apologize if the answer is already on the board or in the manual, but my search-fu is weak…

In one project I’m working on (which I believe was a version 2 project converted to version 3 when I upgraded), a preserved

gives me a shortened horizontal line as a scene break when I compile. When I copy that same preserved text to another project (version 3 from the start), I get that text outputted into the epub instead of the line.

I’ve tried searching the user manual, but wasn’t there a check box in version 2 to treat preserved text as HTML? Is there an equivalent setting in version 3?

Preserve Formatting is no longer used for this purpose. The capabilities it provided have all be supplanted by the stylesheet system. So in the new way of working, you’d create a style called “Raw HTML” (or something), and then set up that style to treat marked text as raw markup:

  1. Open File ▸ Compile… and edit the compile Format you are using, in the left sidebar.
  2. Go to the Styles compile format pane and click the + button to add your HTML style to the list.
  3. With the new style selected, tick the Treat as raw markup checkbox to the right of the style list.

You may want to save your adjustments as a global format at this point, by switching the save location to “My Formats”, in the second dropdown at the top of the format designer window. Now any projects that make use of “Raw HTML” will benefit from these settings. One big advantage to the new system is the Delete text of this style setting, also in the Styles pane. If you compile to something other than HTML, you can strip it all out with a format set up for that.

That leaves converting the old text to the new format. There isn’t an automatic way to do that, but you can set up the Edit ▸ Find ▸ Find by Formatting tool to look for preserved formatting. With that set up, alternate between ⇧⌥⌘G to locate and select the next preserved text, and hitting the shortcut you can optionally assign to the raw HTML style, then back to “find next” and so on. This will simultaneously remove the preserved formatting and apply the style you need.

Also consider using a Replacement for your hr itself. If you style something like “----”, and then have replacements look for four hyphens and turn them into “<hr style=”width: 30%" />", then you keep this formatting decision central and easily changed in the future. That’s how I would handle this anyway, as it would also look nicer in the editor.

Sorry for the late reply, but thank you very much for your help.