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 12-07-2022, 06:34 PM   #1
vanishedsarah
Member
vanishedsarah began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2018
Device: Kindle Oasis
Match html & CSS of two different books?

I dont know if this is a conversion or editing question, so here goes.

I have two books that should be formatted identically, including the HTML tags and css files. I want to be able to take a page from one book, and put it into the other, without having to change a bunch of code.

I've tried converting the book with the css rules inserted in the style tab, and embedding the fonts. I haven't messed around with the HTML transform, I don't know a lot about code, is that where I'm going wrong? No matter what, both books aren't lining up.

Any help?
vanishedsarah is offline   Reply With Quote
Old 12-07-2022, 09:55 PM   #2
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 450
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
I'd look at it through the editor. I can't imagine what converting could do unless you know what is inside them in the first place. The coding possibilities are infinite. Just stuffing some css into a conversion is not going to fix all the coding that may be there.

First, Open them in the editor and run Tools-->Remove unused css in both books; that will get rid of any clutter.

Then look at both books and see just what the difference, if any, is between the css files. If they are identical, it answers your question. If not, what do you want to do? Choose one, and make the other book match?

Next question--is this a reasonable task? Is the css simple enough to be fairly easily understood? If you have two books with thousands of lines of css and it is all different...well, I'd probably quit right there. If it looks reasonable, then to continue:

Export the css file you like best from one book and import it into the other. Then select all the text files and right-click, then link in the new css file. Then you have the fun of using search and replace to make the text selectors in the book match those in the new css file. Depending on the coding, this could be anywhere from a trivial task to a horrible one; can't say without seeing the books. In the end you should be able to delete the original css file without causing any errors or leaving anything behind.

I've done this a few times, if the coding was pretty similar in the two books. If it turns out to be very different, or very complex, consider blowing it all away and putting your own (simple) css into both books.

If you ever use the EpubMerge plugin, you often face this, only within the one merged book you have made. You might make an anthology of short stories, and you want them to all display the same way. So you might have, say, 10 or more css codings to harmonise. Fun and games!

Now here is a late thought. If all you want is to be able to copy a page from one book to the other (for which you need the editor anyway, and the concept of a "page" here is very fuzzy), and have it "work" -- all you really have to do is export the css files and import each into the other book, if that makes sense. Then link them to all text files. Then any page from either book will find something to match to in the other book. Downside--if the same selector names are used with different coding in the different books, the results could be interesting.

Last edited by retiredbiker; 12-07-2022 at 11:56 PM.
retiredbiker is offline   Reply With Quote
Advert
Old 12-07-2022, 11:57 PM   #3
vanishedsarah
Member
vanishedsarah began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jun 2018
Device: Kindle Oasis
That's what I've been doing thus far, minus the remove unused css, I didn't know that was a thing, so if nothing else I'm glad for that.

The problem is the books are part of a series and there are a couple outliers that don't look anything like the others, the fonts that were used are wrong, the formatting is all over the place, in a word they simply looks bad. So, I need to fix those before I'm able to pull the pages and css into another. I was hoping it would be easier that literally going through and building it from scratch, which is where I was heading, since it seems infinitely easier that figuring out where its wrong and fixing it
vanishedsarah is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Version num doesn't match d/l? & Error when clicking Add Books callahan09 Library Management 1 02-12-2016 10:53 AM
html & css to fight the Nook centering problem Dia435 ePub 2 10-28-2012 07:21 PM
Kindle newbie needs "template" HTML & CSS Rich_H Kindle Developer's Corner 12 09-10-2012 11:16 PM
Kindle Newbie needs "template" HTML & CSS Rich_H Workshop 4 09-10-2012 08:33 PM
Best source for learning HTML & CSS bigpallooka Calibre 14 11-08-2010 02:45 PM


All times are GMT -4. The time now is 10:27 AM.


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