View Single Post
Old 10-18-2010, 01:09 PM   #4
PatNY
Zennist
PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.PatNY ought to be getting tired of karma fortunes by now.
 
PatNY's Avatar
 
Posts: 1,022
Karma: 47809468
Join Date: Jul 2010
Device: iPod Touch, Sony PRS-350, Nook HD+ & HD
JBNY, Stanza is purposely programmed to ignore a lot of the formatting instructions in stylesheets. Specifically centering and margin-top and margin-bottom instructions.

The best way to get around it is to add !important next to the instruction. For example ...

text-align: center !important;

margin-bottom: 1em !important;

Using Calibre's built-in tweak epub feature, it's really fast to adjust the centering. It takes about a minute. Just open up the epub, select the stylesheet, open it up with a good text editor like the free Notepad++, then do a search and replace:

Find ... center
Replace with ... center !important

Use "whole word" in your search criteria. Then do a quick visual check to make sure that there was not a style called "center" to begin with. If there is, just delete "!important" that was added to it by the S&R. But most stylesheets I found have no style called simply "center."

The one caveat to this is if you do a subsequent epub-to-epub conversion. Calibre then strips out the !important tag and you have to put them back in. So I do the S&R as a last step.

I have put in a request for Calibre to respect the !important instruction but it is not implemented yet.
PatNY is offline   Reply With Quote