View Single Post
Old 03-24-2018, 07:59 AM   #16
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by deback View Post
I use the Modify ePub plugin and Convert to automate many fixes. Convert will fix many things, if you add enough things in the Styling and Transform sections of Look and Feel.
I too use Modify ePub and it works very well.

Don't convert to try to fix things. It will make the code more difficult to fix things. Go from the original code.

Quote:
Some of the things I fix automatically in most of the books I convert are (I run Modify and then Convert):

All indents are changed to 1.2em, all line-heights are changed to 1.2, remove blank line spaces (but sometimes I have to manually edit the paragraph CSS code to fix this or manually delete the lines that add the blank line spaces), change the "body" side margins to 30pt from 5pt, add the Charis font and remove all other font style CSS codes in the .css file, remove all the CSS codes that are invalid according to Calibre (these are all in the Transform section), justify all text in the paragraphs (manually have to justify some of the sections at the beginning of the books), change the CSS code for cover images that are coded as auto and auto to 100% and 100% (I have a macro that adds the CSS code for this in the .css file, so I only change the class to calibre3a and hit ctrl-shift-5 to add the CSS code quickly), paragraph font size is changed to 1em from whatever the original code is, and many more automated things I can't think of at the moment.
Before you dive into the CSS, in the Calibre editor is an option to remove all extra CSS code. Use that to make the CSS easier to edit.

I too change the indents to 1.2em. I remove the line heights as your Kobo has a setting for line height and you can set it for what you want. It's better that way. Margins should be set to 0. Again Kobo has a setting for margins and you can only increase, not decrease the margins. So again, leaving the margins at 0 lets you choose what you want. There's no need to embed Charis SIL (or the even better ChareInk version that I made). You can side load the fonts you want and use the Kobo firmware setting to select which font you want. As for justification, remove all text-align: left and justify. There again is a setting in the firmware for justification. Also, in classes that affect the body styling, remove any font-size 1em or less. Also, any you get any sort of space of 5% or more, I change that to less. What that is depends on where the space is. For ToC headers, I use a top/bottom margin of 0.8em. But you may find something like 1 or 1.5em to be more to your liking. If there are any widows and orphans in the CSS, I remove those and put a widows: 1 and orphans: 1 in the body style (if there is not a body style, add one).

Quote:
Convert removes all the unused CSS codes
So does the option in the editor in the Tools menu. And you don't end up with a conversion.

Quote:
Modify removes a lot of things that shouldn't be in the files, and on and on.
Yes, it does.

Quote:
I also highlight all the files and run the ToC plugin to edit any ToCs that need to be fixed (like add ToC from files when there are no ToCs, rename chapter numbers to Chapter 1, Chapter 2, etc, rename Chapter One, etc, to Chapter 1, etc). The ToC plugin will open the next file after you click on OK for each prior file.
The ToC I check to see if there is a Cover as the first entry so when you first view the ePub, you go right to the cover. Without Cover as the first entry, you do not see the cover and you start at whatever the first entry is. I don't go changing the names in the ToC as they are fine as is.

Quote:
My only wish is that Convert would do the Check Book and Automatically fix errors automatically during the conversions. I have to do this manually, but there are usually very few errors found after I run the Modify and Convert plugins.
You can install the epubcheck plugin for Calibre and that allows you to use epubcheck to validate your ePub. I've never had a problem with ePub that are validated with epubcheck. I also sometimes use the Calibre validator. If both say there are no errors, there are no structural errors.

Another thing I do is remove the internal ToC (the HTML ToC) and I remove things like "About the Publisher" a list of the author's other books, any reviews, advertisements, previews for other books, newsletter links, piracy notices, and any other rubbish I don't need. You just delete those files in the text section. The NCX ToC will automatically be edited to remove those files if they are there. Also, if there are any embedded fonts I don't want, I delete them and remove the code from the CSS. If you do have any embedded fonts youdo keep, in the Tools menu is where you can find the option to subset the embedded fonts to make them smaller and remove any that are not used.

Quote:
When I get done doing all of this (most of it is automated), my files are very clean looking and they all have the same format in the text for the paragraphs.
And you don't have any errors so the ePub should work no problem.

Quote:
Some files are so badly coded and have tons of <spans> and other poor coding that it can take much longer than five minutes to edit the file properly. If I really want a certain book, I will spend the time to edit everything, including the spellcheck and the Report (to fix punctuation and remove improper symbols due to scanning errors, etc).
Yes, some are rather badly coded and it does take some time to fix those. But it's up to you if you want to spend the time to fix them.

But remember, DO NOT CONVERT!
JSWolf is offline   Reply With Quote