Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2022, 07:29 AM   #1
GnRFan79
Enthusiast
GnRFan79 began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Aug 2021
Device: Kindle Oasis
Is there a way to transfer the layout/CSS data from one epub to another?

I got a copy of the Great Gatsby from Project Gutenberg and when I send this via email to my Kindle the layout looks great.

I’ve got some other epub files that when I transfer to my kindle in the same way via email the layout isn’t as good.

I presume this is because of the layout/CSS settings in the respective epub files.

Is there a way to transfer the CSS/layout data between two epub files?
GnRFan79 is offline   Reply With Quote
Old 06-12-2022, 07:35 AM   #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: 76,465
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Transferring the CSS from one ePub to another won't work unless both ePub use the exact same classes. And I doubt you'd find to random ePub using the same classes. Also, there may be some classes in the HTML that are not in the transferred CSS. So really, it's not going to work.

The solution is to hand edit each ePub.
JSWolf is offline   Reply With Quote
Advert
Old 06-12-2022, 07:36 AM   #3
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 72,538
Karma: 309500000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Yes and no and yes.

Yes, you could use Sigil to copy the CSS files from one ePub to another.

No, that won't help, because the effect that the CSS has on the layout depends on how CSS is used in the HTML.

Of course, if you're prepared to also edit the use of the CSS in the HTML (using Sigil) you could. But you might not consider it to be worth the effort.

I'd recommend looking at calibre's options for conversion to ePub. They also work on converting ePub -> ePub to re-write some of the styling.
pdurrant is offline   Reply With Quote
Old 06-12-2022, 01:02 PM   #4
GnRFan79
Enthusiast
GnRFan79 began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Aug 2021
Device: Kindle Oasis
Is there a way, say using Calibre’s epub > epub functionality, to remove all of the formatting from an epub, effectively reverting the epub back to absolute basics/default formatting?
GnRFan79 is offline   Reply With Quote
Old 06-12-2022, 01:30 PM   #5
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 72,538
Karma: 309500000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by GnRFan79 View Post
Is there a way, say using Calibre’s epub > epub functionality, to remove all of the formatting from an epub, effectively reverting the epub back to absolute basics/default formatting?
I suggest asking in the calibre forum. The Conversion sub-forum would probably be the best place. https://www.mobileread.com/forums/fo...play.php?f=235
pdurrant is offline   Reply With Quote
Advert
Old 06-12-2022, 01:59 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,557
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by GnRFan79 View Post
Is there a way, say using Calibre’s epub > epub functionality, to remove all of the formatting from an epub, effectively reverting the epub back to absolute basics/default formatting?
In calibre's editor f you delete all of the css in the stylesheet.css file that will do that, although the .xhtml or .html files will have all of the class= stuff still, but after removing the css that will all be ignored. Corner cases would be if they have css in the .xhtml/.html files. Another one that I occasionally bump into is the .xhtml/.html files use divs instead of ps for paragraphs. Also annoying is when they use p tags instead of h tags for the chapter titles but after this stuff the chapter headings are just plain.

After deleting the css from the stylesheet.css you can add your own there, which shouldn't use any classes except for default size bold and italic which you copied and saved from the original css. Here's what I use (compressed to save screen space):

Code:
body{font-size:100%;border:0;margin:0;padding:0;width:auto;}
body *{line-height:inherit;}
p{font-size:100%;margin:0;padding:0;border:0;text-indent:2em;}
a{color:inherit;text-decoration:none;}
h1,h2,h3,h4{text-align:center;}
.italic{font-style:italic;}
.bold{font-weight:bold;}
img{max-width:100%;border:none;}
For the bold and italic I search the original css for classes that have the font size at 100% or 1em and copy the class name and add them to my .italic or .bold. For example it would say .italic, .calibre8{...} if the original css had italic for the calibre8 class.

I'm doing this for my kobo, so I use calibre to convert from the amazon format to epub, and have calibre's settings to set the font size to 1em or 100%. Occasionally I start with an epub so I do an epub to epub conversion. On the kobo the above css gives a ragged right layout, which is what I want.


