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 07-01-2012, 11:16 PM   #1
_savage
Connoisseur
_savage began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
CSS ignored in .mobi (on Kindle)

Hi,

I've spent the last few days putting together an eBook in .epub format which renders just fine on my Nook. In order to make it available for Kindle I used this website and it seems to do a decent enough job. (Turns out that the latest kindlegen (V2.4 build 69900, link) completely breaks the encoding of some of the Pali letters, and also bloats the final .mobi file to twice the size of the original .epub file, even with -c2 compression.)

However In my .epub I used HTML quote tags like so
Code:
<q class="bla">This is a quote.</q>
and I style them as follows
Code:
q {
  quotes: none;
}
q.bla {
  font-style: italic;
}
I explicitly do not want to have quotation marks of any sort around the quote! While this works fine on my Nook and in a web browser, it seems that a 2 year old Kindle still puts quotation marks around these quotes.

Another issue are unordered bullet lists. Again, I style them to disable the bullets altogether
Code:
ul.toc {
  list-style: none;
}
only to find that my table of content
Code:
<ul class="toc">
  <li> <a href="foreword.html">Foreword</a></li>
  ...
</ul>
does render with bullets on that same Kindle.

How can I get rid of both, the quotation marks and the bullets; or is this a Kindle specific issue?

Thanks!
_savage is offline   Reply With Quote
Old 07-02-2012, 12:10 AM   #2
susan_cassidy
Wizard
susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.susan_cassidy ought to be getting tired of karma fortunes by now.
 
Posts: 1,813
Karma: 1662214
Join Date: Jan 2009
Device: Kindle, iPad (not used much for reading)
.mobi does not directly support css. It can only translate some css into equivalent plain HTML, so these constructs will not work for .mobi.
susan_cassidy is offline   Reply With Quote
Old 07-02-2012, 04:33 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,997
Karma: 4346921
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
And it is the converter which does the translation. Some converter may support some CSS, another converter will support a different set of CSS, and some things may be difficult/impossible to translate to mobi.
Jellby is offline   Reply With Quote
Old 07-02-2012, 06:33 AM   #4
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
Quote:
Originally Posted by Jellby View Post
And it is the converter which does the translation. Some converter may support some CSS, another converter will support a different set of CSS, and some things may be difficult/impossible to translate to mobi.
What does that mean? The ultimate "converter" is Kindlegen, surely?

Last edited by Oldpilot; 07-02-2012 at 06:38 AM.
Oldpilot is offline   Reply With Quote
Old 07-02-2012, 06:38 AM   #5
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
Wouldn't it be easier to go <i>This is a quote</i>?

I seem to recall that the Publishing Guidelines say (or used to say) that one can't use a table in the "table" of contents.

http://kindlegen.s3.amazonaws.com/Am...Guidelines.pdf
Oldpilot is offline   Reply With Quote
Old 07-02-2012, 07:26 AM   #6
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,767
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
You might want to also note that the <q> tag is only supported in the KF8 format (and only on the Kindle Fire) ... not the regular MOBI format.

The Amazon Kindle Publishing Guidlines gives you examples of several methods that can be used to specify separate CSS statements to tailor the MOBI portion in relation to the KF8 portion (and vice-versa). In short: starting with a validating ePub does not mean kindlegen will build from it, a MOBI/KF8 version that will be identical to the original ePub in every way. You have to learn what input Kindlegen will play nice with. The Amazon Kindle Publishing Guidelines is the place to start

Also, the "bloat" you're referring to is because the Kindlegen output contains the MOBI version (for devices that don't support KF8), the KF8 version, and the source used to create the file (in this case, the content of your ePub).

EDIT: and before you ask, no... any per/MB delivery fees that Amazon charges you is not based on the size of the file that Kindlegen produces. Only one version (MOBI/KF8) is ultimately delivered to the user based on their devices/app's capabilities. The size of the files sent to the user is the basis for that fee. Mobi_Unpack (post #5) is capable of splitting the KF8 portion of the combined file from the MOBI portion if you'd like to get an idea of the file sizes that an end-user would actually be seeing.

Last edited by DiapDealer; 07-02-2012 at 08:40 AM.
DiapDealer is offline   Reply With Quote
Old 07-02-2012, 08:32 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,997
Karma: 4346921
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Oldpilot View Post
What does that mean? The ultimate "converter" is Kindlegen, surely?
What does "ultimate" mean here? All I dare say is that the final file created by Kindlegen should be a valid mobi (or KF8 or whatever). It doesn't mean it gives you the best possible representation of what the input file was supposed to look like. There is not a 1-to-1 conversion from ePub to mobi.

