View Single Post
Old 02-19-2014, 02:13 PM   #6
Katsunami
Grand Sorcerer
Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.Katsunami ought to be getting tired of karma fortunes by now.
 
Katsunami's Avatar
 
Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
Quote:
Originally Posted by BookCat View Post
Katsunami, please explain that more simply. I'm a not techie and find Calibre over complex at times. I certainly could handle CSS, whatever that is.
CSS is easy; it basically states how the text has to look. To justify a book that is not justified, you do the following:

- Open the EPUB using Calibre's "Edit Book".
- Click one of the chapter files.
- Find the CSS class that represents the main body text.

(See attachment 1.)

- In this book, the class is called "calibre3", but it can have any name.
- Open the book's stylesheet (in this case, stylesheet.css).
- Find the correct class: it can be either "p.calibre3", or ".calibre3".

(See attachment 2.)

- Change "text-align: left;" to "text-align: justify;". If there is no text-align property, then add "text-align: justify;" to the class.
- Save the book.

Done.

Many books have the first paragraph non-indented, while the following paragraphs are indented. In this case, the first paragraphs will be in their own class. You will also need to find the class name that belongs to the first paragraphs, and change the justify there as well.

Master Trick:
Sometimes, books have gaps between paragraphs, or they have a weird misaligned look: this happens if the paragraphs have an extra margin that is a bit larger than the normal line height. If one of these things bother you, do the same as above, an then:

- Remove any "margin" property from the class that represents body text (and if necessary, also from the class that represents the first paragraphs.)
- Add "margin: 0;" to the class.
- Save the book.

Poof. No more margins or weird misaligned looks in the body text.

This works for most books, but sometimes it doens't; then you have a book with bad markup, and some heavy-handed editing may be needed.

=====

Alignment through conversion vs. Manual alignment by CSS
Calibre can do "Justify" and "Remove gap" while converting, as JimmyR points out, but I prefer doing this by hand. Because the re-alignment while converting is automated, the effects can not always be predicted. Sometimes, Calibre will also re-align and justify stuff that you DON'T want to change, such as poems or songs. (Think Tolkien...) Calibre may change them, but my method won't, as they will have their own class, different than the one used for the body text. (If it is a book marked up in a sane way, anyway.)

Quote:
The 505 can't display epubs very well. This is discussed in the "What we're working on" thread in the Uploads department. This is the very reason I'm buying the kindle.
Funny reason to get a Kindle. It doesn't display EPUB's at all (Unless you convert them to AZW3, obviously.)
Attached Thumbnails
Click image for larger version

Name:	1.jpg
Views:	257
Size:	707.3 KB
ID:	119281   Click image for larger version

Name:	2.jpg
Views:	252
Size:	467.8 KB
ID:	119282  

Last edited by Katsunami; 02-19-2014 at 02:27 PM.
Katsunami is offline   Reply With Quote