View Single Post
Old 11-25-2022, 04: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,297
Karma: 12126329
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 02:21 AM.
Tex2002ans is offline   Reply With Quote