Note also that the "quotes" CSS property is not supported by ePub 2.01 (meaning that compliant reading systems are not required to support/recognize it), I don't know about KF8.
Jellby is offline   Reply With Quote
Old 07-02-2012, 01:22 PM   #8
_savage
Connoisseur
_savage began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
Thank you for the responses! After I posted the question and spent the evening reading random (seemingly) related threads, I found that CSS is not part of the .mobi file. Gah.

What seems to work: replace the <q class...> tags with <span> and style the spans appropriately; that then translates in text without the quotes. Both, kindlegen and Calibre seem to add the quotation marks automatically (independently of the styling) and I couldn't find how to disable that.

As for the statement above that kindlegen is the "ultimate" converter: well, it did a very poor job with my Pali characters, and I dropped it immediately. I tried Calibre and that hasn't messed up things. Yet :-)

What about the bullet lists?

Cheers!
_savage is offline   Reply With Quote
Old 07-02-2012, 01:53 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,767
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
What about the bullet lists?
Lists have always been problematic in the mobi format.

Basically, if you have a "list" of things (like a ToC) and you don't want them to have any bullets (or numbers for that matter), then you probably shouldn't be using html list elements (<ul>, <ol>) in the first place. They don't really gain you anything (heck, I don't even use them when I do want something numbered or bulleted). Just use paragraphs. Style those paragraphs with margin-left (or use blockquotes) if you need indentation.

<ol>, <ul>, and <li> and all the css attributes that can be recognized/utilized (or will be recognized/utilized) varies so wildly and renders so differently on different devices/apps (ePub AND MOBI both) that I just don't waste my time with them.

Last edited by DiapDealer; 07-02-2012 at 02:01 PM.
DiapDealer is offline   Reply With Quote
Old 07-03-2012, 03:36 AM   #10
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 1,869
Karma: 4630362
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by _savage View Post
As for the statement above that kindlegen is the "ultimate" converter: well, it did a very poor job with my Pali characters, and I dropped it immediately.
The character issues might have been caused by incorrectly encoded .html source files. E..g non-Unicode utf8 files.
AFAIK, Pali can be written in a number of different alphabets. What kind of alphabet did you use and which characters did KindleGen have problems with?
Doitsu is offline   Reply With Quote
Old 07-03-2012, 04:57 PM   #11
_savage
Connoisseur
_savage began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jul 2012
Location: Seattle, USA
Device: Nook
Quote:
Originally Posted by Doitsu View Post
The character issues might have been caused by incorrectly encoded .html source files. E..g non-Unicode utf8 files. AFAIK, Pali can be written in a number of different alphabets. What kind of alphabet did you use and which characters did KindleGen have problems with?
Hmm.. Thanks for the hint! I just checked and noticed that none of my .html files had the appropriate header

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
but instead only a stripped down version

Code:
<html xmlns="http://www.w3.org/1999/xhtml">
After I changed the headers, kindlegen produced a .mobi file with decent Pali encoding, and even the bullets of the lists are gone.



Now: Can I strip the .mobi of all the overhead that is embedded in it?
_savage is offline   Reply With Quote
Old 07-03-2012, 05:14 PM   #12
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
Quote:
Originally Posted by Jellby View Post
What does "ultimate" mean here?
AFAIK, every file that is uploaded to the KDP is run through a converter, and that converter is Kindlegen.
Oldpilot is offline   Reply With Quote
Old 07-03-2012, 05:20 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,767
Karma: 39536849
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
AFAIK, every file that is uploaded to the KDP is run through a converter, and that converter is Kindlegen.
Only files that aren't already in the MOBI format (including the combination MOBI/KF8 files) are run through a converter. If you upload html or ePub, then yes, it's going to get run through Kindlegen. But if you use Kindlegen (or MobiPocket Creator or calibre) to create your MOBI yourself... they don't convert that again.
DiapDealer is offline   Reply With Quote
Reply

Tags
css quotes lists

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed Layout Sample ".mobi" file with package(html, css, opf, ncx files). Sushil Kindle Fire 1 01-13-2012 07:16 AM
CSS template for epub for the mobi conversioin vogella Kindle Formats 5 11-02-2011 08:19 AM
ePub to mobi, CSS and % Barty Conversion 1 03-24-2011 09:50 PM
CSS visiblility setting throws off TOC generation in MOBI Guido Henkel Calibre 1 11-02-2010 05:16 AM
CSS visiblility setting throws of TOC generation in MOBI Guido Henkel Calibre 0 11-01-2010 06:13 PM


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


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