Epub blockquote format: How do I control the fomatting?

I’m facing two issues concerning blockquotes:

  1. I’m getting too much space above and below blockquotes, about 3 blank lines, when 1 would suffice - see screenshot. I can’t find any way to control this:


  1. How do I indicate that the editor formatting should be used in blockquotes? I have set the desired font size in the editor (1 pt. smaller than the body size), but the only way I have found to get the desired size in epub is to specify this in the blockquote compile format style options, which shouldn’t be necessary. I have tried enabling and disabling “include font size” but this seems to have no effect.

Are you using a Blockquote style? If so, you can adjust the line spacing as part of the style specification. Look at the Format → Paragraph → Line and Paragraph Spacing dialog.

Yes, you’ll need to specify the font in the ePub Style settings. It’s actually fairly difficult to force particular formatting choices in ePubs because they’re designed so that the reader software can override them.

1 Like

Many thanks! Yes, I’m using Blockauote style. What about point (1)? How do I adjust the above and below spacing in the compile style format?

From the main Compile screen, right-click the Compile Format you’re using and choose the Edit (or Duplicate and Edit) option.

In the Compile Format editor, choose the Styles tab, then select the Style you want to adjust from the list.

The preview text below the list of Styles will show you what the Style will look like. To adjust paragraph spacing specifically, choose Format → Paragraph → Line and Paragraph spacing from the main menu.

Also, check and make sure you don’t have excess carriage returns in the underlying text. View → Text Editing → Show Invisibles will show them.

1 Like

Do you mean the Format menu entry in the main bar, not anywhere in the pop up window? That’s weird. I would have never expected to find options available outside the window where the action is taking place.

Changing this setting does have an effect on the generated epub. For instance, I changed it to 50pt above and below and got an even bigger spacing. But setting it to 0 does not result in no spacing. Evidently there is minimum space that can’t be decreased.

Concerning excess carriage returns, I have indeed placed one blank line before and after the quotes in order to work around an issue with the PDF generation - see Incorrect PDF formatting for paragraph following blockquote - #4 by ds. That’s not an ideal solution, but I can live with it.

Removing the extra line does result in less space in epub, but not the elimination of all extra space. As I said before, there appears to be a minimum space that can’t be decreased.

What happens if you change the CSS for block quotes? Search for the following in the CSS pane:

blockquote { margin-left: 2rem; margin-right: 2rem; }

Replace it with:

blockquote {
  margin-top: 0rem;
  margin-bottom: 0rem;
  margin-left: 2rem;
  margin-right: 2rem;
}

I don’t know if you can modify the core CSS for block quotes using the GUI. The “Block Quote” style doesn’t actually have any before/after paragraph spacing applied to it by default. And, if it did, it would not work that way anyway, around the whole block of paragraphs rather than in between each paragraph. I believe the way block quotes are spaced is hard-coded into the “Default Stylesheet”, which you can only override (like we do above) rather than change directly.

1 Like

Many thanks for the suggestion! But I’m trying to write a book, not hack code, so respectfully I’ll decline going down that path. May I humbly suggest that if the compiler ignores an option that it is supposed to respect, that is called a bug? At least, that’s what we called it in SW development (and I have implemented compilers). And a bug is something that a user would expect to be fixed eventually?

If you can give me a tested fix in some form to use termporarily while the bug is being fixed (as was done in Incorrect epub formatting of footnote in blockquote - #8 by Dain), I’ll gladly use it. Thanks in advance.

This is all pretty basic ebook publishing stuff that I’m referring to, so unless you want to be completely subject to the limitations of generators, you’re going to have to be somewhat aware of what this means—it’s part of writing, if one is going to be doing book design, in other words.

It’s pretty easy anyway, as ebooks are in fact like very simple self-contained websites. Knowing that, and how to look at them in a more forensic manner, makes figuring out what is going on (like this) a lot easier than looking at the end result in an ebook reader and wondering if it is Scrivener, the ebook specification, the HTML rendering kit or the ebook reader’s cosmetic theme designer that’s responsible for what you are really looking at. Thankfully none of it is code, though, it’s just some basic markup and formatting instructions. You copy and paste what I gave into the CSS pane, replacing the ones already there, and that’s it!

But that aside, no I wouldn’t consider it a bug as it is working precisely as intended. A GUI can only do so much, we can only make so many things subjectively easier to do without “hacking” as you put, and doing stuff directly with CSS formatting. If you look through the formatting instructions in the CSS pane, you will a lot of things being done that have no checkboxes or controls. There is formatting to keep the figure and caption on the same screen whenever possible, the bordered title variants, and so on.

This isn’t all that unusual, though in most other programs you will find there is no way to override the aesthetic presumptions of the designers. If you don’t like it, tough luck.

Now the footnote issue you cross-referenced, yes that is a bug! It should not be putting footnotes in a <blockquote> element, which is what is happening here. I’m afraid I can’t offer you any workarounds that do not involve CSS.

2 Likes

I’m really grateful for you taking the time to explain all this to a confessed newbie! This is really first-rate support. But I’m not sure I agree 100%:

  1. If an application can’t realize some option, the GUI shouldn’t present it to the user as if it could.

  2. Unless it is impossible to control the spacing around a blockquote in epub, the application should provide a way to do it rather than forcing the user to go to such a low level. I’m pretty sure that most writers using Scriviner are not prepared to hack CSS (unless they’re writing a book about CSS), so, IMHO, a goal of the application would be to provide a higher-level solution. So consider this a feature request rather than a bug. Can you submit this request on my behalf? (It can’t be so difficult to implement. The compiler should just look at the top and bottom spacing set in the Format → Paragraph → Line and Paragraph Spacing options and set the attributes of blockquote to the given values.)

  3. All that being said, the fix you gave me does work. So many thanks for that. Maybe I can get this book out by Christmas!

The problem here is that you can substitute any task you like for “control the spacing around a blockquote.” That is, unless Scrivener is going to implement a full-fledged WYSIWYG CSS editor (on top of everything else that the Compile command already does!) there will always be formatting tasks that run off the edge of what can be done via the GUI. Not only would that be well outside Scrivener’s primary focus on writing, but there are abundant other tools that already do that.

2 Likes