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 03-27-2013, 05:46 PM   #1
pilcrowphile
Junior Member
pilcrowphile began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2013
Device: Kindle
Spacing before chapter title stopped working :(

For reference, I'm hand coding with kindlegen, and using style sheets from books where this has worked previously.

Basically, I'm used to forcing the chapter heading down a few spaces by using a couple <p>&nbsp;</p>. This has never been an issue before.

So now I'm working on a new client's book (non fiction rather than fiction for the first time, so the paragraphs have spaces between them and no indenting, via p {text-indent: 0; margin-top:0.6em;} )

Now, when I do a dummy copy (I usually start with a blank version of my book, with just a cover, title page, TOC and first chapter with a bit of dummy text).

The book seems to come all right, but when I pop it the kindle ap on my smartphone, the only bumpdown that works is on the title page. Everything else is flush with the top.

So I try setting a special 'top' class of paragraph, first with 2em margin top then with 24pt margin top, no change.

I try changing the CSS on the H3 with a larger margin-top, no change.

Then I even go back and grab the old html of another book, where I've got a copy of the book where the bumpdown works. I strip out most of the body, and try rerunning it... and the bumpdown appears to have disappeared as well.

This is driving me up a wall! I expected to be done with this book by now, but I've spent the last 3 hours trying various trouble shooting attempts at getting there to be a little whitespace above the chapter headings.

Any ideas what might be going on?
pilcrowphile is offline   Reply With Quote
Old 04-25-2013, 07:43 PM   #2
lissie
Enthusiast
lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.
 
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
Did you ever get this working - I can get top margins honoured for fist paragraphs - but not when I have aheader straight after a forced page break - it seems to be ignoring all top margins after the Kindle forced page break code
lissie is offline   Reply With Quote
Old 04-25-2013, 10:31 PM   #3
GrannyGrump
Persnickity Nitpicker
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 557
Karma: 2593116
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
I haven't worked with kindle books yet, but in ePub, sometimes you need to use *padding* instead of *margin*. Would that work for your problem?
GrannyGrump is offline   Reply With Quote
Old 04-26-2013, 05:04 AM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,377
Karma: 12871193
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by pilcrowphile View Post
For reference, I'm hand coding with kindlegen, and using style sheets from books where this has worked previously.

Basically, I'm used to forcing the chapter heading down a few spaces by using a couple <p>&nbsp;</p>. This has never been an issue before.

So now I'm working on a new client's book (non fiction rather than fiction for the first time, so the paragraphs have spaces between them and no indenting, via p {text-indent: 0; margin-top:0.6em;} )

Now, when I do a dummy copy (I usually start with a blank version of my book, with just a cover, title page, TOC and first chapter with a bit of dummy text).

The book seems to come all right, but when I pop it the kindle ap on my smartphone, the only bumpdown that works is on the title page. Everything else is flush with the top.

So I try setting a special 'top' class of paragraph, first with 2em margin top then with 24pt margin top, no change.

I try changing the CSS on the H3 with a larger margin-top, no change.

Then I even go back and grab the old html of another book, where I've got a copy of the book where the bumpdown works. I strip out most of the body, and try rerunning it... and the bumpdown appears to have disappeared as well.

This is driving me up a wall! I expected to be done with this book by now, but I've spent the last 3 hours trying various trouble shooting attempts at getting there to be a little whitespace above the chapter headings.

Any ideas what might be going on?
Have you tried using a % with a header class, instead of a paragraph class? Why are you using a para class for a chapter head? And when you say, "client," do you mean paying work?

Hitch
Hitch is offline   Reply With Quote
Old 04-26-2013, 06:09 AM   #5
lissie
Enthusiast
lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.
 
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
Quote:
Originally Posted by grannyGrumpy View Post
I haven't worked with kindle books yet, but in ePub, sometimes you need to use *padding* instead of *margin*. Would that work for your problem?
Good thought - unfortunately it didn't make any difference
lissie is offline   Reply With Quote
Old 04-26-2013, 04:52 PM   #6
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,377
Karma: 12871193
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by lissie View Post
Good thought - unfortunately it didn't make any difference
Is your smartphone displaying a K8 version? K8 will not use empty paragraphs for padding, and you may have something in your paragraph class that is cascading and overriding what you are doing, as you said you are using P classes for your chapter heads, rather than header classes, yes?

At this point, I think we'd need to see some sample content and the stylesheet.

Hitch
Hitch is offline   Reply With Quote
Old 04-26-2013, 07:04 PM   #7
lissie
Enthusiast
lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.
 
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
I didn't say I was using paragrah styles - not sure where you got that from -I'm using heading styles - as you do

My CSS is:
Code:
h1 {
text-align: center;
color: #CD1634;
padding-top: 7em;
}
and I've also tried margin-top:7em;

The html is
Code:
<MBP:PAGEBREAK />
<h1> My title</h1>
I'm seeing it not be honoured in: Kindle keyboard, kindle 4, iOS, and in the kindle previewer

I've also tried adding in
Code:
<br />
above the header as well as
Code:
<p> &nbsp;</p>
theese are ignored as well.
lissie is offline   Reply With Quote
Old 04-28-2013, 12:27 AM   #8
toertchn
Connoisseur
toertchn has a complete set of Star Wars action figures.toertchn has a complete set of Star Wars action figures.toertchn has a complete set of Star Wars action figures.toertchn has a complete set of Star Wars action figures.toertchn has a complete set of Star Wars action figures.
 
Posts: 95
Karma: 422
Join Date: Mar 2009
Device: Kindle 3
My experience some time ago:

spaces before headings only work for the first elements of the body in an html document.

The only reason I found was to split the single html file with many <mbp:pagebreaks> into many files.
toertchn is offline   Reply With Quote
Old 04-28-2013, 03:44 AM   #9
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: 6,148
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Reading systems are allowed to ignore vertical margin after a forced pagebreak, that's how the CSS specification works. Some of the tricks suggested above should work in an ePub book, but with a Kindle you are at the mercy of whatever the converter is doing to the code. Try a different converter.

Another thing you could try is CSS pagebreaks instead of mobi-specific ones:

Code:
<div class="pagebreak">&nbsp;</p>

div.pagebreak {
  page-break-before: always;
  margin: 0;
  padding: 0;
  height: 0;
}
In HTML+CSS, the margin that would be ignored is that of the <div>, but not the one of the following element (the <hX>), but I wouldn't be surprised if it didn't make any difference after conversion.
Jellby is offline   Reply With Quote
Old 04-28-2013, 08:01 PM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,377
Karma: 12871193
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by toertchn View Post
My experience some time ago:

spaces before headings only work for the first elements of the body in an html document.

The only reason I found was to split the single html file with many <mbpagebreaks> into many files.
@toertchn is correct. You need to make your "chapters" or whatever the headings are breaking into separate documents. Separate html documents, like in an ePUB. That's the only way it will work in KindleGen.

It's been this way for quite a few gens of Kindlegen now. I don't recall precisely when it changed; but it did.

I misunderstood your earlier statement when you said:

Quote:
Basically, I'm used to forcing the chapter heading down a few spaces by using a couple <p>&nbsp;</p>. This has never been an issue before.
Hitch
Hitch is offline   Reply With Quote
Old 04-28-2013, 09:39 PM   #11
lissie
Enthusiast
lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.lissie ought to be getting tired of karma fortunes by now.
 
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
Thanks guys - what an annoying work around!
lissie is offline   Reply With Quote
Old 04-28-2013, 10:40 PM   #12
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: 9,038
Karma: 40855212
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It's actually fairly standard procedure.
DiapDealer is online now   Reply With Quote
Old 04-29-2013, 01:10 PM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,377
Karma: 12871193
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by lissie View Post
Thanks guys - what an annoying work around!
@lissie:

As the revered Diap said, it's a fairly standard practice, especially when it comes to older devices, which load a book file-by-file. It will make the book load faster and work better. It's not just to make Chapter headers work. ;-) It's absolutely de rigueur for ePUBs for that reason.

