How to control first paragraph indent?

I am compiling to ePUB 3. In the attached image from iBooks, you will see that the first paragraph is indented in the top example. It is not indented (it is “flattened”) in the second example. The Scrivener user guide (24.5.3) says that, for ePub 3, indent flattening depends on CSS. Yet I am not (knowingly) using any CSS. So what is controlling the first paragraph indents in my example? The source SCRIV file also is attached. Thx

Test - Indent.scriv.zip (97.3 KB)

AFAIK, the settings in Separators and Text Layout (certainly, changes in these sections impact on how the ePub compiles, either with or without indents).


Thank you Bridey. You are correct that the options in Text Layout control paragraph indenting across the entire manuscript (at least, that’s my understanding). But I’m trying to control indenting by section layout. That’s were the manual implies that CSS is needed, but I don’t know how to do that. Can anyone share an example?

Sorry if my question was not clear.

Well, this will become more complex unless you understand CSS? Basically you use the Section Layouts▶Settings panel to assign a CSS class to a Section Layout. A class is a “name” to which the CSS will apply rules. Now check out the CSS panel, and you’ll see how the automatic indenting rules work:

/* Base text formatting */
p { margin: 0rem 0% 0rem 0rem; text-indent: 1.5rem; }

h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p { text-indent: 0em; }

.separator + p { text-indent: 0em; }

.br + p { text-indent: 0em; }

So p is the default paragraph element in HTML, and it is assigned a text-indent:1.5rem (rem mean relative em units, an em is the width of the – em dash). The next rule is an adjacent sibling selector (+), so it says a paragraph that is adjacent to a h1-6 header gets 0em indent. So does a p after a .separator or a .br class.

You will need to assign CSS rules to affect your custom class name in the way you want.

.myclass { text-indent: 1rem; }
.myclass + .myclass { text-indent: 0rem; }

CSS is powerful but somewhat complex, especially when you are trying to do automatic rules that depend on position (my rules above may not work how you want them to, YMMV)…

Apologies if I misunderstood and if I still misunderstand now, but in the image of the Separators (left-hand column), we have chosen Section Layouts > Text (middle column, where Text is the name of one specific type of section layout), and we have then set the attributes for the types of separators to use for that specific section layout (right-hand column). The separators then impact on how the following lines are or are not indented (as determined by the Text Layout settings for indents). We could apply different attributes to the other section layouts (Chapter Title and Bundle Title) if we wanted to.

I believe that the above does allow the user to control the indents of different section layouts. Or am I holding the telescope round the wrong way and seeing things with a fuzzy mind?

As far as I understand the process, these toggles/settings are applied to the final ePub as a Scrivener-generated CSS. I think that we don’t need to change/write the CSS manually, but I might well have misunderstood this completely.

Guess Ioa or Keith will be along with a clearer answer.

EDIT: nontroppo posted a better reply while I was typing.

Bridey: actually I think your answer is the better route for 99.68% of people — it does what pomme4mois wanted automatically. I’m not quite sure why pomme4mois wants to solve this problem with manual CSS editing when the default rules should work? But it does demonstrate how much more powerful Scrivener 3 compile is to have this wonderful flexibility!!! The CSS control from within the compiler, without having to hack away in Calibre/Sigil is just brilliant, and it does allow users to share their EPUB3 compile format where just about anything is possible…

Darn, I was hoping it would work for 99.69% of people.

Yes, I think the system should work swimmingly for most users, with custom CSS giving succour to the flamboyant 0.32% who have additional needs. I misunderstood pomme4mois’s original question and was looking for a standard in-built resolution. But CSS control is a brilliant feature to offer.

Thank you all. I was reacting to the Scrivener User Guide, section 24.5.3, which states that indent flattening for ePUB 3 depends on CSS. Or maybe I’m just interpreting the manual incorrectly.

I agree, this is potentially confusingly worded.The footnote should refer the user to §24.6.4 which explains the options in the Text Layout panel (that does use CSS under the covers).