My objective with all this folderol is to have a consistent line spacing and font size and ragged right. So every time I open a new book I don't need to adjust any of the sliders. The end result isn't pretty but with novels there rarely is any fancy formatting that matters.
hobnail is offline   Reply With Quote
Old 06-12-2022, 01:59 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,573
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by GnRFan79 View Post
Is there a way, say using Calibre’s epub > epub functionality, to remove all of the formatting from an epub, effectively reverting the epub back to absolute basics/default formatting?
Not the epub => epub functionality, but using calibre's editor, you could remove any CSS stylesheets and inline styles.
DNSB is offline   Reply With Quote
Old 06-12-2022, 02:49 PM   #8
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: 76,465
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
An ePub with no CSS is going to look awful. You are best to learn HTML/CSS so you can edit the CSS so the eBooks looks how you like.
JSWolf is offline   Reply With Quote
Old 06-12-2022, 04:01 PM   #9
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 11,519
Karma: 230505500
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by JSWolf View Post
An ePub with no CSS is going to look awful. You are best to learn HTML/CSS so you can edit the CSS so the eBooks looks how you like.
Yeah. For example, this would nuke all the special margins of chapter headings, diary/letter entries, between sections and so on. The result would just be a plain text file, not a book

I have consistent font size and line spacing in all my books, without nuking the existing css.
Sirtel is offline   Reply With Quote
Old 06-13-2022, 12:03 AM   #10
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,557
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Sirtel View Post
Yeah. For example, this would nuke all the special margins of chapter headings, diary/letter entries, between sections and so on. The result would just be a plain text file, not a book

I have consistent font size and line spacing in all my books, without nuking the existing css.
On the kobo it turns out surprisingly well when you nuke all of the css. The paragraphs are ragged right, no indentation, and a blank line between them. Those are easily fixed with some css on the p tag. For the kinds of books that I get there are few if any diary/letter entries, and even if there are they are typically in italics. The headings formatted with p tags turn out plain with no bold and 1em but they're just 1 line and then a bunch of pages so I can overlook them being funky; if authors/formatters would use h tags they'd look fine.

I've had to get aggressive in ripping out the css because I download probably at least 1 book a day on average from ereaderiq. Trying to do a nice job like you do takes too much time, since most of these free books don't engage me so I stop and move on to the next one.

Last edited by hobnail; 06-13-2022 at 12:08 AM.
hobnail is offline   Reply With Quote
Old 06-13-2022, 03:33 PM   #11
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: 76,465
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hobnail View Post
On the kobo it turns out surprisingly well when you nuke all of the css. The paragraphs are ragged right, no indentation, and a blank line between them. Those are easily fixed with some css on the p tag. For the kinds of books that I get there are few if any diary/letter entries, and even if there are they are typically in italics. The headings formatted with p tags turn out plain with no bold and 1em but they're just 1 line and then a bunch of pages so I can overlook them being funky; if authors/formatters would use h tags they'd look fine.

I've had to get aggressive in ripping out the css because I download probably at least 1 book a day on average from ereaderiq. Trying to do a nice job like you do takes too much time, since most of these free books don't engage me so I stop and move on to the next one.
But that's CSS and not no CSS. So why rip out the CSS when it's actually not too difficult to fix the existing CSS?
JSWolf is offline   Reply With Quote
Reply

Tags
convert, css, epub


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Arc Can I transfer my Kobo data? karc04 Kobo Tablets 4 02-08-2017 08:00 PM
PRS-T1 data transfer not happening Mike L01 Sony Reader 17 12-30-2011 07:29 AM
iPad fixed layout meta-data Guido Henkel Conversion 1 09-03-2011 08:03 PM
data transfer problem ramacsony Introduce Yourself 4 06-04-2010 12:42 AM
Data Transfer GhostHawk Ectaco jetBook 4 01-02-2010 02:44 PM


All times are GMT -4. The time now is 09:26 PM.


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