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 08-06-2012, 12:15 PM   #1
AThirstyMind
A Thirsty Mind
AThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with others
 
Posts: 78
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
Converting epub to mobi through Kindle Previewer

I finally have those pesky CSS issues solved but now, one last issue. Chapter Headings. Body size set at 1em. Chapter Headings set at 1.226 em. Title set at 1.666em.

Text and Title look great when running epub through KindlePreviewer and they hold their size well. But Chapter Headings are huge, even bigger than the Title (which looks like it's 1.666em as in the html... 18pts). I checked the epub and of course everything is fine there.

Any ideas? Should I just set the Chapter Headings as Body Text size (1em) and maybe bold and/or italic?
AThirstyMind is offline   Reply With Quote
Old 08-06-2012, 09:16 PM   #2
jswinden
Astrophotographer
jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.jswinden ought to be getting tired of karma fortunes by now.
 
jswinden's Avatar
 
Posts: 5,219
Karma: 5642618
Join Date: Sep 2006
Location: USA
Device: iPad Mini 2, iPhone 5, Nexus 7.2
It is common to not attempt to set sizes for HTML elements and let the reader device use it's defaults. I would suggest doing that since setting the heights might be problematic depending on which device the book is displayed. Having said that I have no idea why the chapter headings are so big without seeing the CSS and HTML you used.
jswinden is offline   Reply With Quote
Old 08-07-2012, 09:01 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,774
Karma: 39540023
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
MOBI (standard old MOBI not KF8) doesn't do CSS, so everything in your source & CSS is being converted/combined into something resembling HTML 3.2 by kindlegen/previewer. I imagine the conversion algorithm is doing its best to scale your font-sizes appropriately, but you must keep in mind that font size in the MOBI markup language is not determined by "em"—and even the stuff that does recognize "em" (width, height attributes), doesn't recognize fractional ems. Stuff gets rounded. Font size in MOBI markup is manipulated by the <font> tag. So everything in your CSS related to font size must be converted to something like <font size="6"> or <font size="+1">

So given varying elements (p, h1, h2, h3, etc...) being styled with fractional ems via CSS it's not inconceivable that a font size could actually end up being much larger than you intended when run through the conversion process.

Use Mobi_Unpack or calibre's debug output to see what's actually happening inside the MOBI markup language and adjust accordingly. Simpler is almost exclusively better when dealing with the MOBI format. Meaning if you need different sized headings ... then keep it simple: just use stock heading tags (h1, h2, h3) without the CSS font-size property and h3 will always be smaller than h2 in the resulting MOBI.

There's ePub... and then there's ePub formatted to be the source used to build a comparable MOBI. The trick is learning how to combine the two so that either format is only a tweak or two to a single source-tree away.

Last edited by DiapDealer; 08-07-2012 at 09:07 AM.
DiapDealer is offline   Reply With Quote
Old 08-07-2012, 09:58 AM   #4
AThirstyMind
A Thirsty Mind
AThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with others
 
Posts: 78
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
Here is the h1 Chapter heading Style I used. Of course in the Calibre generated Mobi, it was fine... but Epub converting through KindlePreviewer/Kindlegen is where the huge h1 font came in.

h1
{mso-style-link:"Heading 1 Char";
margin-top:48.0pt;
margin-right:0in;
margin-bottom:24.0pt;
margin-left:0in;
text-align:center;
page-break-before:always;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
AThirstyMind is offline   Reply With Quote
Old 08-07-2012, 10:09 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,774
Karma: 39540023
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You indicated you were using ems to size your chapter headers. Pts are rarely a good choice for font size.

What does your "Title" CSS look like (that is producing what you expected) by comparison?

EDIT: also, in addition to seeing the both the "Title" and the "Chapter" CSS, it would be helpful to see snippets of the html where the CSS is being applied (for both the Title and a Chapter heading). Making sure there are not two separate CSS classes being applied to one html element is the first order of business when trying to figure out why the Previewer/kindlegen isn't producing the styling you expect it to.

Last edited by DiapDealer; 08-07-2012 at 10:38 AM.
DiapDealer is offline   Reply With Quote
Old 08-08-2012, 04:07 PM   #6
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: 36,241
Karma: 17169472
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by AThirstyMind View Post
Here is the h1 Chapter heading Style I used. Of course in the Calibre generated Mobi, it was fine... but Epub converting through KindlePreviewer/Kindlegen is where the huge h1 font came in.

h1
{mso-style-link:"Heading 1 Char";
margin-top:48.0pt;
margin-right:0in;
margin-bottom:24.0pt;
margin-left:0in;
text-align:center;
page-break-before:always;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
An even better way to do it is...

Code:
<h2>Chapter One</h2>
Code:
h2 {
font-family: sans-serif;
margin-top: 1em;
margin-bottom: 1em;
text-align: center
}
You will find h2 is a much better size.
JSWolf is offline   Reply With Quote
Old 08-09-2012, 09:09 AM   #7
AThirstyMind
A Thirsty Mind
AThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with others
 
Posts: 78
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
Thanks... I'm almost there.
AThirstyMind is offline   Reply With Quote
Old 08-18-2012, 06:08 AM   #8
Oldpilot
Groupie
Oldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with others
 
Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
I use percents for the headings. h1 is 200%, h2 150%, h3 125%, all centered, and h4 is 125% flush left.

DiapDealer: if CSS is converted to tags for the e-ink Kindles, is a KF7 file therefore bigger than a KF8 file for the Fire and its friends?
Oldpilot is offline   Reply With Quote
Old 08-18-2012, 02:04 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,774
Karma: 39540023
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Oldpilot View Post
DiapDealer: if CSS is converted to tags for the e-ink Kindles, is a KF7 file therefore bigger than a KF8 file for the Fire and its friends?
Looking at recent purchases of mine from Amazon, yes... the file size of the stand-alone MOBI file is consistently larger than its stand-alone KF8 counterpart. Not much of a sampling to work with, but it seems logical to me.

Remember though: being "eInk" isn't the determining factor in what supports KF8 (or what gets converted to old-style, html tag attributes). The latest generation eInk Kindles support KF8 now as well. CSS is converted to tag attributes for MOBI, period. Regardless of the device reading it.

Last edited by DiapDealer; 08-18-2012 at 02:12 PM.
DiapDealer is offline   Reply With Quote
Old 08-21-2012, 10:34 AM   #10
Oldpilot
Groupie
Oldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with othersOldpilot plays well with others
 
Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
Fascinating. I should go unpack a mobi file to have a look at this phenomenon.
Oldpilot is offline   Reply With Quote
Old 09-11-2012, 11:26 AM   #11
AThirstyMind
A Thirsty Mind
AThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with others
 
Posts: 78
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
Another quick question... I see that you all use the opf file (booktitle.opf) in KindlePreviewer to make the mobi... I've tried to do that, and my KindlePreviewer balks and won't convert. The epub file (Booktitle.epub) converts fine though. What am I doing wrong?
AThirstyMind is offline   Reply With Quote
Old 09-11-2012, 11:28 AM   #12
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: 36,241
Karma: 17169472
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by AThirstyMind View Post
Another quick question... I see that you all use the opf file (booktitle.opf) in KindlePreviewer to make the mobi... I've tried to do that, and my KindlePreviewer balks and won't convert. The epub file (Booktitle.epub) converts fine though. What am I doing wrong?
You should be using Kindlegen and not KindlePreviewer to convert.
JSWolf is offline   Reply With Quote
Old 09-11-2012, 01:41 PM   #13
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,774
Karma: 39540023
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
You should be using Kindlegen and not KindlePreviewer to convert.
They do the same thing, Jon. Dragging an ePub/OPF/XHTML file onto KindlePreviewer works just the same as as feeding them to kindlegen (because kindlegen is embedded in KindlePreviewer). The only thing you can't do when converting using KindlePreviewer is choose your compression level.

@AThirstyMind: are you using a recent version of KindlePreviewer? I don't think it worked with OPF files until v2.4. Also, you must leave the OPF file where it is in relation to the rest of the ebook's files, so the Previewer can find them (which of course implies that the hrefs in the OPF file accurately point to the rest of the files). And also, the OPF file can't already be zipped up in an ePub archive. If you have an ePub—use the ePub.

Last edited by DiapDealer; 09-11-2012 at 01:47 PM.
DiapDealer is offline   Reply With Quote
Old 09-12-2012, 03:11 AM   #14
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 62,779
Karma: 40397151
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by DiapDealer View Post
If you have an ePub—use the ePub.
Yes, absolutely. The title of this thread says "converting ePub to Mobi". If you are indeed converting an ePub file to Mobi, you don't need to worry about the OPF - just use the ePub file as input. The only time you need to worry about the OPF is when (as I do) you're creating the Mobi from "scratch", rather than converting from an already existing ePub.
HarryT is offline   Reply With Quote
Old 09-12-2012, 07:39 AM   #15
AThirstyMind
A Thirsty Mind
AThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with othersAThirstyMind plays well with others
 
Posts: 78
Karma: 2546
Join Date: May 2011
Location: Lubec, Maine
Device: Kindle Fire, iPad, iPhone
Thanks everyone... I'll continue to use the epub in KindlePreviewer, it works fine.
AThirstyMind is offline   Reply With Quote
Reply

Tags
chapter headings, kindle previewer, mobi conversion

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed - converting ePub to Kindle mobi format VRBurnett Conversion 3 02-26-2012 04:06 PM
converting epub to mobi for kindle 3 weird hyphens monkeygirl351 Calibre 14 12-30-2011 12:57 AM
Kindle Previewer Displays HTML lists incorrectly when converting from EPUB Gandharva Kindle Developer's Corner 1 09-01-2011 06:52 PM
View mobi with Kindle Previewer just_jeepin Calibre 10 06-17-2011 08:08 AM
Converting Kindle comics in mobi to epub or pdf Sunita Calibre 3 05-16-2010 06:46 PM


All times are GMT -4. The time now is 05:55 AM.


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