While I was writing a little webinar on exporting Scrivener novels to EPUB, I just stumbled over some strange behavior regarding the first line indent. I setup a new project with the built-in Novel template and used the folder/scene paradigm for the binder structure, just as explained in the information page of the template. But when compiling with the Ebook format, the first paragraph of the chapters were indented, and they shouldn’t be.
So I dove down into the XHTML and saw the following generated code:
> <div class="chapter-title">
> <h2 id="doc3" class="chapter-title-page-padding"><br /></h2>
> <h2 class="bordered-title"><span style="text-transform:uppercase;">CHAPTER ONE</span></h2>
> <p class="br"><br /></p>
> <p class="separator"><br /></p>
> <p id="doc4" class="ps2"><span style="text-transform:uppercase;">THE PURPOSE OF</span> this document is to demonstrate the conversion process into an ebook, in ...
Normally, a CSS rule in the standard stylesheet would kill the indent of the first paragraph:
.br + p { text-indent: 0em; }
But in this case, the paragraph was preceded by a <p class="separator"><br /></p><p class="separator"><br /></p>.
Now that I knew the cause of the problem, I went into the Ebook format, set the Separator before sections of the Section Text section type to Single Return and all worked perfectly. Now the generated code looks like this:
<h2 id="doc3" class="chapter-title-page-padding"><br /></h2>
<h2 class="bordered-title"><span style="text-transform:uppercase;">CHAPTER ONE</span></h2>
<p class="br"><br /></p>
<p id="doc4" class="ps2"><span style="text-transform:uppercase;">THE PURPOSE OF</span> this document is to demonstrate…
And the CSS rule works just fine.
I am posting this, as others might also stumble into that same problem. Also, it might be helpful in improving the project templates.
If someone with more experience than me has time to look into this, I would appreciate to learn what I might have done wrong for the standard template to work or get a confirmation of my observation.
Cheers
Norbert
