Quote:
Originally Posted by Quoth
I got an ebook from Amazon by a big publisher and it had NO <p> or <hn> tags at all! Every paragraph and heading was a <div> with a suitable CSS.
So I used Calibre Editor with "Plugins -> Edit Span and Div" to replace preserving class to either <h2 class="cs"> or <p class="bs"> and then global edit to replace the first <p class="bs"> after an </h2> with <p class="no-indent">, created by copying bs and changing text-indent: 0
I only opened it for edit because the line-height was fixed and stupid, so I simply deleted ALL line-height settings in the style file (CSS classes).
My automatically converted by Calibre from docx exported by Save As from Libra Office Writer are consistently better than ebooks by big publishers. I do have to edit css classes for any images (I don't usually have many) to either an absolute pixels high or a percent width depend what they are for as the Styles for images don't map well. All the text paragraph styles / headings etc map perfectly to CSS classes.
|
If I find <div> instead of <p>, I will fix it to be <p>. I also remove all line height and the L/R margins as well as font size for the main text and offset text. I don't like when offset text is made to be smaller. There's no need for that. I also remove mode embedded fonts. And some eBooks have a font-family specifying a font even though there are no embedded fonts.
There are a lot of mistakes made in eBooks and there can be hundreds of unused CSS. Sometimes when you remove unused CSS, you end up with a small CSS. It's crazy how poorly made most eBooks are.