View Single Post
Old 10-10-2020, 12:02 AM   #28
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Quote:
Originally Posted by JSWolf View Post
How do you know that your styling and transform settings will actually be compatible with the CSS in the eBook? An eBook created by Word, InDesign, house style, Vellum, Pages, and other programs can have different classes. You would have to tailor your CSS for each different CSS. It's not going to be a catch-all as there is no way you'll know the CSS being used in all your eBooks.
To answer your specific question, Calibre will ignore any settings in those sections that don't apply or are not in the file, so it's no big deal to include them all.

I've used my system on thousands of ebooks. The things I've added to the styling and transform sections include the codes that all or most of the publishers use. As I was working on these books, I would add things to those sections as I came to them. After a while, I had added all that I needed to add. Once in a great while, I'll have to manually fix something that my settings changed incorrectly, but that very rarely happens. Usually, when that happens, the publisher used a code like "nonindent" for all the text paragraphs, so it's always an easy fix.

After I convert an epub, I'll open the file in the editor and run Check Book, plus check all the basic formatting to make sure everything is the way I want it to be (which is the way physical books are formatted). Sometimes, I have to make manual edits for various things, and sometimes, I'll have to reformat everything, due to terrible coding by some publishers. When I reformat everything, I'll copy my template CSS list over the .calibre section in the CSS file and change all classes in the HTML files to my classes (with names that make much better sense than those used by publishers).

Some of the things that I have automatically fixed are:

Remove any line space between paragraphs. Sometimes, I have to manually fix these, of course.

Change all indents over .01em to 1.2em. For the first paragraphs in a chapter, I'll change those indents to zero (and manually fix any that don't get changed during the conversion).

Justify all text paragraphs (I've added all the normal publishers' codes used for text paragraphs to the styling section). Once in a while, I'll have to manually add Justify to the CSS file. It very rarely happens, though. Just depends on the publisher.

Change the line-height to 1.2.

In the Transform section, I've added many errors found by Calibre, so when I do the Check Book routine, I rarely have errors to automatically fix or manually fix. The usual type of error that I still have to automatically fix are ID number errors, which is a quick fix.

To include all the various codes used by all the publishers, I have many entries in both the styling and transform sections. This system has saved me tons of time in the last few years since I set it all up. Thanks to Kovid for telling me how to enter the entries under styling!

I have my rules.txt and styling settings, plus my modify_epub screenshot and an instruction file in a zip file that I would be willing to give to anyone who wants it. Just send me a private message.

Last edited by deback; 10-10-2020 at 12:08 AM.
deback is offline   Reply With Quote