Hitch
Hitch is offline   Reply With Quote
Old 04-29-2013, 03:40 PM   #14
GMcG
Writer
GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.GMcG ought to be getting tired of karma fortunes by now.
 
GMcG's Avatar
 
Posts: 91
Karma: 556222
Join Date: Mar 2011
Location: Munich, Germany
Device: none
Try this:

<h1><br /><br /><br />My title</h1>

(<br /> should not be *before* the header but *within*.)

George
GMcG is offline   Reply With Quote
Old 05-01-2013, 12:23 AM   #15
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 277
Karma: 556004
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Ignoring top margins immediately after an internal page break is a known quirk with Kindle readers:

https://kdp.amazon.com/community/mes...ssageID=311217

If you don't want to split the file into multiple HTML files, you can probably work around this quirk by adding a block element before the <h1> tag, e.g.

Code:
<div style="height: 1px; width: 1px"></div>
<h1> ... </h1>
dgatwood 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
Troubleshooting Kindle K3 (keyboard) losing chapter head spacing. timecheck00 Amazon Kindle 5 11-30-2012 08:57 PM
Not correctly detecting chapter spacing julid Conversion 12 08-13-2012 01:11 PM
IQ HELP MY IQ HAS STOPPED WORKING Jaxie PocketBook 3 03-29-2012 04:57 PM
ePub: paragraph vs/ chapter line spacing hollowayhouse Conversion 3 05-27-2011 06:08 AM
Stopped working? pshrynk Calibre 8 02-14-2009 04:43 PM


All times are GMT -4. The time now is 06:49 PM.


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