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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 11-25-2022, 11:29 AM   #1
Princess kindle
Enthusiast
Princess kindle began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2019
Device: kindle 8th
Please help. Epub to kfx conversion extract css format from another book.

Hi everyone, I study law and use a kindle, unfortunately the books of my degree are not in the amazon store, so I had to buy them in Epub. Now I want to convert them to kfx, but I want them to look the same in terms of format: margins, space between lines, indentation, space between titles and paragraphs and others like the books I bought on Amazon. Send to kindle only converts to azw3 but not to kfx.

1. Is there a way to extract the css styles of the kindle books that I like? To apply those parameters to my conversion

2. If not then could you please tell me your workflow to convert a book to kfx and have it as you like?

3. If there is a more direct way to address my problem please tell me. Maybe you are looking at the problem the wrong way.

4. I don't know anything about css but I want to learn because there is a lot of information here in the forums that would be very useful to me but I don't understand much of it. where to start? I searched about css in google but I see that it is for websites not for books, so I guess they are 2 different css.

Thank you all very much for your answers and have a nice day.
Princess kindle is offline   Reply With Quote
Old 11-25-2022, 12:53 PM   #2
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,284
Karma: 6433040
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by Princess kindle View Post
2. If not then could you please tell me your workflow to convert a book to kfx and have it as you like?
I don't recall whether this was much needed for KFX customisation, as there's been quite some time since I've used the KFX output plugin -- I don't even have Kindle Previewer in my current Windows installation. But I think you could play with the settings shown in this screencap:

Click image for larger version

Name:	MWSnap0905 2022-11-25, 13_27_37.png
Views:	206
Size:	60.9 KB
ID:	198008

CSS for ebooks is pretty much the same as for html, as EPUBs are mostly a bunch of xhtml files and images, though I think better answers regarding styling questions will come from other forum members.

Basically you have an element (paragraph, for instance) to which you apply a rule (text-align, for example)

Last edited by Comfy.n; 11-25-2022 at 02:49 PM.
Comfy.n is offline   Reply With Quote
Old 11-25-2022, 12:56 PM   #3
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,284
Karma: 6433040
Join Date: Sep 2020
Device: Calibre E-book viewer
Forgot to suggest opening any EPUB you like in Calibre Editor or Sigil, and see what CSS rules you'd like to tweak

Last edited by Comfy.n; 11-25-2022 at 06:07 PM.
Comfy.n is offline   Reply With Quote
Old 11-25-2022, 01:19 PM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 12,376
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
The azw3 is closer to epub than KFX.
We don't create KFX at all.
Even on Amazon, if you used Download for USB transfer and a Kindle that has later than FW 3.5.x or so you never get KFX. KFX is delivered to Kindle apps and newer Kindles using WiFi/3G/4G etc.
Quoth is offline   Reply With Quote
Old 11-25-2022, 02:41 PM   #5
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,484
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
You can download Kindle Previewer and install the KFX plugins for Calibre and use Calibre to convert your ePub to KFX and then send the KFX to your Kindle via USB.
JSWolf is online now   Reply With Quote
Old 11-25-2022, 05:46 PM   #6
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,304
Karma: 12587727
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by JSWolf View Post
You can download Kindle Previewer and install the KFX plugins for Calibre and use Calibre to convert your ePub to KFX and then send the KFX to your Kindle via USB.
Yep. I agree.

Quote:
Originally Posted by Princess kindle View Post
[...] I had to buy them in Epub. Now I want to convert them to kfx, but I want them to look the same in terms of format: margins, space between lines, indentation, space between titles and paragraphs and others like the books I bought on Amazon.
Ahhh... getting all your ebooks to "look exactly the same"... that's a bit more trouble. The holy grail.

Every single book is going to be completely different on the inside, so there's no one-button press or one-button solution for this.

- - -

Your best bet, like JSWolf said, is to just:

1) Convert your EPUBs into Amazon formats using Calibre or Kindle Previewer.

2) Transfer that over to your Kindle.

- - -

To try to "normalize all your ebooks"... that's a lifelong task. :P

If you learn the basics of HTML+CSS though, you COULD know enough to go inside ebooks and fix some particularly egregious errors.

Like let's say you try to read a book and the font size is HORRIBLE.

You could poke around inside and remove the offending code.

Or if the publisher accidentally stuck dark text/backgrounds, making "Dark Mode" impossible (black-on-black text). You could go in and fix those pieces.

Quote:
Originally Posted by Princess kindle View Post
3. If there is a more direct way to address my problem please tell me. Maybe you are looking at the problem the wrong way.
Do the conversion way... save your time/sanity. :P

- - -

But, if you really want to learn about ebooks... then you could dig into the innards.

Open some of those EPUBs in Sigil/Calibre and take a look inside.

Or if you have Amazon ebooks, install the fantastic Calibre plugins:

That lets you convert from Amazon's ebooks into an EPUB, which you can then open up and look inside.

Open up some of your favorite books and see how they do it.

- - -

Another great way to learn is to find ebooks in the MobileRead library.

You can open those up and look inside + see how they're created. Usually the people here take very high pride in their work, so the HTML+CSS is going to be A LOT CLEANER and easier to understand.

If you want to see some of my ebooks, here's an example:

I did that one in 2019.

Open up that EPUB in Sigil and take a closer look.

For the most part, almost all my ebooks (over 650+) are using very similar code with only slight deviations.

Quote:
Originally Posted by Princess kindle View Post
1. Is there a way to extract the css styles of the kindle books that I like? To apply those parameters to my conversion
It's possible, it's possible.

But, like I explained above, each ebook is going to have unique innards, so things might not easily be able to carry over in "one button push".

