Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-04-2017, 06:57 PM   #1
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Changing Property Values During Conversion

I have some property values for certain CSS rules that I would like to change using Convert for several files (like 139 epub files, give or take a few).

For example, one of them is to change all the CSS rules called CCN for the properties, margin-top and margin-bottom, from 1em to 0.

Another one I'd like to change is all the CSS rules called FHM, property margin-top, from 6em to 1em.

These are just two of about six different values I'd like to change using Convert.

Is there any way to do this in the conversion process, or is using Edit Book the only way to change these values?

Thanks for any help!
deback is offline   Reply With Quote
Old 11-04-2017, 07:55 PM   #2
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: 79,746
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Are you sure those CSS names are the same in all of those 139 eBooks? I could take a random selection of ePub eBooks from the same publisher and you would find that there are differences in the CSS. So yes, the only way to do it so it works is to do it one at a time in the editor.
JSWolf is online now   Reply With Quote
Advert
Old 11-04-2017, 08:12 PM   #3
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Yup, I know that the same publisher uses different rules for the same thing all the time

Yes, in this case, they are all the same in all the books. They are all by the same author, and it looks like they were created by the same employee of the publisher. I just finished editing 100 of the 139 files. They were all the same...and monotonous fixing several things in each file with all the same CSS rules. However, if any end up being different, I would notice when viewing each file after the conversions.
deback is offline   Reply With Quote
Old 11-04-2017, 08:23 PM   #4
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
What I'd like to do is to delete all the linespaces in the Contents file and in the text paragraphs and change the text-indents to all 1.2em from 1em. I know Convert has this option, but then everything else in the file gets messed up. Oh, well, I love sitting here editing one book after the other.
deback is offline   Reply With Quote
Old 11-04-2017, 09:18 PM   #5
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can create rules to change change css values based on various criteria during conversion (look in Look & feel->Transform styles) but those are based on css properties, not css selectors. If you want to override rules based on CSS selectors, simply use the extra CSS setting and define your extra CSS like this:

Code:
.CCN {
margin-top: 0 !important
}
and so on.
kovidgoyal is offline   Reply With Quote
Advert
Old 11-04-2017, 11:30 PM   #6
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Thank you very much! It's working!

Here's what I have so far:

.ccn {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.cfmh {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
.fmh {
margin-top: 1em;
margin-bottom: 1em;
}
.tx1 {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em;
}
.tx {
margin-top: 0;
margin-bottom: 0;
text-indent: 1.2em;
}
.cotx {
margin-bottom: 0;
text-indent: 0;
}
.ls {
margin-top: 0;
margin-bottom: 0;
text-indent: 0;
}
.fmtx {
margin-bottom: 0;
}


I've experimented with the Transforming Styles section, but I haven't figured it out yet, and I'm not sure that would be something I can use. Anything I've tried in that section hasn't worked, so I'm obviously not doing it right. So, for now, I will use the Extra CSS section, which will save me a lot of time!

Thank you so much for your help and for giving me an example.
deback is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fonts and layout changing during conversion rlecessi Conversion 5 08-29-2017 04:26 AM
changing default conversion rules for a device sidshapiro Conversion 1 08-02-2013 02:27 PM
Changing original fonts in conversion OldLincoln Conversion 3 06-03-2013 02:37 PM
Fonts Changing Size Upon Conversion to EPUB pattilee Conversion 1 01-26-2012 06:03 PM
Book Conversion - Changing Original Texts RWood Sony Reader 13 04-18-2007 01:28 PM


All times are GMT -4. The time now is 03:14 PM.


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