Line spacing issue because of italics

Hi everyone !

I’ve been a Scrivener user for a few years now and so far, I’m really enjoying it.

There is this issue I’m having that I can’t seem to resolve on my own this time, so I’m turning to you for some help, please.
When compiling my work to epub, words in italics cause a change in the line spacing that is too big to not notice (I don’t need to emphasize this much :sweat_smile:). This only happens when there’s a single word in italics inside a paragraph; a whole paragraph in italics looks juste fine.
Here’s how it looks like on my e-reader:

When compiling my work to epub, words in italics cause a change in the line spacing that is

too big to not notice. This only happens when there’s a single word in italics inside a

paragraph; a whole paragraph in italics looks just fine. Imagine some random text here because I’m too lazy to come up with something, but I need to add more words.

I tried making changes in the CSS code, but to no avail.
I hope someone can help me understand what I’m doing wrong.
Thank you in advance for your help.
Have a nice day~

When you were looking at the CSS, did you notice anything about the italic formatting font size? The kind of problem you’re describing is one you might see in simpler layout engines. Superscript for example, commonly causes the line it appears on to be taller than the rest around it, but having larger text in a line can also do that. A book reader that doesn’t have a display stylesheet designed to handle these things might have the effect you describe.

If not though, maybe this ebook reader you are using has an issue with perhaps the display font being used and italics? Perhaps it is using a theme that causes a bad interaction? I don’t know, there are too many variables there for me to even speculate.

Of course to rule out that, you can try a different ebook reader, along with Sigil/Calibre Editor, both of which give a pretty vanilla and “honest” rendering of the formatting.

3 Likes

The class used for the italics could have a different or larger font, make use of padding or margins.

Can you locate an affected sentence in Sigil, and copy the XHTML and the CSS class it uses?

2 Likes

In the style part of the CSS in Scrivener, the only information about the italic formatting was basically:

.emphasis { font-style:italic; } which made the font bigger (I’m using the character style that comes with Scrivener by default). Here is what it looks like after I made changes (that didn’t work completely) so that it matches the formatting of the style used for the plain text:

.emphasis { margin: 0rem 0rem 0rem 0rem; line-height: 1em; font-style:italic; font-size: 0.75rem; }

The text, both plain and in italics, looks just fine with Sigil though, and it doesn’t seem to find issues within the CSS.
As asked by @AntoniDol , here is the CSS that comes from Sigil for one of the affected parts:

.emphasis { font-size: 1.00rem; font-weight: normal; font-style: italic; }

Capture d'écran 2026-09-04 154335

I hope I’m managing to explain myself well enough. Talking about technical stuff in another langage is a bit of a challenge. :sweat_smile:

1 Like

Okay! Yeah that’s definitely a bit of a bug on the Scrivener side. It may be the .emphasis class is being described in a bit of a hard-coded fashion when it really should not be (or the font size checkboxes are broken, broadly). Emphasis should work just as well in a block quote, which might be smaller than body text, as it should in body text, or even a heading.

The reason why I’m puzzled as to why it is coming out that way, is that nowhere can I find the font size being declared. The default “Emphasis” style provided by Scrivener deliberately has the font size checkbox disabled (as it should), and the default Ebook compile format has no override for Emphasis at all. Even if you do add your own override to the Styles pane, and make sure to leave the font size checkbox disabled, it will still print “1.0”.

That at least explains why we do not see this reported more often, as you would need to be using emphasis in a smaller than body text area to get that effect.

I’ll make sure we have the base bug listed, but it looks like you have a workaround for now. The only suggestion I would make is to do this instead:

.emphasis {font-size: inherit; font-weight: normal; font-style: italic; }

This way it will take the font size from the paragraph it is found within (or indeed whatever the parent element is, it might be <h2>). If you change the paragraph text size, the emphasis text will continue to match it.

Paste that into the CSS compile format option pane, and that should make it work across all areas of the text it is used within.

3 Likes

So I tried copying and pasting the code you suggested, but now the font for the text in italics is bigger than the rest. I guess I’ll just have to accept that it will never look the same as long as the bug is still there.

Many thanks to the both of you for your help. It is much appreciated !

1 Like

Interesting, I might need a more specific test case to work from then, to provide a solution that works more universally. I tested by trying to reproduce your scenario:

  1. Set some text to Block Quote.
  2. In the CSS pane, add an override to set .block-quote to 0.75 rem.
  3. Add some Emphasis text to the block quote.

I then let that fail, to confirm the bug, getting the large italic issue with its 1.0 rem setting. So for my next test I added the above CSS to the pane, and that solved the problem entirely.

I then tested applying Emphasis to a heading, as well as body text, to make sure it continued working across different text scales.

So you must be arriving at 75% in a manner I’m not thinking of, and in away that would somehow dodge the expected cascade part of cascading style sheets.

Well, I suppose it is academic if hard-coding Emphasis to 0.75 rem works for you, but my curiosity goblin is difficult to ignore. :slight_smile:

1 Like

I followed the same method as you on my side, and it still doesn’t work (the text set to Block Quote remains wider than the rest, which is set to a paragraph style I created to match the page setting norms in France). I’m starting to think that I messed up the CSS to the point that your solution can’t work, because of whatever I did wrong.

The reason I set the font size to 0.75 rem is that without any specifications in the CSS, I’d end up with text with a font size so big my e-reader displayed no more than a dozen words per page, while text from other e-books would look just fine.
It works quite well, unless I try to add words in italics here and there. It really is my only issue when compiling.

That does sound like something in the CSS is fighting the compile output, rather than just the italics bug on its own. If the base text was coming out huge until you forced it down to 0.75rem, there may be a font-size rule higher up, maybe on body, p, a custom paragraph style, or even a section layout class, that is skewing everything and making the Emphasis fix miss the actual target. I’d try a very boring test compile with the default Ebook format, no custom CSS except the block quote size and the Emphasis workaround, just to see whether the problem disappears. If it does, your current CSS can be trimmed back bit by bit until the gremlin shows itself. Annoying, yes, but CSS gremlins do like hiding under perfectly innocent paragraph styles.

1 Like

I’ll have to try that when I have enough time. Hopefully, I’ll find out what is causing the issue. I’ll keep you updated on the matter.

Hi, everyone!

I’m back to give some updates. I did as advised by @dusty_cormorant82.
Compiling with the default CSS did okay, words in italics were the same font size as the rest of the text, nor did they leave a noticeable gap between the lines of text. I then reduced the font size in the CSS, it still worked. Then I created a custom paragraph style, applied it to the paragraph containing words in italics and shrunk the font size again to see if the italics would be affected by it too. It worked again as it should have.
So now I need to go back and repair the CSS that I butchered. :sweat_smile: I think this small test helped me figure out where the issue was! I just have to make this work now.

Thanks again for your help, everyone!

1 Like