I have an .epub
that Sumatra displays with only a line break for paragraph separation, which turns the book into wall of text. The .xhtml
files inside the .epub
have proper paragraph markup with the </p>
tag and are displayed correctly in the browser, i.e. there is an empty line between paragraphs. How to tell Sumatra to do the same?
Home / Paragraph formatting in ebooks
Sumatra ignores some elements of styles in CSS and is more compatible with HTML 4.0 rather than with XHTML standard.
Your description may be misleading, as you haven’t explained whether there are really empty paragraphs displayed as empty lines or there are margins set in paragraph styles.
-
It’s an illustration of a known fact rather than its explanation. You should look at the xhtml and css source code and see what is sitting there - empty paragraphs in code like:
<p> </p>
or maybe nonzero margins in stylesheet.css like:
.calibre { display: block; font-size: 1em; margin-bottom: 0; margin-left: 5pt; margin-right: 5pt; margin-top: 0; padding-left: 0; padding-right: 0; text-align: justify }
Sumatra displays only pseudo-empty paragraphs with non-breaking-space inside, like:
<p> </p>
-
It looks like you haven’t tried to change Sumatra settings. You can either select another font (which is more readable to you) or provide
UseFixedPageUI = true
inEbookUI
section (which also should be more readable and has been recommended more than once on this forum). -
Whatever you choose, remember that Sumatra is a PDF reader with limited support for other formats.
As with many e-books it depends where you source them I went to online page for Thomas Ligotti and after stripping all customisation to make it just plain htm (no interference with css etc.) I see this with my choice of comic sans font
and this is how the author that wrote it expects it to be viewed
http://www.ligotti.net/printthread.php?t=439
Comic Sans for Lovecraftians and other horror fans? Really? That would be a horribly horrible horror
The link you have provided is for hard copy printing rather than for displaying on electronic devices, so it’s definitely not the view preferred by the forum founders (possibly approved by the text author). Here’s the default (Dead Dreamer) layout: http://www.ligotti.net/showthread.php?t=439&styleid=60 and here’s the White one: http://www.ligotti.net/showthread.php?t=439&styleid=33
Notice that the linked text doesn’t uses any internal formatting. On the contrary, its the example how to NOT code web pages. It’s a single paragraph with harcoded line breaks <b \>
and indentation made with broken entities      
containing spaces
. And the space between false paragraphs is just an additional line break rather than margin.
So - the original code is broken and it for sure may be displayed improperly, but I don’t know how it’s been converted to “xhtml” - Ant_222 didn’t explained it.
Usher,
The .xhtml
marks up the paragraphs thus:
<p class="calibre2"><span>Of course my parents...</span></p>
The corresponding .css
is:
.calibre2 {
display: block;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em
}
}
and the combination works correctly in the browser (see the screenshot above), whereas Sumatra seems to ignore the margin-bottom
and margin-top
specifications.
It looks like you haven’t tried to change Sumatra settings. You can either select another font (which is more readable to you) or provide
UseFixedPageUI = true
inEbookUI
section (which also should be more readable and has been recommended more than once on this forum).
No, I have played with the settings. The font is allright to me, why don’t you like it? I have found UseFixedPageUI
for reflowable books (not scans or PDF’s) a terrible idea because it won’t let me adjust CPL (characters per line) and page margins to produce a harmonious page layout.
Whatever you choose, remember that Sumatra is a PDF reader with limited support for other formats.
That’s why I have to extract .ebook
s and read them in a browser.
Well, it’s not only about margins, it’s about tags supported in Sumatra. Sumatra for sure can display margins defined for <body>
and indents defined for paragraphs in both UI modes. Calibre can do such formatting, you should just install newer Calibre version or dig a little deeper in its conversion settings. And let CSS be really cascaded…
Notice, that Calibre can also create Table-Of-Content, but there should be tags for headers there (or proper styles in original documents) rather then paragraphs with styled span inside (or indentations with spaces and manually changed fonts in original documents).
I use FixedPageUI, because the other style is read-only - you cannot search and copy. I work a lot with ebooks as documents and frequently use these tools.