Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2010, 12:20 PM   #1
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
Additional CSS for conversion

I have a .doc template I use to preformat the text before conversion.
If I apply to a paragraph an style called "DramatisPersona", that becomes a CSS style in the ePUB after the conversion.

If I have an additional CSS style with the same name, shouldn't it be applied to the CSS IN THE ePUB file?

This is the code in Addtional CSS:
Code:
.AUTHOR {
display: block;
font-family: "Gunther Calligraphic";
font-size: 1.33333em;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: center;
text-indent: 0;
font-weight: bolder;
text-shadow: auto
}
But this is the code I get in the ePUB file:
Code:
.AUTHOR {
    display: block;
    font-family: Arial;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 6pt;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    text-align: center;
    text-indent: 7.2pt;
    text-shadow: auto
    }

Shouldn't both be equal? The code in ePUB file should be the same as in the "additional CSS" conversion option?
LARdT is offline   Reply With Quote
Old 02-17-2010, 12:21 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
CSS is merged, not overwritten
kovidgoyal is online now   Reply With Quote
Advert
Old 02-17-2010, 01:28 PM   #3
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
But then it seems it is merging it wrong.

It would be much better that in case of conflict the "AdditionaL CSS" should apply.
Could you please give more detail in how the merging algorithm works?


Thanks
LARdT is offline   Reply With Quote
Old 02-17-2010, 01:33 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
All the differences you're seeing come from having remove paragraph spacing and font size rescaling set.
kovidgoyal is online now   Reply With Quote
Old 02-18-2010, 03:19 AM   #5
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
Kovid,
the converted style is the exact translation of the WORD style in the html document. I mean that the CSS Additional style is completely IGNORED, does do anything.

The css style created by CALIBRE in conversion is the same no matter if ADDITIONAL CSS:

- has another style with the same name
- has NO such style
- has a style with the same name WITH NONSENSICAL values.

CSS additional text SEEMS TO BE DOING NOTHING AT ALL.

Is true that if stye is not used in the input document is added to final epub converted output, but what would be the purpose of incuding a style that is not used in the document?
Help says "CSS additional could be used to cancel out original CSS styles"

Last edited by LARdT; 02-18-2010 at 03:30 AM.
LARdT is offline   Reply With Quote
Advert
Old 02-18-2010, 12:29 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,844
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Here is how CSS is merged:

All css is extracted from teh input document. Extra css is added to the extracted css. Various manipulation is done on the css for font size rescaling, justification, margins etc.

The modified css is written back out into the output file in the form of class based selectors. What CSS overrides other css depends on the priority of the selectors used. CSS has complex rules governing this, which I dont have the time to go into here.
kovidgoyal is online now   Reply With Quote
Old 02-18-2010, 07:52 PM   #7
LARdT
The LARdT of E-Books
LARdT began at the beginning.
 
LARdT's Avatar
 
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
Thanks for your reply. Is not necesary because I suppose you are applying CSS standard rules of precedence. I can check them in the web don't worry.
OK, I'm going to experiment a little.
I want to use properly this feature because I think its quite powerful

Thanks again for your patience.

LARdT
LARdT is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
additional reading.. scottjl Apple Devices 1 04-28-2010 06:24 PM
EPub conversion stylesheet.css problem nycaleksey Calibre 1 03-25-2010 11:42 PM
ADDITIONAL CSS LARdT Calibre 1 02-04-2010 08:02 PM
ePub conversion: override existing css with a custom one sbin Calibre 1 01-09-2010 04:03 AM
Additional Columns dvs0826 Calibre 3 08-22-2009 06:43 PM


All times are GMT -4. The time now is 08:49 PM.


MobileRead.com is a privately owned, operated and funded community.