Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-25-2010, 03:58 PM   #1
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Help:how to add CSS additional data by converting books

First sorry,I am dislectic,can't find or make keywords,second my english is not that good.
I have more then 500 books in calibre.
I want to add some lines in the css of all those books.
I found the css section and I added a path to a styles.css that I created.
In the css file are the following rules.
Code:
h1 {text-align:center;}
h2 {text-align:center;}
h3 {text-align:center;font-weight: bold;font-size: 1.44449em;}
p {margin: 0; padding: 0;}
body, div, p, h1, h2, h3, h4, none { margin: 0; padding: 0; }
p.indent{text-indent:0;}
I was hoping that converting all my epubs to epubs, it would insert these code in the css files in the books.
I now do it by hand.
What do I do wrong, or is it simply not possible to do this ?

Last edited by Nick_1964; 10-25-2010 at 04:00 PM.
Nick_1964 is offline   Reply With Quote
Old 10-26-2010, 07:37 AM   #2
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Nick_1964 View Post
I found the css section and I added a path to a styles.css that I created.
Try opening your styles.css file, copy the contents and paste into the calibre CSS Section. I do this and it works for me. I do not enter a path.
Agama is offline   Reply With Quote
Advert
Old 10-26-2010, 08:09 AM   #3
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
I tried that, but for some reason when I use paste, there is nothing visible in the field.
Maybe When I type, gonna trie that now !
Nick_1964 is offline   Reply With Quote
Old 10-26-2010, 08:11 AM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@Nick, Referencing a css filename in the Extra CSS box should work, it certainly did at one time as I used to do it all the time.

Perhaps take a step-by-step approach.

1. Try Agama's suggestion but on a single book only.

2. If that works, replace the css with the css filename (as you tried originally) but still only converting a single book.

3. If that works try step 2 but highlight 2 books for conversion.

At what point does the extra css no longer work?

P.S. Are you sure the word none is valid in this line of CSS?
Code:
body, div, p, h1, h2, h3, h4, none { margin: 0; padding: 0; }

Last edited by jackie_w; 10-26-2010 at 08:15 AM.
jackie_w is offline   Reply With Quote
Old 10-26-2010, 08:19 AM   #5
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Tried both with one book but the code does not insert in to the ebook.
Maybe it only works when converting from one sort to another, not epub to epub.
Even without the "none", it doesn't work.
Nick_1964 is offline   Reply With Quote
Advert
Old 10-26-2010, 08:30 AM   #6
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Nick_1964 View Post
Maybe it only works when converting from one sort to another, not epub to epub.
I've just done an ePub to ePub conversion and it DOES use the extra CSS data.

Looks like something else is going on here.
Agama is offline   Reply With Quote
Old 10-26-2010, 08:32 AM   #7
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Quote:
Originally Posted by Agama View Post
I've just done an ePub to ePub conversion and it DOES use the extra CSS data.

Looks like something else is going on here.
Possible.. but for me the task is to find out where
Nick_1964 is offline   Reply With Quote
Old 10-26-2010, 08:33 AM   #8
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
epub to epub should work fine. I just tried converting with
Code:
body {background-color:yellow}
in the ExtraCSS box. Viewing the epub in the Calibre viewer correctly displays a bright yellow background.

[Edit:] Oops. Too slow...
jackie_w is offline   Reply With Quote
Old 10-26-2010, 08:41 AM   #9
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
In the viewer... but does the change allso appear in the book itself when editing it with sigil ??
Nick_1964 is offline   Reply With Quote
Old 10-26-2010, 08:44 AM   #10
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Nick_1964 View Post
Possible.. but for me the task is to find out where
Maybe you could make a new, simple ePub without extra CSS, then try a reconvert with the extra CSS. If that fails then you could post your simple ePub to this forum for testing. What version of calibre are you on?
Agama is offline   Reply With Quote
Old 10-26-2010, 08:47 AM   #11
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
I don't think updating the CSS in your epubs en-masse is as simple as this.

For instance if you put
Code:
h1 {text-align:center;}
in ExtraCSS but the HTML in your epub is something like
Code:
<h1 class="mystyle">Chapter One</h1>
and existing CSS in the epub something like
Code:
.mystyle {text-align:left}
then your ExtraCSS won't override what's already in the epub.

