I have my left and right indent for pros and cons sections in my book set to .25 inch. When I compile, the left indent is maintained, but the right indent is lost. Anyone know why?
For anyone else dealing with the right-indent issue, here is the official word from tech support.
Hello Chuck,
There is no solution for this except to fix it with an ePub editor. Right-indents are handled differently enough between RTF and ePub that there is no way to translate the right-indent setting in Scrivener into a right-indent in an ePub/MOBI file.
Basically, the right-indent setting in RTF is an absolute setting from the left-side (not the right). This only makes sense if you are compiling to a format that uses a fixed page width (which ePub does not).
Jeff
Literature and Latte Support
Actually, Jeff has missed an easier way of doing this in 3.0 - you don’t need to use an ePub editor to achieve this. Instead:
-
Use a style for your pro & con paragraphs. (E.g. Create “Pros & Cons” style which you apply to these paragraphs in the editor.)
-
Select “ePub 3” in Compile and create your own ebook Format for Compile. If you like the standard “Ebook” format, simply Ctrl-click on it and select “Duplicate & Edit…” to use it as a base.
-
In the “Styles” area of your custom Compile format, add the “Pros & Cons” style, overriding formatting if you want or leaving it as it is. Add a “CSS Name” for it.
-
In the “CSS” area, add some CSS for your Pros & Cons CSS style that adds the right indent you need.
All the best,
Keith
Thanks, Keith!
Would the css for that be a negative right margin such as “margin-right: -1rem !important;”?
You don’t need to make it negative, because “margin-right” counts from the right anyway. So you would just need to put something like this in the appended CSS:
.pro-con { margin-right: 1.5rem; }
I’ve attached a sample project showing this in action. If you Compile it to ePub 3, you’ll notice that two paragraphs are indented both left and right. To see how this was done:
-
Note that the project has a “Pros & Cons” paragraph style, and that the two paragraphs in the editor use this style.
-
Go to Compile, Ctrl-click on “My Ebook” and choose “Edit…”.
-
In “Styles”, note that the “Pros & Cons” style is there and has the CSS class name assigned as “pro-con”.
-
In the “CSS” area, you’ll see that I’ve overridden the “margin-right” value.
So, by using styles for these paragraphs, it takes only a single line of CSS in the Compile Format to get the result you want.
Hope that helps.
All the best,
Keith
right-margin-test 2.zip (58.3 KB)
Thanks, Keith! That was extremely helpful. Problem solved.
I do have another question related to the indented Pros and Cons. For a reason I can’t figure out, the spacing between the Pro and Con paragraphs is greater then the normal spacing between paragraphs. If I try and reduce it by reducing the paragraph spacing “After” setting (from 12 to 10), I can make it equal the usual paragraph spacing, but then there is not enough space between it and the heading for the next section below it. Any thoughts?
Is that from my sample project? If so, it’s simply because I set both a “spacing before” and “spacing after” for the paragraph style formatting, which means that spacing between such paragraphs will be bigger. I only set it up very quickly so didn’t worry about that. You would want to format your paragraphs differently, and you might want to use some “+” syntax in the CSS to adjust padding around paragraphs. For instance, you might set it up so that the Pro/Con paragraph style only has paragraph spacing after, and then use something like p + pro-con { } to add spacing before. On the other hand, you won’t need to do that if all of your paragraphs have para spacing after anyway - in that case you could just set up the style formatting to have paragraph spacing afterwards.
All the best,
Keith
(Apologies for the rushed reply, as I am just finishing up for my holiday…)
Sorry, but I’m not quite following all that. The issue was not with your example. It’s fine. It’s my indented pros and cons paragraphs that have too much space between the pro and con sections. Before and after is fine, but for some reason the spacing between is off.
Hope you have a great holiday.