Better to learn the basics of HTML+CSS, so you can open up the book and see WHAT THE HECK IT'S doing, then surgically go in there and correct your exact issue if needed.

Like if some heading is using an AWFUL FONT that's too thin + unreadable on e-ink, you can go inside and zap that problem. :P

Quote:
Originally Posted by Princess kindle View Post
4. I don't know anything about css but I want to learn because there is a lot of information here in the forums that would be very useful to me but I don't understand much of it. where to start?
I responded with some basic links/ideas in a post you just revived today:

Quote:
Originally Posted by Princess kindle View Post
I searched about css in google but I see that it is for websites not for books, so I guess they are 2 different css.
There is only 1 CSS, lol.

But the stuff geared towards websites is usually very fancy/complicated.

Ebooks are very simplified, and all you really need are:

The Basic Building Blocks of HTML + CSS

HTML basics
  • <p> = a paragraph
  • <h1> = Heading 1 (or Parts)
  • <h2> = Heading 2 (or a Chapter/Subheading)
  • <blockquote> = a blockquote
  • <i> / <em> = Italics / Emphasis
  • <b> = Bold
  • <a> = a link
  • <table> = a table
  • [...]

and CSS:
  • font-size = how big do you want the text?
  • margin-top / margin-bottom = adds a margin above/below the thing!
  • margin-left / margin-right = adds a margin to the left/right of the thing!
  • text-indent = how much of an indent do you want?
  • text-align = Do you want the thing left, right, centered, or justified?
  • [...]

It seems overwhelming initially, but if you learn piece-by-piece, you can figure it out.

- - -

Like what does this do?

HTML:

Code:
<h2>Why Homeschooled Children Love Reading</h2>

<p class="noindent">I saw the headline in Monday’s <i>Harvard Gazette</i>: “Life Stories Keep Harvard Bibliophile Fixed to the Page.” My first thought was, “I bet he was homeschooled.”</p>
CSS:

Code:
h2 {
	text-align: center;
	text-indent: 0;
}

.noindent {
	text-indent: 0;
}
Well, let's break it down:
  • <h2>Why Homeschooled Children Love Reading</h2>
    • This is the chapter's name!
  • <p class="noindent">
    • This is a paragraph!
    • And it has a class called "noindent".
      • Hmmm, I wonder what that does?
  • <i>Harvard Gazette</i>
    • This is in italics!

And now let's look at the CSS:
  • That 1st thing says: "Whenever you see an h2, make it centered + have no indent."
  • The 2nd thing says:
    • "Whenever you see a class called noindent... make sure it has 0 indent!"
    • Note: The '.' is a special symbol in CSS. That stands for "class".
      • So what ".noindent" actually says is "Hey! Look for a CLASS called noindent. Then do this stuff to it."

There you go, now you're well on your way.

Open up your favorite ebooks and try to see what the heck they're doing. If you don't understand something, you can always ask.

- - -

Extra: What do you think this CSS does?

Code:
blockquote {
	margin-top: 1em;
	margin-bottom: 1em;
	margin-left: 10%;
	margin-right: 10%;
}

.right {
	text-indent: 0;
	text-align: right;
}
Impossible!!!

- - -

Side Note: If you want to see that homeschooling ebook I worked on, you can find it here:

Open it in Sigil (or Calibre) and see the clean code! Poke around, see if you can figure out what piece does what!

Quote:
Originally Posted by Princess kindle View Post
Thank you all very much for your answers and have a nice day.
No problem.

Last edited by Tex2002ans; 11-26-2022 at 03:21 AM.
Tex2002ans is offline   Reply With Quote
Old 11-25-2022, 09:22 PM   #7
Princess kindle
Enthusiast
Princess kindle began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2019
Device: kindle 8th
Hello, I thank you all for your help. There are wonderful people here on this forum.

Dear Text2002 ans, you have given me a lot of information, it took me several days to learn everything you said. The examples you gave are wonderful, I appreciate that you have taken all the time to teach me, I will review what you say with a magnifying glass, perhaps that is why I suddenly take time to answer if I have any doubts.

Comfy.n don't know html either hahaha, the only thing I know about any programming language was a course of a few hours in python. I'm going to install sigil, I've heard a lot of good things here, and I'm going to play around with a book. spoiling you learn hahaha.


Jswolf : If I have the plugin, and have used it a couple of times, it's painfully slow. But I feel that I still need to know things, Amazon books look nice, but when they are converted, they lack I don't know what, they don't look professional. I am going to follow your advice to all of them and they are right when it comes to fixing the most serious or annoying errors, the rest is very cumbersome when you have several books. Greetings to all.
Princess kindle is offline   Reply With Quote
Old 12-05-2022, 03:56 PM   #8
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
I've used this style sheet for ten years: https://notjohnkdp.blogspot.com/2013...yle-sheet.html

I occasionally tweak it, but copying those items into a plain-text file named epub.css will handle about any book you're likely to create. (No tables. I don't mess with tables in ebooks.)
Notjohn 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 to make a book in kfx format have the same number of pages as one in azw3? ksyll Conversion 3 08-28-2022 07:41 PM
EPUB to KFX conversion insights Goli4th Library Management 7 07-16-2022 05:30 PM
Epub to KFX conversion issue Surreal Introduce Yourself 0 10-18-2019 03:15 PM
Does converting to KFX format change or limit the CSS styling of the source file? jdunning Conversion 3 08-01-2019 11:35 PM
Why, During ePub to ePub Conversion does Calibre changes existing CSS classes? JSWolf Conversion 7 08-06-2011 08:32 PM


All times are GMT -4. The time now is 01:05 PM.


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