You would need to be more specific in ExtraCSS e.g.
Code:
h1.mystyle {text-align:center}
jackie_w is offline   Reply With Quote
Old 10-26-2010, 09:09 AM   #12
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Quote:
Originally Posted by Agama View Post
Maybe you could make a new, simple ePub without extra CSS, then try a reconvert with the extra CSS. If that fails then you could post your simple ePub to this forum for testing. What version of calibre are you on?
That's a very good one !
I have the latest version 0.7.24
I will try that first.
Then I follow the advice of jacky_w
For my simple thoughts it was like this, after conversion my css code is just put at the bottom of the css file.
When it only change's value's if my change isn't already in the css or if my priority is higher,then I have a problem, I must convert my rules in such a priority that mine is always overruling the one already in the css.
That's to difficult for me because the books aren't made by me and the rules in the css files are always different...
I just want to have all my books the same look, chapter numbers in the middle,everything starting in the left.
(sorry for the bad english but sometimes a book look like this: )
Code:
Hello I am mister Nick
       Oh yeah ?
Yes it is..
       Sorry
I want to have it all like this:
Code:
Hello I am mister Nick
Oh yeah ?
Yes it is..
Sorry
So I must think hard now how to change things.. but that must wait,because 2 of the cats i have want my attention badly and are moonwalking on my keyboard now

Last edited by Nick_1964; 10-26-2010 at 09:12 AM.
Nick_1964 is offline   Reply With Quote
Old 10-26-2010, 09:13 AM   #13
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Nick_1964 View Post
In the viewer... but does the change allso appear in the book itself when editing it with sigil ??
My test changes were shown in Sigil and, more importantly, were incorporated in the calibre generated stylesheet file.
Agama is offline   Reply With Quote
Old 10-26-2010, 09:18 AM   #14
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Nick_1964 View Post
I just want to have all my books the same look, chapter numbers in the middle,everything starting in the left.
Ah now I see! That's just what I do with all my books because I like a consistent style. So I simply use calibre's Tweak ePub utility to replace the calibre generated style sheet with my own standard one. (I also remove all the class="calibre.." attributes). You could use Sigil to do the same.

This is of course a one-book-at-a-time process but it works.
Agama is offline   Reply With Quote
Old 10-26-2010, 09:47 AM   #15
Nick_1964
Bookworm
Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.Nick_1964 ought to be getting tired of karma fortunes by now.
 
Nick_1964's Avatar
 
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
Quote:
Originally Posted by Agama View Post
Ah now I see! That's just what I do with all my books because I like a consistent style. So I simply use calibre's Tweak ePub utility to replace the calibre generated style sheet with my own standard one. (I also remove all the class="calibre.." attributes). You could use Sigil to do the same.

This is of course a one-book-at-a-time process but it works.
Yes and because I have so many books,it would much more easy if a tool could do this, I hate it when chapters are not in the toc,when after the end of a chapter there is not a pagebreak.
For me it's simple, chapter numbers in the middle, text all to the left, pagebreak at the end of a chapter..
But because I am dislectic in a special way it is not easy for me to tell what I mean,then somehow try to tell (write it) in English , allso after just one year english lessons... I must look more into the tweak utility but even don't know where to find that.. but thats another story.
I made the simple e-book and it convert the css, so I have to do it manually..

I do it a little more easy, I use total commander,batch rename all extentions in zip,then I can go in it with total commander, replace the css file.
At the end, I rename them all back into epub but even then, it's a hell of a job,because not all of the css files has the same name in it...
Nick_1964 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I edit/add Meta Data 4jacks Kindle Formats 4 10-07-2010 04:33 AM
Add books - Meta Data format wwaldo Calibre 2 03-17-2010 07:38 PM
Additional CSS for conversion LARdT Calibre 6 02-18-2010 07:52 PM
ADDITIONAL CSS LARdT Calibre 1 02-04-2010 08:02 PM
Way to add additional information with Calibre? MidknytOwl Sony Reader 5 09-11-2009 01:53 PM


All times are GMT -4. The time now is 05:22 AM.


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